Now bug gone?

This commit is contained in:
Dominik Moritz Roth 2022-04-16 11:20:25 +02:00
parent 256a9af3ed
commit ad14f70347
2 changed files with 5 additions and 3 deletions

View File

@ -189,7 +189,7 @@ class Model(nn.Module):
def humanVsAi(train=True, remember=True): def humanVsAi(train=True, remember=True):
init = TTTState() init = TTTState()
run = NeuralRuntime(init) run = NeuralRuntime(init)
run.game([0,1], 4) run.game([0,1], 3)
if remember or train: if remember or train:
trainer = Trainer(init) trainer = Trainer(init)

View File

@ -12,6 +12,8 @@ from queue import PriorityQueue, Empty
from dataclasses import dataclass, field from dataclasses import dataclass, field
from typing import Any from typing import Any
import random import random
import datetime
import pickle
class Action(): class Action():
# Should hold the data representing an action # Should hold the data representing an action
@ -416,7 +418,7 @@ class Runtime():
return return
raise Exception('No such action avaible...') raise Exception('No such action avaible...')
def turn(self, bot=None, calcDepth=7): def turn(self, bot=None, calcDepth=3):
print(str(self.head)) print(str(self.head))
if bot==None: if bot==None:
c = choose('Select action?', ['human', 'bot', 'undo', 'qlen']) c = choose('Select action?', ['human', 'bot', 'undo', 'qlen'])
@ -589,5 +591,5 @@ class Trainer(Runtime):
def saveToMemoryBank(self, term): def saveToMemoryBank(self, term):
with open('memoryBank/uttt/'+datetime.datetime.now().strftime('%Y-%m-%d_%H:%M:%S')+'_'+str(int(random.random()*99999))+'.vdm', 'wb') as f: with open('memoryBank/uttt/'+datetime.datetime.now().strftime('%Y-%m-%d_%H:%M:%S')+'_'+str(int(random.random()*99999))+'.vdm', 'wb') as f:
pickel.dump(term, f) pickle.dump(term, f)