minpy icon indicating copy to clipboard operation
minpy copied to clipboard

Zero gradient for concatenate

Open wddabc opened this issue 8 years ago • 2 comments

Looks like the computation graph breaks on the concatenation operation. MWE:

import minpy.numpy as np
from minpy.core import grad

def foo_nocat(x):
    return 3*x 

def foo_cat(x):
    catx = np.concatenate([x, x], axis=1)
    return np.dot(catx, np.array([[1], [2]]))

test_x = np.array([[3]]) 
print grad(foo_nocat)(test_x)  # correct_output 
print grad(foo_cat)(test_x)  # should be the same

wddabc avatar Mar 10 '17 20:03 wddabc

@ZihengJiang Could you have a look? Also put this in unittest.

jermainewang avatar Mar 10 '17 20:03 jermainewang

@ZihengJiang Any follow-up on this?

Taco-W avatar May 31 '17 22:05 Taco-W