gflownet.envs.setbox ==================== .. py:module:: gflownet.envs.setbox .. autoapi-nested-parse:: This environment is a conditional set of cubes and grids. The set is flexible in that in can consist of a variable number of cubes and grids. The number of grids and cubes for each trajectory can be regarded as the conditions of the set and in this environment these conditions are sampled by an auxiliary 2D grid environment, where each dimension will indicate the number of cubes and grids, respectively. Therefore, the overall environment is a Stack of a Grid and a Set of Cubes and Grids. This environment was originally designed for debugging the conditional mode of the Set environment. Attributes ---------- .. autoapisummary:: gflownet.envs.setbox.IDX_CUBE gflownet.envs.setbox.IDX_GRID Classes ------- .. autoapisummary:: gflownet.envs.setbox.SetBox Module Contents --------------- .. py:data:: IDX_CUBE :value: 0 .. py:data:: IDX_GRID :value: 1 .. py:class:: SetBox(max_elements_per_subenv = 3, n_dim = 2, cube_kwargs = None, grid_kwargs = None, **kwargs) Bases: :py:obj:`gflownet.envs.composite.stack.Stack` Initializes the SetBox environment. :param max_elements_per_subenv: The maximum number of elements of each kind in the Set. The total maximum number of elements in the set will thus be 2 * max_elements_per_subenv. :type max_elements_per_subenv: int :param n_dim: The dimensionality of the Cubes and Grids in the Set. :type n_dim: int .. py:attribute:: max_elements_per_subenv :value: 3 .. py:attribute:: n_dim :value: 2 .. py:attribute:: cube_kwargs .. py:attribute:: grid_kwargs .. py:attribute:: idx_conditioning_grid :value: 0 .. py:attribute:: idx_set :value: 1 .. py:property:: conditioning_grid :type: gflownet.envs.grid.Grid Returns the sub-environment corresponding to the Grid that is the first sub-environment in the Stack, which is used to sample the conditions of the Set. :returns: *Grid* .. py:property:: set :type: gflownet.envs.composite.setflex.SetFlex Returns the sub-environment corresponding to the set of cubes and grids. :returns: *SetFlex* .. py:property:: cube :type: gflownet.envs.cube.ContinuousCube Returns the ContinuousCube environment that is used as unique environment to define the Cubes in the Set. The Cube is the unique environment in the first (0) dimension of subenvs_unique in the Set. :returns: *ContinuousCube* .. py:property:: grid :type: gflownet.envs.grid.Grid Returns the Grid environment that is used as unique environment to define the Grids in the Set. The Grid is the unique environment in the second (1) dimension of subenvs_unique in the Set. :returns: *Grid* .. py:method:: states2proxy(states) Prepares a batch of states in "environment format" for a proxy. The proxy representation is the average of the proxy representation across all the cubes and grids in the set. :param states: A batch of states in environment format. :type states: list :returns: *A tensor containing all the states in the batch in the proxy representation.*