gflownet.policy.base

Classes

ModelBase

Helper class that provides a standard way to create an ABC using

Policy

Helper class that provides a standard way to create an ABC using

Module Contents

class gflownet.policy.base.ModelBase(config, env, device, float_precision, base=None)[source]

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

device[source]
float[source]
state_dim[source]
fixed_output[source]
random_output[source]
output_dim[source]
base = None[source]
parse_config(config)[source]
abstract instantiate()[source]
__call__(states)[source]
make_mlp(activation)[source]

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

Parameters:
  • layers_dim (list) – Dimensionality of each layer

  • activation (Activation) – Activation function

class gflownet.policy.base.Policy(config, env, device, float_precision, base=None)[source]

Bases: ModelBase

Helper class that provides a standard way to create an ABC using inheritance.

instantiate()[source]
fixed_distribution(states)[source]

Returns the fixed distribution specified by the environment.

Parameters:

states (tensor) – The states for which the fixed distribution is to be returned

random_distribution(states)[source]

Returns the random distribution specified by the environment.

Parameters:

states (tensor) – The states for which the random distribution is to be returned

uniform_distribution(states)[source]

Return action logits (log probabilities) from a uniform distribution

Parameters:

states (tensor) – The states for which the uniform distribution is to be returned