MolecularDiffusion.core.meter

Attributes

Classes

Meter

Meter for recording metrics and training progress.

Module Contents

class MolecularDiffusion.core.meter.Meter(log_interval=100, silent=False, logger=None)

Bases: object

Meter for recording metrics and training progress.

Parameters:
  • log_interval (int, optional) – log every n updates

  • silent (int, optional) – surpress all outputs or not

  • logger (core.LoggerBase, optional) – log handler

log(record, category='train/batch')

Log a record.

Parameters:
  • record (dict) – dict of any metric

  • category (str, optional) – log category. Available types are train/batch, train/epoch, valid/epoch and test/epoch.

log_config(config)

Log a hyperparameter config.

Parameters:

config (dict) – hyperparameter config

set_epoch(epoch_id)

Set the epoch counter for resuming from a checkpoint.

This method properly pads the internal time and epoch2batch lists to handle the case where training is resumed from an intermediate epoch.

Parameters:

epoch_id (int) – The epoch to resume from.

step()

Step an epoch for this meter.

Instead of manually invoking step(), it is suggested to use the following line

>>> for epoch in meter(num_epoch):
>>>     # do something
update(record)

Update the meter with a record.

Parameters:

record (dict) – dict of any metric

batch_id = 0
epoch2batch = [0]
epoch_id = 0
log_interval = 100
logger = None
records
silent = False
time
MolecularDiffusion.core.meter.logger