Skip to content

summary

Summary

A summary object that records training history.

Parameters:

Name Type Description Default
name Optional[str]

Name of the experiment. If None then experiment results will be ignored.

required
Source code in fastestimator\fastestimator\summary\summary.py
class Summary:
    """A summary object that records training history.

    Args:
        name: Name of the experiment. If None then experiment results will be ignored.
    """
    def __init__(self, name: Optional[str]) -> None:
        self.name = name
        self.history = defaultdict(lambda: defaultdict(dict))  # {mode: {key: {step: value}}}

    def merge(self, other: 'Summary'):
        """Merge another `Summary` into this one.

        Args:
            other: Other `summary` object to be merged.
        """
        for mode, sub in other.history.items():
            for key, val in sub.items():
                self.history[mode][key].update(val)

    def __bool__(self) -> bool:
        """Whether training history should be recorded.

        Returns:
            True iff this `Summary` has a non-None name.
        """
        return bool(self.name)

merge

Merge another Summary into this one.

Parameters:

Name Type Description Default
other Summary

Other summary object to be merged.

required
Source code in fastestimator\fastestimator\summary\summary.py
def merge(self, other: 'Summary'):
    """Merge another `Summary` into this one.

    Args:
        other: Other `summary` object to be merged.
    """
    for mode, sub in other.history.items():
        for key, val in sub.items():
            self.history[mode][key].update(val)