omron-sinicx / neural-astar

Official implementation of "Path Planning using Neural A* Search" (ICML-21)
https://omron-sinicx.github.io/neural-astar
Other
236 stars 57 forks source link

Possibility of non-square map #17

Closed ringochuchudull closed 1 year ago

ringochuchudull commented 1 year ago

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

yonetaniryo commented 1 year ago

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.

https://github.com/omron-sinicx/neural-astar/blob/719b579d3f6867e1e4b4ebbb6443047e2c8db052/src/neural_astar/planner/differentiable_astar.py#L39-L40

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

yonetaniryo commented 1 year ago

Now supported by https://github.com/omron-sinicx/neural-astar/pull/18