Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Evaluation logger (tensorboard callback) doesn't register mean_reward and mean_power correctly #171

Closed
3 tasks done
AlejandroCN7 opened this issue Mar 3, 2022 · 0 comments · Fixed by #174
Closed
3 tasks done
Assignees
Labels
bug Something isn't working log New information that should be recordered
Milestone

Comments

@AlejandroCN7
Copy link
Member

Bug 🐛

Evaluation logger (tensorboard callback) doesn't register mean_reward and mean_power correctly. This happens in LoggerEvalCallback.

To Reproduce

Thanks to @manjavacas, who saw the problem. You have to run an experiment in DRL_battery.py with tensorboard and evaluation active, and we will have the next:

image

The information is OK due to it is a tensorboard scale visualization issue, but mean_reward and mean_power_consumption don't appear.

The code in which it exists this error (sinergym/utils/callbacks.py):

mean_reward, std_reward = np.mean(
    episodes_rewards), np.std(episodes_rewards)
mean_ep_length, std_ep_length = np.mean(
    episodes_lengths), np.std(episodes_lengths)

self.evaluation_metrics['cumulative_reward'] = np.mean(
    mean_reward)
self.evaluation_metrics['ep_length'] = mean_ep_length
self.evaluation_metrics['power_consumption'] = np.mean(
    episodes_powers)
self.evaluation_metrics['comfort_violation(%)'] = np.mean(
    episodes_comfort_violations)
self.evaluation_metrics['comfort_penalty'] = np.mean(
    episodes_comfort_penalties)
self.evaluation_metrics['power_penalty'] = np.mean(
    episodes_power_penalties)

Expected behavior

cumulative_reward and power_consumption should be mean_reward and mean_power in tensorboard evaluation graphs.

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have read the documentation (required)
  • I have provided a minimal working example to reproduce the bug (required)

📝 Please, don't forget to include more labels besides bug if it is necessary.

@AlejandroCN7 AlejandroCN7 added bug Something isn't working log New information that should be recordered labels Mar 3, 2022
@AlejandroCN7 AlejandroCN7 added this to the v1.8.0 milestone Mar 3, 2022
@AlejandroCN7 AlejandroCN7 self-assigned this Mar 3, 2022
AlejandroCN7 added a commit that referenced this issue Mar 3, 2022
AlejandroCN7 added a commit that referenced this issue Mar 10, 2022
* Changed name .vscode to .vscode_conf in order to not to affect current local workspace vscode IDE (developer user)

* Solved bug #168

* Trying to solve issue #171

* Solved #173

* Fixed bug about duplicated progress.csv logs when DRL_battery.py script is used

* Added env.close() when DRL algorithm learning process doesn't close env automatically in DRL_battery.py (Added log message when simulation is closed in simulator Backend to detect this problem in the future easily).

* DRL_battery.py: The total number of timesteps is equal to the number of episodes multiplied by their size MINUS 1 in order to avoid a last reset and add an empty episode.

* Re-structure for evaluation callback (Separation between evaluation callback and evaluation policy in Sinergym code)

* Deleted reset in EvalCallback in order to avoid empty episodes

* Migrating evaluation policy from callbacks

* Separated env environment from train environment+

* Fixed tests in order to new changes

* Added MANIFEST.in sinergym/data files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working log New information that should be recordered
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant