gflownet.policy.base ==================== .. py:module:: gflownet.policy.base Classes ------- .. autoapisummary:: gflownet.policy.base.ModelBase gflownet.policy.base.Policy Module Contents --------------- .. py:class:: ModelBase(config, env, device, float_precision, base=None) Bases: :py:obj:`abc.ABC` Helper class that provides a standard way to create an ABC using inheritance. .. py:attribute:: device .. py:attribute:: float .. py:attribute:: state_dim .. py:attribute:: fixed_output .. py:attribute:: random_output .. py:attribute:: output_dim .. py:attribute:: base :value: None .. py:method:: parse_config(config) .. py:method:: instantiate() :abstractmethod: .. py:method:: __call__(states) .. py:method:: make_mlp(activation) Defines an MLP with no top layer activation If share_weight == True, baseModel (the model with which weights are to be shared) must be provided :param layers_dim: Dimensionality of each layer :type layers_dim: list :param activation: Activation function :type activation: Activation .. py:class:: Policy(config, env, device, float_precision, base=None) Bases: :py:obj:`ModelBase` Helper class that provides a standard way to create an ABC using inheritance. .. py:method:: instantiate() .. py:method:: fixed_distribution(states) Returns the fixed distribution specified by the environment. :param states: The states for which the fixed distribution is to be returned :type states: tensor .. py:method:: random_distribution(states) Returns the random distribution specified by the environment. :param states: The states for which the random distribution is to be returned :type states: tensor .. py:method:: uniform_distribution(states) Return action logits (log probabilities) from a uniform distribution :param states: The states for which the uniform distribution is to be returned :type states: tensor