torchliter.engine.buffers
BufferBase
Buffer base class.
BufferBase.__init__
__init__(*args, **kwargs)
BufferBase.load_state_dict
load_state_dict(state_dict)
BufferBase.reset
reset()
BufferBase.state_dict
state_dict()
BufferBase.update
update(x: Any)
SequenceContainer
Sequence container Ingests new values and extends self.value
SequenceContainer.__init__
__init__(*args, **kwargs)
SequenceContainer.load_state_dict
load_state_dict(state_dict)
SequenceContainer.reset
reset()
SequenceContainer.state_dict
state_dict()
SequenceContainer.update
update(sequence: Union[List, Tuple])
ExponentialMovingAverage
Exponential Moving Average of a series of Tensors.
update rule: EMA[x[t]] := (1 - alpha) * EMA[x[t-1]] + alpha * x[t] diff: delta[x[t]] := x[t] - EMA[x[t-1]]
ExponentialMovingAverage.__init__
__init__(alpha: float = 0.01, **kwargs: Any)
ExponentialMovingAverage.load_state_dict
load_state_dict(state_dict)
ExponentialMovingAverage.reset
reset()
ExponentialMovingAverage.state_dict
state_dict()
ExponentialMovingAverage.update
update(x)
ScalarSummaryStatistics
Store the scalars and compute statistics.
The streaming scalars are stored in a list of any length. This is supposed to use in evals where the length is eval datasets.
Available statistics: - mean - median - std - max - min
ScalarSummaryStatistics.__init__
__init__(**kwargs)
ScalarSummaryStatistics.load_state_dict
load_state_dict(state_dict)
ScalarSummaryStatistics.reset
reset()
ScalarSummaryStatistics.state_dict
state_dict()
ScalarSummaryStatistics.update
update(x: float)
ScalarSmoother
Rolling average of a stream of scalars.
The streaming scalars are stored in a deque of certain length (maxlen
). The statistics are computed within the current deque.
Available statistics: - mean - median - std - max - min
ScalarSmoother.__init__
__init__(window_size: int, **kwargs)
ScalarSmoother.load_state_dict
load_state_dict(state_dict)
ScalarSmoother.reset
reset()
ScalarSmoother.state_dict
state_dict()
ScalarSmoother.update
update(x: float)
VectorSmoother
Exponential moving average of n-dim vector:
vector = alpha * new_vector + (1 - alpha) * vector
Additional features: l_p normalization
VectorSmoother.__init__
__init__(
alpha: float,
n_dim: int,
init_value: float,
eps: float = 1e-08,
normalize: bool = True,
p: float = 1.0,
device: str = 'cpu',
dtype: torch.dtype = torch.float32,
**kwargs
)
VectorSmoother.load_state_dict
load_state_dict(state_dict)
VectorSmoother.lp_norm
lp_norm(p: float)
VectorSmoother.lp_normalized
lp_normalized(p: float)
VectorSmoother.reset
reset()
VectorSmoother.state_dict
state_dict()
VectorSmoother.update
update(x: torch.Tensor)