""" AlphaGo 的价值网络部分，用于评估棋盘状态的价值，即估算当前的局面走某步棋后的胜率 """
# from tugo.models.alphago import alphago_model
from tugo.models.alphago import AlphaGoModel
from tugo.encoders.alphago import AlphaGoEncoder
from tugo.rl.value import ValueAgent
from tugo.rl.experience import ExperienceBuffer

# init_value
rows, cols = 19, 19
encoder = AlphaGoEncoder()
input_shape = (encoder.num_planes, rows, cols)
alphago_value_network = AlphaGoModel(input_shape)

alphago_value = ValueAgent(alphago_value_network, encoder)

# train_value
experience = ExperienceBuffer.load('checkpoints/alphago_rl_experience.h5')

alphago_value.train(experience)

alphago_value.save('checkpoints/alphago_value.h5')
