/Users/kirill/anaconda/lib/python3.5/site-packages/numpy/lib/shape_base.py:873: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
return c.reshape(shape_out)
/Users/kirill/documents/projects/DeepLearningToy/src/pydeeptoy/nodes.py:342: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
x_col = x_padded[idx].reshape(n, output_height * output_width, -1)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-65-e4f4570cfac5> in <module>()
26 batch_x = train_x[batch:batch + batch_size]
27 batch_y = train_y[:, batch:batch + batch_size]
---> 28 sgd.minimize(ctx, cg, {x_in: batch_x, y_train: batch_y})
29 bar.update(item_id = "loss = {0:.5f}".format(ctx[loss].value))
30
/Users/kirill/documents/projects/DeepLearningToy/src/pydeeptoy/optimizers.py in minimize(self, ctx, cg, params)
19
20 def minimize(self, ctx: SimulationContext, cg: ComputationalGraph, params={}):
---> 21 ctx.forward_backward(cg, params)
22 for v in cg.input_variables:
23 if v not in self._vs:
/Users/kirill/documents/projects/DeepLearningToy/src/pydeeptoy/simulation.py in forward_backward(self, cg, params, reset_gradient, out)
67 def forward_backward(self, cg: ComputationalGraph, params=dict(), reset_gradient=True, out=list()):
68 self.forward(cg, params, out=out)
---> 69 self.backward(cg, reset_gradient=reset_gradient, out=out)
70
71
/Users/kirill/documents/projects/DeepLearningToy/src/pydeeptoy/simulation.py in backward(self, cg, reset_gradient, out)
63 for i in cg.outputs:
64 self.get_data(i).reset_gradient(to_value=1)
---> 65 [node.backward(self) for node in reversed(self.sort_topologically(cg))]
66
67 def forward_backward(self, cg: ComputationalGraph, params=dict(), reset_gradient=True, out=list()):
/Users/kirill/documents/projects/DeepLearningToy/src/pydeeptoy/simulation.py in <listcomp>(.0)
63 for i in cg.outputs:
64 self.get_data(i).reset_gradient(to_value=1)
---> 65 [node.backward(self) for node in reversed(self.sort_topologically(cg))]
66
67 def forward_backward(self, cg: ComputationalGraph, params=dict(), reset_gradient=True, out=list()):
/Users/kirill/documents/projects/DeepLearningToy/src/pydeeptoy/nodes.py in backward(self, data_bag)
236 def backward(self, data_bag):
237 data_bag[self.in1].gradient = data_bag[self.out].gradient.dot(data_bag[self.in2].value.T)
--> 238 data_bag[self.in2].gradient = data_bag[self.in1].value.T.dot(data_bag[self.out].gradient)
239
240
ValueError: shapes (16,169,256) and (256,169,3) not aligned: 256 (dim 2) != 169 (dim 1)