gflownet.losses.vargrad ======================= .. py:module:: gflownet.losses.vargrad .. autoapi-nested-parse:: VarGrad loss or objective for training GFlowNets. The VarGrad (VG) loss or objective was introduced by Richter and Boustati (2020) and Nüsken and Richter (2023). Then it was rediscovered for GFNs by Zhang et al. (2023). .. _a link: https://arxiv.org/abs/2010.10436 .. _a link: https://arxiv.org/abs/2005.05409 .. _a link: https://arxiv.org/abs/2302.05446 Classes ------- .. autoapisummary:: gflownet.losses.vargrad.VarGrad Module Contents --------------- .. py:class:: VarGrad(**kwargs) Bases: :py:obj:`gflownet.losses.trajectorybalance.TrajectoryBalance` Initialization method for the VarGrad loss class. .. attribute:: name The name of the loss or objective function: VarGrad :type: str .. attribute:: acronym The acronym of the loss or objective function: vg :type: str .. attribute:: id The identifier of the loss or objective function: vargrad :type: str .. py:attribute:: name :value: 'VarGrad' .. py:attribute:: acronym :value: 'VG' .. py:attribute:: id :value: 'vargrad' .. py:method:: compute_losses_of_batch(batch) Computes the VarGrad loss for each trajectory of the input batch. The VarGrad loss or objective is computed in this method as is defined in equation 8 of David W. Zhang's paper. .. _a link: https://arxiv.org/pdf/2302.05446 :param batch: A batch of trajectories. :type batch: Batch :returns: *tensor* -- The loss of each trajectory in the batch.