gfn.gym.box_cartesian ===================== .. py:module:: gfn.gym.box_cartesian Classes ------- .. autoapisummary:: gfn.gym.box_cartesian.BoxCartesian Module Contents --------------- .. py:class:: BoxCartesian Bases: :py:obj:`gfn.gym.box.BoxPolar` Box environment with Cartesian per-dimension action validation. Inherits all behavior from :class:`BoxPolar` (init, step, backward_step, reward, log_partition, norm, make_random_states). Overrides only :meth:`is_action_valid` to use per-dimension bounds instead of polar norm constraints. Use with the Cartesian estimators/distributions in ``box_cartesian_utils.py``. .. seealso:: :class:`BoxPolar` for the original polar norm-based variant. .. py:method:: is_action_valid(states, actions, backward = False) Checks if the actions are valid (Cartesian per-dimension semantics). For Cartesian actions: - Forward from s0: action[i] >= 0 and action[i] <= 1 - Forward from non-s0: action[i] >= delta and state[i] + action[i] <= 1 - Backward: state[i] - action[i] >= 0 - Backward to s0: if all resulting dims < delta, action must equal state :param states: The current states. :param actions: The actions to be taken. :param backward: Whether the actions are backward actions. :returns: True if the actions are valid, False otherwise.