omron-sinicx / neural-astar

Official implementation of "Path Planning using Neural A* Search" (ICML-21)

Home Page:https://omron-sinicx.github.io/neural-astar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possibility of non-square map

ringochuchudull opened this issue · comments

Hi All,

I have attempted to use the repo to perform neural A* search on a rectangle like graph with size (8, 1, 32, 64). However it seems that 'get_heuristic' will output an einsum error. I am wondering if there's any potential fix to this problem

Hi, thanks for your comment!

In fact the current implementation assumes input images to be square.

But extending it to non-square maps wouldn’t be that hard. I believe that specifying size1, size2 = goal_maps.shape[-2], goal_maps.shape[-1] and fixing the following two lines will solve the problem for the get_heuristic function.

num_samples, size = goal_maps.shape[0], goal_maps.shape[-1]
grid = torch.meshgrid(torch.arange(0, size), torch.arange(0, size))

I will fix it in the next update. Thank you!

Now supported by #18