gfn.gym.line ============ .. py:module:: gfn.gym.line Classes ------- .. autoapisummary:: gfn.gym.line.Line Module Contents --------------- .. py:class:: Line(mus, sigmas, init_value, n_sd = 4.5, n_steps_per_trajectory = 5, device = 'cpu', debug = False) Bases: :py:obj:`gfn.env.Env` Mixture of Gaussians Line environment. .. attribute:: mus The means of the Gaussians. .. attribute:: sigmas The standard deviations of the Gaussians. .. attribute:: n_sd The number of standard deviations to consider for the bounds. .. attribute:: n_steps_per_trajectory The number of steps per trajectory. .. attribute:: mixture The mixture of Gaussians. .. attribute:: init_value The initial value of the state. .. py:method:: backward_step(states, actions) Performs a backward step in the environment. :param states: The current states. :param actions: The actions to take. :returns: The previous states. .. py:attribute:: init_value .. py:method:: is_action_valid(states, actions, backward = False) Checks if the actions are valid. :param states: The current states. :param actions: The actions to check. :param backward: Whether to check for backward actions. :returns: `True` if the actions are valid, `False` otherwise. .. py:method:: log_partition(condition=None) Returns the log partition of the reward function. .. py:method:: log_reward(final_states) Computes the log reward of the environment. :param final_states: The final states of the environment. :returns: The log reward. .. py:attribute:: mixture .. py:attribute:: mus .. py:attribute:: n_sd :value: 4.5 .. py:attribute:: n_steps_per_trajectory :value: 5 .. py:attribute:: sigmas .. py:method:: step(states, actions) Performs a step in the environment. :param states: The current states. :param actions: The actions to take. :returns: The next states.