gradient with Theano
Opened this issue · 0 comments
Thanks for your paper about Medical Prediction: GRAM.
I'm using your code to learn about how it works. But it has a problem as follow.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions. initializing parameters loading data building models OrderedDict([('w', w), ('w_tilde', w_tilde), ('b', b), ('b_tilde', b_tilde)]) Traceback (most recent call last): File "glove.py", line 163, in <module> train_glove(infile, inputSize=inputDimSize, batchSize=batchSize, dimensionSize=embDimSize, maxEpochs=maxEpochs, outfile=outfile) File "glove.py", line 119, in train_glove grads = T.grad(cost, wrt=tparams.values) File "/usr/local/lib/python3.8/dist-packages/theano/gradient.py", line 501, in grad raise TypeError("Expected Variable, got " + str(elem) + TypeError: Expected Variable, got <built-in method values of collections.OrderedDict object at 0x7f778bf1c1c0> of type <class 'builtin_function_or_method'>
That is the result when I run glove.py. I don't know the reason why it happens.
Thank you for your attention.
Le Ngoc Duc.