commit 6c45eb6e48775dcbbbd3177f02c1d1b0c161ba1e
parent 1137abf0511359df8f468f1d9a4828f3e0cb1b6a
Author: Étienne Simon <esimon@esimon.eu>
Date: Fri, 22 May 2015 11:24:38 -0400
Fix model/time_simple_mlp.
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/model/time_simple_mlp.py b/model/time_simple_mlp.py
@@ -11,8 +11,10 @@ class Model(FFMLP):
@application(outputs=['duration'])
def predict(self, **kwargs):
- outputs = super(Model, self).predict(**kwargs)
- return kwargs['input_time'] + self.config.exp_base ** outputs
+ outputs = super(Model, self).predict(**kwargs).flatten()
+ if hasattr(self.config, 'exp_base'):
+ outputs = self.config.exp_base ** outputs
+ return kwargs['input_time'] + outputs
@predict.property('inputs')
def predict_inputs(self):
@@ -22,7 +24,7 @@ class Model(FFMLP):
def cost(self, **kwargs):
y_hat = self.predict(**kwargs)
y = kwargs['travel_time']
- return error.rmsle(y_hat.flatten(), y.flatten())
+ return error.rmsle(y_hat, y)
@cost.property('inputs')
def cost_inputs(self):