1 Star 0 Fork 0

gmachine1729 / MineSweeperNeuralNet

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
testModel.py 834 Bytes
Copy Edit Web IDE Raw Blame History
import os
import numpy as np
from keras.models import load_model
from MineSweeperLearner import MineSweeperLearner
#Prompt user to specify the model they want to use
preTrainedModels = os.listdir("trainedModels")
preTrainedModels = [i.replace(".h5","") for i in preTrainedModels if i[0] != '.']
preTrainedModels = np.sort(preTrainedModels)
prompt = "Choose which model to continue training (from 'trainedModels' folder): \n"
for i in range(len(preTrainedModels)):
prompt += str(i+1) + ". " + preTrainedModels[i] + '\n'
modelChoice = int(input(prompt))
modelChoice = preTrainedModels[modelChoice-1]
print("Loading model...")
model = load_model("trainedModels/" + modelChoice + ".h5")
learner = MineSweeperLearner(modelChoice, model)
#get batch info
nGames = int(input("How many games to test on? "))
#go
learner.testMe(nGames)

Comment ( 0 )

Sign in for post a comment

Python
1
https://gitee.com/gmachine1729/MineSweeperNeuralNet.git
git@gitee.com:gmachine1729/MineSweeperNeuralNet.git
gmachine1729
MineSweeperNeuralNet
MineSweeperNeuralNet
master

Search