gfn.gym.helpers.bayesian_structure.priors ========================================= .. py:module:: gfn.gym.helpers.bayesian_structure.priors Classes ------- .. autoapisummary:: gfn.gym.helpers.bayesian_structure.priors.BasePrior gfn.gym.helpers.bayesian_structure.priors.EdgePrior gfn.gym.helpers.bayesian_structure.priors.ErdosRenyiPrior gfn.gym.helpers.bayesian_structure.priors.FairPrior gfn.gym.helpers.bayesian_structure.priors.UniformPrior Module Contents --------------- .. py:class:: BasePrior(num_variables=None) Bases: :py:obj:`abc.ABC` Base class for the prior over graphs p(G). Any subclass of `BasePrior` must return the contribution of log p(G) for a given variable with `num_parents` parents. We assume that the prior is modular. :param num_variables: The number of variables in the graph. If not specified, this gets populated inside the scorer class. :type num_variables: int (optional) .. py:method:: __call__(num_parents) .. py:attribute:: _log_prior :value: None .. py:attribute:: _num_variables :value: None .. py:property:: log_prior :abstractmethod: .. py:property:: num_variables .. py:class:: EdgePrior(num_variables=None, beta=1.0) Bases: :py:obj:`BasePrior` Base class for the prior over graphs p(G). Any subclass of `BasePrior` must return the contribution of log p(G) for a given variable with `num_parents` parents. We assume that the prior is modular. :param num_variables: The number of variables in the graph. If not specified, this gets populated inside the scorer class. :type num_variables: int (optional) .. py:attribute:: beta :value: 1.0 .. py:property:: log_prior .. py:class:: ErdosRenyiPrior(num_variables=None, num_edges_per_node=1.0) Bases: :py:obj:`BasePrior` Base class for the prior over graphs p(G). Any subclass of `BasePrior` must return the contribution of log p(G) for a given variable with `num_parents` parents. We assume that the prior is modular. :param num_variables: The number of variables in the graph. If not specified, this gets populated inside the scorer class. :type num_variables: int (optional) .. py:property:: log_prior .. py:attribute:: num_edges_per_node :value: 1.0 .. py:class:: FairPrior(num_variables=None) Bases: :py:obj:`BasePrior` Base class for the prior over graphs p(G). Any subclass of `BasePrior` must return the contribution of log p(G) for a given variable with `num_parents` parents. We assume that the prior is modular. :param num_variables: The number of variables in the graph. If not specified, this gets populated inside the scorer class. :type num_variables: int (optional) .. py:property:: log_prior .. py:class:: UniformPrior(num_variables=None) Bases: :py:obj:`BasePrior` Base class for the prior over graphs p(G). Any subclass of `BasePrior` must return the contribution of log p(G) for a given variable with `num_parents` parents. We assume that the prior is modular. :param num_variables: The number of variables in the graph. If not specified, this gets populated inside the scorer class. :type num_variables: int (optional) .. py:property:: log_prior