gflownet.losses.forwardlooking

Forward Looking loss or objective for training GFlowNets.

The Forward Looking (FL) loss or objective was defined by Pan et al. (2023):

Classes

ForwardLooking

Initialization method for the Forward Looking loss class.

Module Contents

class gflownet.losses.forwardlooking.ForwardLooking(**kwargs)[source]

Bases: gflownet.losses.detailedbalance.DetailedBalance

Initialization method for the Forward Looking loss class.

name[source]

The name of the loss or objective function: Forward Looking

Type:

str

acronym[source]

The acronym of the loss or objective function: FL

Type:

str

id[source]

The identifier of the loss or objective function: forwardlooking

Type:

str

name = 'Forward Looking'[source]
acronym = 'FL'[source]
id = 'forwardlooking'[source]
compute_losses_of_batch(batch)[source]

Computes the Forward Looking loss for each state of the input batch.

The Forward Looking (FL) loss or objective is computed in this method as is defined in Equation 11 of Pan et al. (2023).

Parameters:

batch (Batch) – A batch of states.

Returns:

losses (tensor) – The loss of each state in the batch.

Return type:

torchtyping.TensorType[batch_size]