shamidreza / deepcca

a python code for deep canonical correlation analysis (dcca) written using numpy
Other
36 stars 13 forks source link

test_cca error! #1

Open Chrisdy opened 9 years ago

Chrisdy commented 9 years ago

I have run the function test_caa() in dcca.py, then it shows error as follows: Traceback (most recent call last): File "/Users/dingheng/Downloads/deepcca-master/dcca.py", line 1053, in test_dcca() File "/Users/dingheng/Downloads/deepcca-master/dcca.py", line 792, in test_dcca gparams1 = [T.grad(cost1, param) for param in net1.hiddenLayer.params] File "/usr/local/lib/python2.7/site-packages/theano/gradient.py", line 529, in grad handle_disconnected(elem) File "/usr/local/lib/python2.7/site-packages/theano/gradient.py", line 516, in handle_disconnected raise DisconnectedInputError(message) theano.gradient.DisconnectedInputError: grad method was asked to compute the gradient with respect to a variable that is not part of the computational graph of the cost, or is used only by a non-differentiable operator: b

How to fixed it ?

jtuckerk commented 8 years ago

I am getting the same error. @Chrisdy did you find a solution?

shamidreza commented 8 years ago

Thanks for reporting the issue. I am looking to fix the training in theano. Until it is fixed you can look at dcca_numpy.py, which is a direct numpy implementation of dCCA (not theano), but the training is slower.

apple666 commented 8 years ago

I run dcca_numpy.py,and it indicates that the train takes at least 3 arguments.I add N as the first parameter,but the repeat function get a error.I don't know how to solve it,could you help me? Here is the information of error. File "C:/Users/Administrator/Desktop/deepcca-master/dcca_numpy.py", line 736, in test_regression N.train(10, learning_rate=rate) line 736 train() takes at least 3 arguments (3 given)

shamidreza commented 8 years ago

Thanks for reporting the error. I plan to solve these issues in mid-June. At the moment the library is unstable since I have not maintained it.

rawalvarun commented 8 years ago

@shamidreza Has the issue been fixed ?

@kirvenjt @Chrisdy did you figure out a fix ?

I'm getting the same error on the latest commit -

... loading data ... building the model Traceback (most recent call last): File "trial_1.py", line 7, in <module> test_dcca() File "dcca.py", line 794, in test_dcca gparams1 = [T.grad(cost1, param) for param in net1.hiddenLayer.params] File "/usr/local/lib/python2.7/dist-packages/theano/gradient.py", line 545, in grad handle_disconnected(elem) File "/usr/local/lib/python2.7/dist-packages/theano/gradient.py", line 532, in handle_disconnected raise DisconnectedInputError(message) theano.gradient.DisconnectedInputError: grad method was asked to compute the gradient with respect to a variable that is not part of the computational graph of the cost, or is used only by a non-differentiable operator: b Backtrace when the node is created: File "trial_1.py", line 7, in <module> test_dcca() File "dcca.py", line 729, in test_dcca n_out=8 File "dcca.py", line 204, in __init__ activation=T.nnet.sigmoid File "mlp.py", line 60, in __init__ b = theano.shared(value=b_values, name='b', borrow=True)

rahmacha commented 8 years ago

Hi, I am having the same error of @Chrisdy trying to run test_dcca() in dcca.py. Did you figure out a fix? Thank you