From 6c45eb6e48775dcbbbd3177f02c1d1b0c161ba1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Simon?= Date: Fri, 22 May 2015 11:24:38 -0400 Subject: Fix model/time_simple_mlp. --- model/time_simple_mlp.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/model/time_simple_mlp.py b/model/time_simple_mlp.py index 0ce6b29..a52590d 100644 --- 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): -- cgit v1.2.3