Converters
This page is organized as follow:
Objectives
In this module of grid2op, the “converters” are defined.
A converter is a specific class of grid2op.Action.ActionSpace (ie of BaseAction Space) that allows the
agent to manipulate this action to have a different representation of it.
For example, suppose we are dealing with grid2op.Action.TopologyAndDispatchAction (only manipulating the
graph of the powergrid). This is a discrete “action space”. Often, it’s custom to deal with such action space by
enumerating all actions, and then assign to all valid actions a unique ID.
This can be done easily with the IdToAct class.
More concretely, the diagram of an agent is:
receive an observation (in a form of an object of class
grid2op.Observation.BaseObservation)implement the
grid2op.Agent.BaseAgent.act()taking as input angrid2op.Observation.BaseObservationand returning angrid2op.Action.BaseActionthis
grid2op.Action.BaseActionis then digested by the environment
Introducing some converters lead to the following:
receive an observation (
grid2op.Observation.BaseObservation)the transformer automatically (using
Converter.convert_obs()) to a transformed observationimplement the function
grid2op.Agent.AgentWithConverter.my_act()that takes as input a transformed observation and returns an encoded actionthe transformer automatically transforms back the encoded action into a proper
grid2op.Action.BaseActionthis
grid2op.Action.BaseActionis then digested by the environment
This simple mechanism allows people to focus on iii) above (typically implemented with artificial neural networks) without having to worry each time about the complex representations of actions and observations.
More details and a concrete example is given in the documentation of the class
grid2op.Agent.AgentWithConverter.
Some examples of converters are given in IdToAct and ToVect.
Detailed Documentation by class
If you still can’t find what you’re looking for, try in one of the following pages:
Still trouble finding the information ? Do not hesitate to send a github issue about the documentation at this link: Documentation issue template
Copyright © Grid2Op a Series of LF Projects, LLC For website terms of use, trademark policy and other project policies please see https://lfprojects.org.