Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Transitions for Q-Learning Agent is empty #1

Open
Skorkmaz88 opened this issue Oct 18, 2017 · 0 comments
Open

Initial Transitions for Q-Learning Agent is empty #1

Skorkmaz88 opened this issue Oct 18, 2017 · 0 comments

Comments

@Skorkmaz88
Copy link

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).`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant