This repository has been archived by the owner on Sep 1, 2024. It is now read-only.
[Bug] ModelTrainer.maybe_get_best_weights() does not deal properly with negative evaluation scores #102
Labels
bug
Something isn't working
mbrl-lib/mbrl/models/model_trainer.py
Line 220 in 621832f
The above calculation of the relative improvement of the evaluation score in ModelTrainer seems to be wrong for negative evaluation scores. This can be fixed by adding a
torch.abs()
around the divisor.Steps to reproduce
Observed Results
model_trainer.maybe_get_best_weights()
returnsNone
, which should indicate that the evaluation value did not improve fromprevious_eval_value
tocurrent_eval_value
.Expected Results
The relative improvement from
previous_eval_value
tocurrent_eval_value
is 900%. Thus,model_trainer.maybe_get_best_weights()
should return the parameters of the model, which would indicate that the evaluation value improved.The text was updated successfully, but these errors were encountered: