snake-ai-pytorch icon indicating copy to clipboard operation
snake-ai-pytorch copied to clipboard

Model isn't loaded from file

Open JS-E opened this issue 2 years ago • 5 comments

Love what you've done with the python snake stuff, but i've noticed if you run the ai again, it doesn't use what it's already learnt and start from there again. Is there an easy way to get this implemented? I'm not great at python but i'd be happy to give it a go if i'm pointed in the right direction?

JS-E avatar Jun 12 '22 20:06 JS-E

I had this same question, just commenting to see if an answer is ever provided

joeyadelman avatar Jul 13 '22 03:07 joeyadelman

You can save what the AI has learned in a folder somewhere and reuse that contents when train() begins again.

Vansh404 avatar Jul 13 '22 11:07 Vansh404

I made a code entirely based on this repository. It includes this functionality. Maybe it helps: https://github.com/flaviolsousa/ping-pong-ia/blob/main/classes/model/model.py

flaviolsousa avatar Aug 30 '22 14:08 flaviolsousa

I made a code entirely based on this repository. It includes this functionality. Maybe it helps: https://github.com/flaviolsousa/ping-pong-ia/blob/main/classes/model/model.py

I tried by loading state dict but still it performs poorly (starts learning from scratch everytime its ran)

Dev-Mehta avatar Jan 16 '23 09:01 Dev-Mehta

I made a code entirely based on this repository. It includes this functionality. Maybe it helps: https://github.com/flaviolsousa/ping-pong-ia/blob/main/classes/model/model.py

I tried by loading state dict but still it performs poorly (starts learning from scratch everytime its ran)

you can delete "if random.randint(0, 200) < self.epsilon" in agent.py.

Zrsion avatar Apr 24 '23 07:04 Zrsion