You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to know about the implementation of _calc_ppr_node(), where each active node is popped out (.ie., node = q.pop()). I tested this pop() method. It seems less efficient than pop(0), where the list is used as a queue, not a stack. Note that pop() removes the last element of the list. Here is my testing code:
Hmm, that's quite interesting. I didn't expect the difference to be this large!
However, Python lists are really not made for removing items from their start, so this causes a big runtime overhead. That's why there is collections.deque. Unfortunately, it seems like Numba doesn't support deque yet. Also, your operations count doesn't distinguish between iterations that enter the if-condition and those who don't. Overall, pop(0) might not be as good as it seems. What we really need to check this is measure the runtime of the two variants with timeit.
An even better version of this might be via heapq. heappush and heappop add some overhead, but heapq is part of Numba now (which is wasn't when we worked on PPRGo), and this should cause even fewer operations.
Hi Dr. Gasteiger,
I'd like to know about the implementation of _calc_ppr_node(), where each active node is popped out (.ie., node = q.pop()). I tested this pop() method. It seems less efficient than pop(0), where the list is used as a queue, not a stack. Note that pop() removes the last element of the list. Here is my testing code:
The above gives me the output:
0.9981211414560676 9704.0
0.9982607923448086 1062.0
The text was updated successfully, but these errors were encountered: