Skip to content

reporting #

Reporters for state and statistics

Modules:

  • openmm

    Reporters compatible with OpenMM simulation objects

Classes:

  • NullReporter

    A dummy reporter that does nothing with reported values.

  • Reporter

    Base class for reporter classes.

  • TensorboardReporter

    Report statistics to tensorboard compatible event files.

NullReporter #

Bases: Reporter

A dummy reporter that does nothing with reported values.

Reporter #

Bases: ABC

Base class for reporter classes.

Methods:

report_figure abstractmethod #

report_figure(
    tag: str, iteration: int | None, figure: Figure
)

Report a custom plot.

Source code in femto/md/reporting/_reporting.py
@abc.abstractmethod
def report_figure(self, tag: str, iteration: int | None, figure: "pyplot.Figure"):
    """Report a custom plot."""

report_scalar abstractmethod #

report_scalar(tag: str, iteration: int, value: float)

Report a scalar value.

Source code in femto/md/reporting/_reporting.py
@abc.abstractmethod
def report_scalar(self, tag: str, iteration: int, value: float):
    """Report a scalar value."""

report_matrix abstractmethod #

report_matrix(tag: str, iteration: int, value: ndarray)

Report a matrix of values.

Source code in femto/md/reporting/_reporting.py
@abc.abstractmethod
def report_matrix(self, tag: str, iteration: int, value: numpy.ndarray):
    """Report a matrix of values."""

flush abstractmethod #

flush()

Flush the reporter.

Source code in femto/md/reporting/_reporting.py
@abc.abstractmethod
def flush(self):
    """Flush the reporter."""

close abstractmethod #

close()

Close the reporter.

Source code in femto/md/reporting/_reporting.py
@abc.abstractmethod
def close(self):
    """Close the reporter."""

TensorboardReporter #

TensorboardReporter(log_dir: Path)

Bases: Reporter

Report statistics to tensorboard compatible event files.

Source code in femto/md/reporting/_reporting.py
def __init__(self, log_dir: pathlib.Path):
    log_dir.mkdir(parents=True, exist_ok=True)
    self._writer = tensorboardX.SummaryWriter(log_dir=str(log_dir))