X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=maze.py;h=c2774dd762f398e6a2145838809133f5b8dfb386;hb=f680fa1486b0a70c37f0951cedd7b5c56b5808bb;hp=fd0a1d27b6377e65f352dae8311be096ab93b04f;hpb=3c97745cdf9ae30a87903e3039e38c868e136d6e;p=picoclvr.git diff --git a/maze.py b/maze.py index fd0a1d2..c2774dd 100755 --- a/maze.py +++ b/maze.py @@ -13,6 +13,8 @@ v_empty, v_wall, v_start, v_goal, v_path = 0, 1, 2, 3, 4 def create_maze(h=11, w=17, nb_walls=8): + assert h % 2 == 1 and w % 2 == 1 + a, k = 0, 0 while k < nb_walls: @@ -285,7 +287,7 @@ def save_image( ) imgs = torch.cat((imgs, c_score_paths.unsqueeze(1)), 1) - img = torch.tensor([224, 224, 224]).view(1, -1, 1, 1) + img = torch.tensor([255, 255, 0]).view(1, -1, 1, 1) # NxKxCxHxW if path_optimal is not None: