m-v-nikolov / KaribaCalibrationDemo

0 stars 0 forks source link

Bug: fix incorrect behavior where a penalty term is overwritten with a 0 in fix_terms collection, if the penalty weight is set to 0 #1

Closed m-v-nikolov closed 8 years ago

m-v-nikolov commented 8 years ago

Possible culprit is in kariba_model.py where as a premature optimization a penalty is not computed and set directly to 0 if its weight in the objective function is zero; the logic carries over the resulting 0 in the fit_terms collection that is written as a json after calibration.

Premature optimization is the root of all evil (in programming).