From 42b933a952d7a7cd236123dbd82e152852122e0b Mon Sep 17 00:00:00 2001 From: BDonnot Date: Mon, 21 Jun 2021 13:09:04 +0200 Subject: [PATCH] adding some extra docs --- CHANGELOG.rst | 2 ++ grid2op/utils/icaps_2021_scores.py | 27 ++++++++++++++++++++++++++- grid2op/utils/l2rpn_2020_scores.py | 6 ++++-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 197519acf..3087e1fdf 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -55,6 +55,8 @@ Change Log in the observation - [ADDED] some handy argument in the `action_space.get_all_unitary_redispatch` and `action_space.get_all_unitary_curtail` (see doc) +- [ADDED] as utils function to compute the score used for the ICAPS 2021 competition (see + `from grid2op.utils import ScoreICAPS2021` and the associate documentation for more information) - [IMPROVED] prevent the use of the same instance of a backend in different environments - [IMPROVED] `Issue#217 `_ : no more errors when trying to load a grid with unsupported elements (eg. 3w trafos or static generators) by PandaPowerBackend diff --git a/grid2op/utils/icaps_2021_scores.py b/grid2op/utils/icaps_2021_scores.py index 8571d5aeb..dd5abb7da 100644 --- a/grid2op/utils/icaps_2021_scores.py +++ b/grid2op/utils/icaps_2021_scores.py @@ -28,6 +28,9 @@ class ScoreICAPS2021(ScoreL2RPN2020): When using it a second time these information are reused. + + This scores is the combination of the `ScoreL2RPN2020` score and some extra scores based on the alarm feature. + Examples --------- This class can be used as follow: @@ -52,7 +55,26 @@ class ScoreICAPS2021(ScoreL2RPN2020): Notes ------- - TODO + To prevent overfitting, we strongly recommend you to use the :func:`grid2op.Environment.Environment.train_val_split` + and use this function on the built validation set only. + + Also note than computing the statistics, and evaluating an agent on a whole dataset of multiple GB can take a + really long time and a lot of memory. This fact, again, plea in favor of using this function only on + a validation set. + + We also strongly recommend to set the seeds of your agent (agent_seeds) + and of the environment (env_seeds) if you want to use this feature. Reproducibility is really important if you + want to make progress. + + .. warning:: + + The triggering (or not) of the recomputation of the statistics is not perfect for now. + We recommend you to use always + the same seeds (`env_seeds` and `agent_seeds` key word argument of this functions) + and the same parameters (`env.parameters`) when using a given environments. + + You might need to clean it manually if you change + one of theses things by calling :func:`ScoreL2RPN2020.clear_all()` function . """ @@ -100,6 +122,9 @@ def _compute_episode_score(self, """ Performs the rescaling of the score given the information stored in the "statistics" of this environment. + + This computes the score for a single episode. The loop to compute the score for all the + episodes is the same as for l2rpn_2020_scores and is then reused. """ # compute the operational score diff --git a/grid2op/utils/l2rpn_2020_scores.py b/grid2op/utils/l2rpn_2020_scores.py index 702772225..c996273a9 100644 --- a/grid2op/utils/l2rpn_2020_scores.py +++ b/grid2op/utils/l2rpn_2020_scores.py @@ -68,9 +68,11 @@ class ScoreL2RPN2020(object): The triggering (or not) of the recomputation of the statistics is not perfect for now. We recommend you to use always - the same seeds and the same parameters when using a given environments. + the same seeds (`env_seeds` and `agent_seeds` key word argument of this functions) + and the same parameters (`env.parameters`) when using a given environments. + You might need to clean it manually if you change - one of theses things by calling :func:`ScoreL2RPN2020.clear_all` . + one of theses things by calling :func:`ScoreL2RPN2020.clear_all()` function . """