def play_deep_q_model(level='level-0', model_path='./nn_model_level_0_2k_iter.h5'): dq_model = DeepQ(level) dq_model.model = load_model(model_path) def ai_func(current_game_state): return dq_model.pick_optimal_action(current_game_state) game = Game(level, init_screen=True, ai_function=ai_func) game.run()
def play_q_learning_model(level='level-0', model_path='./q_table.pkl'): q_model = QLearn() q_model.q_table = load_pickle(model_path) def ai_func(current_game_state): return q_model.pick_optimal_action(current_game_state, printing=False) game = Game(level, init_screen=True, ai_function=ai_func) game.run()
def run_with_game_loop(level='level-2', model_path='./nn_model4500.h5'): dq_model = DeepQ(level) dq_model.model = load_model(model_path) def ai_func(current_game_state): return dq_model.pick_optimal_action(current_game_state) game = Game(level, init_screen=True, ai_function=ai_func) game.run()
def run_with_game_loop(level='level-0', model_path='./q_table.pkl'): q_model = QLearn() q_model.q_table = load_pickle(model_path) def ai_func(current_game_state): return q_model.pick_optimal_action(current_game_state) game = Game(level, init_screen=True, ai_function=ai_func) game.run()
def test_setup(): game = Game('level-0', True) game.run()
from pacman.game import Game from deepq.ai_example import get_suggested_move if __name__ == '__main__': game = Game('level-2') game.run()