gflownet.envs.composite.setfix ============================== .. py:module:: gflownet.envs.composite.setfix .. autoapi-nested-parse:: Classes implementing the family of Set meta-environments, which allow to combine multiple sub-environments without any specific order. Classes ------- .. autoapisummary:: gflownet.envs.composite.setfix.SetFix Module Contents --------------- .. py:class:: SetFix(subenvs, **kwargs) Bases: :py:obj:`gflownet.envs.composite.setbase.BaseSet` :param subenvs: An iterable containing the set of the sub-environments. :type subenvs: iterable .. py:attribute:: subenvs .. py:attribute:: n_subenvs .. py:attribute:: max_elements .. py:attribute:: source .. py:attribute:: action_dim .. py:attribute:: eos .. py:attribute:: continuous .. py:method:: states2policy(states) Prepares a batch of states in environment format for the policy model. The default policy representation is the concatenation of the following elements: - One-hot encoding of the active sub-environment - Toggle flag - Done flag of each sub-environment - A concatenation of the policy-format states of the sub-environments :param states: A batch of states in environment format. :type states: list :returns: *A tensor containing all the states in the batch.* .. py:method:: states2proxy(states) Prepares a batch of states in environment format for a proxy. The default proxy format is similar to the environment format, except that the states of the sub-enviroments in the dictionary are converted into their corresponding proxy formats. :param states: A batch of states in environment format. :type states: list :returns: *A tensor containing all the states in the batch.* .. py:method:: state2readable(state = None) Converts a state into human-readable representation. It concatenates the readable representations of each sub-environment, separated by "; " and preceded by Set meta-data: active sub-environment and toggle flag. If a sub-environment is done, it is indicanted with " | done" after the state. :param state: A state in environment format. :type state: list :returns: *str* -- The state in readable format. .. py:method:: readable2state(readable) Converts a human-readable representation of a state into the standard format.