ncalab.autostepper ================== .. py:module:: ncalab.autostepper Classes ------- .. autoapisummary:: ncalab.autostepper.AutoStepper Module Contents --------------- .. py:class:: AutoStepper(min_steps: int = 10, max_steps: int = 100, plateau: int = 5, verbose: bool = False, threshold: float = 0.01) Helps selecting number of timesteps based on NCA activity. :param min_steps: Minimum number of timesteps to always execute, defaults to 10. :type min_steps: int, optional :param max_steps: Terminate after maximum number of steps, defaults to 100. :type max_steps: int, optional :param plateau: Number of steps that is considered a plateau, defaults to 5. :type plateau: int :param verbose: Whether to log interruption to stdout, defaults to False. :type verbose: bool :param threshold: Score threshold, defaults to 1e-2. :type threshold: float .. py:attribute:: min_steps :value: 10 .. py:attribute:: max_steps :value: 100 .. py:attribute:: plateau :value: 5 .. py:attribute:: verbose :value: False .. py:attribute:: threshold :value: 0.01 .. py:attribute:: cooldown :value: 0 .. py:attribute:: hidden_i :type: torch.Tensor | None :value: None .. py:attribute:: hidden_i_1 :type: torch.Tensor | None :value: None .. py:method:: _score() -> torch.Tensor Calculates activity score. Method check() uses this score to determine if the NCA is inactive. :return: Activity score estimate. :rtype: torch.Tensor .. py:method:: _check(step: int) -> bool Checks whether to interrupt inference after the current step. :param step: Current NCA inference step. :type step: int :return: Whether to interrupt inference after the current step. :rtype: bool .. py:method:: run(nca: ncalab.models.BasicNCAModel, x) .. py:method:: __call__(*args: Any, **kwargs: Any) -> Any