Skip to content

Instantly share code, notes, and snippets.

@PENGZhaoqing
Last active March 23, 2019 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PENGZhaoqing/720c4379b95d79b149f09720321b31cb to your computer and use it in GitHub Desktop.
Save PENGZhaoqing/720c4379b95d79b149f09720321b31cb to your computer and use it in GitHub Desktop.
test
def build(self):
"""
Builds the full Keras model and stores it in self.model.
"""
mc = self.config.model
in_x = x = Input((1, 12, 54))
x = Flatten(name='initial_flatten')(x)
x = Dense(1024,activation='relu')(x)
res_out = x
# for policy out
x = Dense(512, activation='relu')(res_out)
policy_out = Dense(self.config.n_labels, activation="softmax",name="policy_out")(x)
# for value output
x = Dense(128, activation='relu')(res_out)
value_out = Dense(1,name="value_out")(x)
self.model = Model(in_x, [policy_out, value_out], name="chess_model")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment