self.calc.reset()
def update(self, update_args: MetricState) -> None:
Update the estimate for the energy gap using a batch
of observations and a batch of fantasy particles.
Args:
update_args: uses all layers of minibatch and random_samples, and model
Returns:
None
energy_data = update_args.model.joint_energy(update_args.minibatch)
energy_random = update_args.model.joint_energy(update_args.random_samples)
self.calc.update(energy_data)
self.calc.update(-energy_random)
def value(self):
Get the value of the energy gap.