gfn.gym.helpers.bayesian_structure.priors

Classes

BasePrior

Base class for the prior over graphs p(G).

EdgePrior

Base class for the prior over graphs p(G).

ErdosRenyiPrior

Base class for the prior over graphs p(G).

FairPrior

Base class for the prior over graphs p(G).

UniformPrior

Base class for the prior over graphs p(G).

Module Contents

class gfn.gym.helpers.bayesian_structure.priors.BasePrior(num_variables=None)

Bases: 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.

Parameters:

num_variables (int (optional)) – The number of variables in the graph. If not specified, this gets populated inside the scorer class.

__call__(num_parents)
_log_prior = None
_num_variables = None
abstract property log_prior
property num_variables
class gfn.gym.helpers.bayesian_structure.priors.EdgePrior(num_variables=None, beta=1.0)

Bases: 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.

Parameters:

num_variables (int (optional)) – The number of variables in the graph. If not specified, this gets populated inside the scorer class.

beta = 1.0
property log_prior
class gfn.gym.helpers.bayesian_structure.priors.ErdosRenyiPrior(num_variables=None, num_edges_per_node=1.0)

Bases: 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.

Parameters:

num_variables (int (optional)) – The number of variables in the graph. If not specified, this gets populated inside the scorer class.

property log_prior
num_edges_per_node = 1.0
class gfn.gym.helpers.bayesian_structure.priors.FairPrior(num_variables=None)

Bases: 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.

Parameters:

num_variables (int (optional)) – The number of variables in the graph. If not specified, this gets populated inside the scorer class.

property log_prior
class gfn.gym.helpers.bayesian_structure.priors.UniformPrior(num_variables=None)

Bases: 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.

Parameters:

num_variables (int (optional)) – The number of variables in the graph. If not specified, this gets populated inside the scorer class.

property log_prior