Checkers-Reinforcement-Learning icon indicating copy to clipboard operation
Checkers-Reinforcement-Learning copied to clipboard

Initial Transitions for Q-Learning Agent is empty

Open Skorkmaz88 opened this issue 6 years ago • 0 comments

When I run the AI.py, initial transition data is (None, None) which is causing a crush

`--------------------------------------------------------------------------- KeyError Traceback (most recent call last) in () 1 from Board import * ----> 2 from AI import *

/home/semih/ozu/rl/homework1/Checkers-Reinforcement-Learning/AI.py in () 554 validation_info = [] 555 for j in range(NUM_TRAINING_ROUNDS): --> 556 training_info.extend(play_n_games(PLAYER1, PLAYER2, NUM_GAMES_TO_TRAIN, TRAINING_MOVE_LIMIT)) 557 PLAYER1.print_transition_information(PLAYER1.get_transitions_information()) 558 PLAYER1.set_random_move_probability(0)

/home/semih/ozu/rl/homework1/Checkers-Reinforcement-Learning/AI.py in play_n_games(player1, player2, num_games, move_limit) 457 outcome_counter[j][5] = piece_counter[3] 458 --> 459 player1.game_completed() 460 player2.game_completed() 461 #game_board.print_board()

/home/semih/ozu/rl/homework1/Checkers-Reinforcement-Learning/AI.py in game_completed(self) 169 transition = (self.pre_last_move_state ,self.post_last_move_state) 170 --> 171 self.transitions[transition] = self.transitions[transition] + self.learning_rate * reward_function(transition[0],cur_state) 172 173 self.pre_last_move_state = None

KeyError: (None, None).`

Skorkmaz88 avatar Oct 18 '17 12:10 Skorkmaz88