Answer the question
In order to leave comments, you need to log in
How is the strategy saved in reinforcement learning?
Parsing the program code https://github.com/Smeilz/Tic-Tac-Toe-Reinforcemen...
What did I understand?
The program has 2 modules.
Qlearning.py - responsible for training agents and saving the result of learning
Game.py - describes the process of the game The
question is how exactly does Qlearning do the saving strategy?
1) There is a line in Train.py game.saveStates()
2) It refers to a function in the game.py module
def saveStates(self):
self.player1.saveQtable("player1states")
self.player2.saveQtable("player2states")
def saveQtable(self,file_name): #save table
with open(file_name, 'wb') as handle:
pickle.dump(self.Q, handle, protocol=pickle.HIGHEST_PROTOCOL)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question