habitat.datasets.rearrange.samplers.scene_sampler.BalancedSceneSampler class

Evenly splits generated episodes amongst all scenes in the set. Generates all episodes for each scene contiguously for efficiency.


def num_scenes(self) -> int
Get the number of scenes available from this sampler.
def sample(self) -> str
Return the next scene in the sequence based on current episode index.
def set_cur_episode(self, cur_episode: int) -> None
Set the current episode index. Determines which scene in the sequence to sample. Must be strictly less than the configured num_episodes.

Special methods

def __init__(self, scenes: typing.List[str], num_episodes: int) -> None
Initialize the BalancedSceneSampler for a pre-determined number of episodes. This number must be accurate for correct behavior.