From ad14f703472c2038a1204bf8a018b5b86037894b Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sat, 16 Apr 2022 11:20:25 +0200 Subject: [PATCH] Now bug gone? --- ultimatetictactoe.py | 2 +- vacuumDecay.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ultimatetictactoe.py b/ultimatetictactoe.py index c20962d..4ebe053 100644 --- a/ultimatetictactoe.py +++ b/ultimatetictactoe.py @@ -189,7 +189,7 @@ class Model(nn.Module): def humanVsAi(train=True, remember=True): init = TTTState() run = NeuralRuntime(init) - run.game([0,1], 4) + run.game([0,1], 3) if remember or train: trainer = Trainer(init) diff --git a/vacuumDecay.py b/vacuumDecay.py index ecffbb1..0e1dd22 100644 --- a/vacuumDecay.py +++ b/vacuumDecay.py @@ -12,6 +12,8 @@ from queue import PriorityQueue, Empty from dataclasses import dataclass, field from typing import Any import random +import datetime +import pickle class Action(): # Should hold the data representing an action @@ -416,7 +418,7 @@ class Runtime(): return raise Exception('No such action avaible...') - def turn(self, bot=None, calcDepth=7): + def turn(self, bot=None, calcDepth=3): print(str(self.head)) if bot==None: c = choose('Select action?', ['human', 'bot', 'undo', 'qlen']) @@ -589,5 +591,5 @@ class Trainer(Runtime): 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: - pickel.dump(term, f) + pickle.dump(term, f)