unilab.base.curriculum.EpisodeLengthTracker

class unilab.base.curriculum.EpisodeLengthTracker[source]

Bases: object

Track a weighted moving average of episode lengths on one tensor.

Parameters:
  • num_envs (int)

  • window_size (int)

Methods

__init__(num_envs[, window_size, device])

update(episode_lengths)

Recursively update the average without synchronizing each batch.

update_masked(episode_lengths, mask)

Update from a fixed-width episode-length carrier and bool mask.

Attributes

average

Recursive average as a device-resident scalar tensor.

__init__(num_envs, window_size=1000, *, device=None)[source]
Parameters:
  • num_envs (int)

  • window_size (int)

update(episode_lengths)[source]

Recursively update the average without synchronizing each batch.

Parameters:

episode_lengths (Tensor)

Return type:

None

update_masked(episode_lengths, mask)[source]

Update from a fixed-width episode-length carrier and bool mask.

This boundary avoids materializing reset rows; false values are excluded with fixed-shape where operations.

Parameters:
Return type:

None

property average: Tensor

Recursive average as a device-resident scalar tensor.