ncalab.training.pool

Classes

Pool

Sample pool that retains previous predictions. Also applies damaging patterns to

Module Contents

class ncalab.training.pool.Pool(n_seed: int = 1, damage: bool = False, p_damage: float = 0.2)

Sample pool that retains previous predictions. Also applies damaging patterns to images to increase the robustness of the trained NCA.

Parameters:
  • n_seed (int, optional) – How many seed images to retain, defaults to 1

  • damage (bool, optional) – Whether to apply damaging patterns, defaults to False

  • p_damage (float, optional) – Probability at which a damaging pattern is applied, defaults to 0.2

n_seed = 1
damage = False
batch: torch.Tensor | None = None
p_damage = 0.2
update(batch: torch.Tensor)
Parameters:

batch – BCWH

sample(seed: torch.Tensor) torch.Tensor
Parameters:

seed – BCWH

Returns:

BCWH