Compute minimum peak

1. apply pseudo code
2. create compute_map and node_mem in new method
Those 3 lines don't do the pseudo code. I think this should work:
if idx in dmap:
   i = dmap[idx]
else:
   i = vmap[idx]
# In some case, i could be a list, but I forgot the detail. So if this happen, it will crash.
assert isinstance(i, theano.Variable)
view_of[out] = view_of.get(i, i)
viewed_by[i].append(out)