提交 6d327bd5 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix the the gradient on W. Finally.

上级 94fb4d03
......@@ -50,8 +50,8 @@ def gemv(alpha, A, x, beta, y):
def ger(alpha, x, y, A):
assert A.shape[1] == x.shape[0]
assert A.shape[0] == y.shape[0]
assert A.shape[0] == x.shape[0]
assert A.shape[1] == y.shape[0]
handle = scikits.cuda.misc._global_cublas_handle
......@@ -150,8 +150,8 @@ class SparseBlockOuterSS(GpuOp):
out_id = yIdx[j]
for i in range(x.shape[0]):
inp_id = xIdx[i]
ger(numpy.float32(1.0), x[i],
y[j], o[inp_id, out_id])
ger(numpy.float32(1.0), y[j],
x[i], o[inp_id, out_id])
out[0] = o
......
......@@ -92,7 +92,7 @@ def test_blocksparse_op_grad():
utt.verify_grad(f, [b_val, h_val, W_val])
def test_blocksparse_op_grad2():
def test_blocksparse_op_grad_shape():
b = tensor.fmatrix()
W = tensor.ftensor4()
h = tensor.fmatrix()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论