本文整理汇总了Python中Dataset.Dataset.greyScaleSampleToGridWorld方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.greyScaleSampleToGridWorld方法的具体用法?Python Dataset.greyScaleSampleToGridWorld怎么用?Python Dataset.greyScaleSampleToGridWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.greyScaleSampleToGridWorld方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_1
# 需要导入模块: from Dataset import Dataset [as 别名]
# 或者: from Dataset.Dataset import greyScaleSampleToGridWorld [as 别名]
def test_1(self):
user = User()
user.createNetwork(model="custom_mlp:2,800,0,0.3")
user.loadNetworkState("model_customMlp2_800_0_0.3__10by10___30percentsAccuracy.npz")
saveDir = "games"
# for i in [0, 1, 2]: #range(Tests.db.X_test):
for i in range(Tests.db.X_test.shape[0]):
sample = Tests.db.X_test[i]
world, start, goal = Dataset.greyScaleSampleToGridWorld(sample)
found, blocked, records = user.play(world, start, goal)
gameName = ""
if found:
gameName += "success"
elif blocked:
gameName += "blocked"
else:
gameName += "timeout"
gameName += "_" + str(i).zfill(6)
finalDir = saveDir + "/" + gameName + "/"
# os.makedirs(finalDir)
user.saveRecordsToFiles(world, start, goal, found, blocked, records, finalDir + gameName)
# for i in range(Tests.db.X_train.shape[0]):
# user.predictSample(Tests.db.X_train[i])
# world, start, goal = Dataset.greyScaleSampleToGridWorld(Tests.db.X_train[10])
# user.predictSample(user.makeSample(world, start, goal))
# user.predictSample(Tests.db.X_train[0])
# user.predictSample(Tests.db.X_train[1])
# user.predictSample(Tests.db.X_train[2])
# user.predictSample(Tests.db.X_train[3])
# user.predictSample(Tests.db.X_train[:2])
# found, blocked, records = user.play(world, start, goal)
# user.saveRecordsToFiles(world, start, goal, found, blocked, records, "games/test1/")
pass
示例2: test_1
# 需要导入模块: from Dataset import Dataset [as 别名]
# 或者: from Dataset.Dataset import greyScaleSampleToGridWorld [as 别名]
def test_1(self):
world, start, goal = Dataset.greyScaleSampleToGridWorld(Tests.db.X_train[2])
# print(world[0])
img = Images.worldToImage(world, start, goal)
pass