MatthewJA / Inverse-Reinforcement-Learning

Implementations of selected inverse reinforcement learning algorithms.
MIT License
957 stars 238 forks source link

Code help #9

Closed Sankalp1233 closed 3 years ago

Sankalp1233 commented 3 years ago

I am having a little bit of issues with this part of the code: φ = T.nnet.sigmoid(th.compile.ops.Rebroadcast((0, False), (1, True))(b) + W.dot(φs[-1])). Traceback (most recent call last): File "C:\Users\Sankalp Chauhan\AppData\Local\Programs\Python\Python37\lib\site-packages\theano\gof\vm.py", line 301, in call thunk() File "C:\Users\Sankalp Chauhan\AppData\Local\Programs\Python\Python37\lib\site-packages\theano\gof\op.py", line 892, in rval r = p(n, [x[0] for x in i], o) File "C:\Users\Sankalp Chauhan\AppData\Local\Programs\Python\Python37\lib\site-packages\theano\tensor\blas.py", line 1552, in perform z[0] = np.asarray(np.dot(x, y)) ValueError: ('shapes (3,10) and (2,41) not aligned: 10 (dim 1) != 2 (dim 0)', (3, 10), (2, 41))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "ID_grouping.py", line 363, in learning_rate,initialisation="normal",l1=0.1,l2=0.1)) File "ID_grouping.py", line 355, in irl reward = train(reshaped_to_2d) File "C:\Users\Sankalp Chauhan\AppData\Local\Programs\Python\Python37\lib\site-packages\theano\compile\function_module.py", line 903, in call self.fn() if output_subset is None else\ File "C:\Users\Sankalp Chauhan\AppData\Local\Programs\Python\Python37\lib\site-packages\theano\gof\vm.py", line 305, in call link.raise_with_op(node, thunk) File "C:\Users\Sankalp Chauhan\AppData\Local\Programs\Python\Python37\lib\site-packages\theano\gof\link.py", line 325, in raise_with_op reraise(exc_type, exc_value, exc_trace) File "C:\Users\Sankalp Chauhan\AppData\Local\Programs\Python\Python37\lib\site-packages\six.py", line 702, in reraise raise value.with_traceback(tb) File "C:\Users\Sankalp Chauhan\AppData\Local\Programs\Python\Python37\lib\site-packages\theano\gof\vm.py", line 301, in call thunk() File "C:\Users\Sankalp Chauhan\AppData\Local\Programs\Python\Python37\lib\site-packages\theano\gof\op.py", line 892, in rval r = p(n, [x[0] for x in i], o) File "C:\Users\Sankalp Chauhan\AppData\Local\Programs\Python\Python37\lib\site-packages\theano\tensor\blas.py", line 1552, in perform z[0] = np.asarray(np.dot(x, y)) ValueError: ('shapes (3,10) and (2,41) not aligned: 10 (dim 1) != 2 (dim 0)', (3, 10), (2, 41)) Apply node that caused the error: Dot22(W, x.T) Toposort index: 28 Inputs types: [TensorType(float64, matrix), TensorType(float64, matrix)] Inputs shapes: [(3, 10), (2, 41)] Inputs strides: [(80, 8), (8, 16)] Inputs values: ['not shown', 'not shown'] Outputs clients: [[Elemwise{Composite{scalar_sigmoid((i0 + i1))}}[(0, 1)](Rebroadcast{?,1}.0, Dot22.0)]]

Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer): File "ID_grouping.py", line 363, in learning_rate,initialisation="normal",l1=0.1,l2=0.1)) File "ID_grouping.py", line 307, in irl φ = T.nnet.sigmoid(th.compile.ops.Rebroadcast((0, False), (1, True))(b) + W.dot(φs[-1]))

HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.