rewrite tensor & calcEdgeWeight
add gradient descent smoothing