ncalab.training.pool ==================== .. py:module:: ncalab.training.pool Classes ------- .. autoapisummary:: ncalab.training.pool.Pool Module Contents --------------- .. py:class:: 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. :param n_seed: How many seed images to retain, defaults to 1 :type n_seed: int, optional :param damage: Whether to apply damaging patterns, defaults to False :type damage: bool, optional :param p_damage: Probability at which a damaging pattern is applied, defaults to 0.2 :type p_damage: float, optional .. py:attribute:: n_seed :value: 1 .. py:attribute:: damage :value: False .. py:attribute:: batch :type: torch.Tensor | None :value: None .. py:attribute:: p_damage :value: 0.2 .. py:method:: update(batch: torch.Tensor) :param batch: BCWH .. py:method:: sample(seed: torch.Tensor) -> torch.Tensor :param seed: BCWH :return: BCWH