本文整理匯總了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