Commit 2001774d authored by Manuel Günther's avatar Manuel Günther
Browse files

Fixed test (see #8)

parent fbfbfb75
...@@ -702,7 +702,7 @@ PyObject* PyBobLearnMLPMachine_Repr(PyBobLearnMLPMachineObject* self) { ...@@ -702,7 +702,7 @@ PyObject* PyBobLearnMLPMachine_Repr(PyBobLearnMLPMachineObject* self) {
BOB_TRY BOB_TRY
auto shape = make_safe(PyBobLearnMLPMachine_getShape(self, NULL)); auto shape = make_safe(PyBobLearnMLPMachine_getShape(self, NULL));
auto shape_str = make_safe(PYOBJECT_STR(shape.get())); auto shape_str = make_safe(PYOBJECT_STR(shape.get()));
PyObject* retval = 0; PyObject* retval = 0;
auto hidden = self->cxx->getHiddenActivation()->str(); auto hidden = self->cxx->getHiddenActivation()->str();
......
...@@ -52,7 +52,7 @@ class PythonRProp(Trainer): ...@@ -52,7 +52,7 @@ class PythonRProp(Trainer):
weight_updates = [i * j for (i,j) in zip(self.previous_derivatives, self.derivatives)] weight_updates = [i * j for (i,j) in zip(self.previous_derivatives, self.derivatives)]
# Iterate over each weight and bias and see what to do: # Iterate over each weight and bias and see what to do:
new_weights = machine.weights new_weights = [numpy.array(w) for w in machine.weights]
for k, up in enumerate(weight_updates): for k, up in enumerate(weight_updates):
for i in range(up.shape[0]): for i in range(up.shape[0]):
for j in range(up.shape[1]): for j in range(up.shape[1]):
...@@ -71,7 +71,7 @@ class PythonRProp(Trainer): ...@@ -71,7 +71,7 @@ class PythonRProp(Trainer):
if self.train_biases: if self.train_biases:
bias_updates = [i * j for (i,j) in zip(self.previous_bias_derivatives, self.bias_derivatives)] bias_updates = [i * j for (i,j) in zip(self.previous_bias_derivatives, self.bias_derivatives)]
new_biases = machine.biases new_biases = [numpy.array(b) for b in machine.biases]
for k, up in enumerate(bias_updates): for k, up in enumerate(bias_updates):
for i in range(up.shape[0]): for i in range(up.shape[0]):
if up[i] > 0: if up[i] > 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment