aboutsummaryrefslogtreecommitdiff
path: root/model/joint_simple_mlp_tgtcls.py
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-05-08 16:17:55 -0400
committerAlex Auvolat <alex.auvolat@ens.fr>2015-05-08 16:22:42 -0400
commitd38cee1ceaed486c1ba3bed9271008dc82fde331 (patch)
tree24d17bfccbcb50e9e43e04f8c599727040e16278 /model/joint_simple_mlp_tgtcls.py
parent20a1a01cef9d61ce9dd09995f2c811ab5aca2a9d (diff)
downloadtaxi-d38cee1ceaed486c1ba3bed9271008dc82fde331.tar.gz
taxi-d38cee1ceaed486c1ba3bed9271008dc82fde331.zip
Add scaling factor between two costs in joint model
Diffstat (limited to 'model/joint_simple_mlp_tgtcls.py')
-rw-r--r--model/joint_simple_mlp_tgtcls.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/model/joint_simple_mlp_tgtcls.py b/model/joint_simple_mlp_tgtcls.py
index 0a38e06..dd1242e 100644
--- a/model/joint_simple_mlp_tgtcls.py
+++ b/model/joint_simple_mlp_tgtcls.py
@@ -67,9 +67,13 @@ class Model(object):
dest_cost.name = 'dest_cost'
dest_hcost = error.hdist(dest_outputs, y_dest).mean()
dest_hcost.name = 'dest_hcost'
+
time_cost = error.rmsle(time_outputs.flatten(), y_time.flatten())
time_cost.name = 'time_cost'
- cost = dest_cost + time_cost
+ time_scost = config.time_cost_factor * time_cost
+ time_scost.name = 'time_scost'
+
+ cost = dest_cost + time_scost
cost.name = 'cost'
# Initialization
@@ -83,7 +87,7 @@ class Model(object):
mlp.initialize()
self.cost = cost
- self.monitor = [cost, dest_cost, dest_hcost, time_cost]
+ self.monitor = [cost, dest_cost, dest_hcost, time_cost, time_scost]
self.outputs = tensor.concatenate([dest_outputs, time_outputs[:, None]], axis=1)
self.outputs.name = 'outputs'
self.pred_vars = ['destination_longitude', 'destination_latitude', 'travel_time']