Beispiel #1
0
def main():
    print("Starting run (v{})".format(__version__))
    init_directories()
    model_name = "model_1"
    model = create_initial_model(name=model_name)

    while True:
        model = load_latest_model()
        best_model = load_best_model()
        train(model, game_model_name=best_model.name)
        evaluate(best_model, model)
        K.clear_session()
Beispiel #2
0
def main():

    init_directories()
    model_name = "model_1"
    model = create_initial_model(name=model_name)

    while True:
        model = load_latest_model()
        best_model = load_model(os.path.join(conf['MODEL_DIR'],
                                             conf['BEST_MODEL']),
                                custom_objects={'loss': loss})
        train(model, game_model_name=best_model.name)
        evaluate(best_model, model)
Beispiel #3
0
 def setUp(self):
     init_directories()
     model_name = "model_1"
     model = create_initial_model(name=model_name)
     best_model = load_best_model()
     if best_model.name == model.name:
         train(model, game_model_name=best_model.name)
         evaluate(best_model, model)
         # We save wether or not it was a better model
         full_filename = os.path.join(conf['MODEL_DIR'], conf['BEST_MODEL'])
         model.save(full_filename)
     else:
         model = best_model
     self.model = model
Beispiel #4
0
def main():
    config = tf.ConfigProto()
    config.gpu_options.allow_growth = True
    K.set_session(tf.Session(config=config))
    init_directories()

    model_name = "model_1"
    model = create_initial_model(name=model_name)

    while True:
        best_model = load_best_model()
        self_play(best_model,
                  n_games=10,
                  mcts_simulations=conf['MCTS_SIMULATIONS'])
        K.clear_session()