Skip to content

Commit

Permalink
Added the ability to have infinite amount of epochs
Browse files Browse the repository at this point in the history
  • Loading branch information
ianbryant2 committed Nov 6, 2023
1 parent 80f55fb commit 70561c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions AI_Learns_Flappy.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ def main(typeGame):
fps = 30

try:
epoch = int(sys.argv[3])
if sys.argv[3].upper() == 'INFINITE':
epoch = None
else:
epoch = int(sys.argv[3])
except:
if typeGame != None and typeGame.upper() == 'EVALUATE':
epoch = None
Expand Down Expand Up @@ -67,7 +70,7 @@ def main(typeGame):
gm = fp.gameManager(EvaluateGame(file_dir = file_dir, fps = fps))
agent = fm.agent(gm)
agent.model.load_state_dict(torch.load(file_dir + '/test_weights.pt'))
fm.evaluate(agent)
fm.evaluate(agent, epochs = epoch)

elif typeGame.upper() == 'TEST':

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ If not provided the program will default to 30 fps.

__epoch:__ Will be the amount of epochs the agent will either train, evaluate, or train during test.
If not provided the program will defalut to 2500 epochs.
If the word ```Infinite``` is put in, there will be no limit to the epochs



Expand Down

0 comments on commit 70561c2

Please sign in to comment.