Ejemplo n.º 1
0
# ====================
# 학습 사이클 실행
# ====================

# 패키지 임포트
from dual_network import dual_network
from self_play import self_play
from train_network import train_network
from evaluate_network import evaluate_network
from evaluate_best_player import evaluate_best_player

# 듀얼 네트워크 생성
dual_network()

for i in range(10):
    print('Train', i, '====================')
    # 셀프 플레이 파트
    self_play()

    # 파라미터 갱신 파트
    train_network()

    # 신규 파라미터 평가 파트
    update_best_player = evaluate_network()

    # 베스트 플레이어 평가
    if update_best_player:
        evaluate_best_player()
Ejemplo n.º 2
0
from dual_network import dual_network
from self_play import self_play
from train_network import train_network
from evaluate_network import evaluate_network
# from evaluate_best_player import evaluate_best_player

dual_network()

for i in range(10):
    print('Train', i, '===================')

    self_play()
    train_network()
    evaluate_network()
Ejemplo n.º 3
0
from evaluate_network import evaluate_network
from train_network import train_network

from self_play import self_play

for i in range(10):
    print('Train', i, '====================')
    self_play()  # セルフプレイ部
    train_network()  # パラメータ更新部
    evaluate_network()  # 新パラメータ評価部
Ejemplo n.º 4
0
from evaluate_network import evaluate_network, update_best_player
from evaluate_best_player import evaluate_best_player

dual_network()
count = 0
fail_count = 0
for i in range(30):
    print('Train', i, '======================')
    self_play(fail_count)

    train_network(fail_count)

    #skip = True
    #updated = True
    #if i%10 == 0 and i != 0:
    updated = evaluate_network()
    #    skip = False
    #else:
    #    update_best_player()

    if updated == True:  # and skip == False:
        count += 1
        fail_count = 0
    else:
        fail_count += 1

    if count > 4:
        evaluate_best_player()
        count = 0

    if fail_count > 3:
Ejemplo n.º 5
0
				print("mean var:   ", np.mean(np.var(acc, axis=-1)))
		elif args.validate == "pfnn_random":
			pfnn = pfnn_random_layers.load(
						target_file, 
						args.dimension_random_noise, 
						args.layers_add_random_noise,
						args.params_random_noise,
						args.sample_noise_each_phase
					)
			pfnn.start_tf()

			dataset_config_file = args.dataset #"data/dataset.json"
			with open(dataset_config_file, "r") as f:
				config_store = json.load(f) 

			c = DirectionalController(pfnn, config_store)
			evaluate_network(pfnn, config_store)