lightning_template.utils.loop
=============================

.. py:module:: lightning_template.utils.loop


Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/lightning_template/utils/loop/kfold/index


Classes
-------

.. autoapisummary::

   lightning_template.utils.loop.KFoldLoop


Package Contents
----------------

.. py:class:: KFoldLoop(num_folds: int, fit_loop: lightning.pytorch.loops._FitLoop = None)

   Bases: :py:obj:`lightning.pytorch.loops._Loop`


   Basic Loops interface.


   .. py:attribute:: num_folds


   .. py:attribute:: current_fold
      :value: 0



   .. py:attribute:: _export_path
      :value: None



   .. py:attribute:: fit_loop
      :value: None



   .. py:attribute:: lightning_module_state_dict
      :value: None



   .. py:property:: export_path
      :type: str



   .. py:property:: done
      :type: bool



   .. py:method:: reset() -> None

      Nothing to reset in this loop.



   .. py:method:: on_run_start(*args: Any, **kwargs: Any) -> None

      Used to call `setup_folds` from the `BaseKFoldDataModule` instance and store
      the original weights of the model.



   .. py:method:: on_advance_start(*args: Any, **kwargs: Any) -> None

      Used to call `setup_fold_index` from the `BaseKFoldDataModule` instance.



   .. py:method:: advance(*args: Any, **kwargs: Any) -> None

      Used to the run a fitting and testing on the current hold.



   .. py:method:: on_advance_end() -> None

      Used to save the weights of the current fold and reset the LightningModule
      and its optimizers.



   .. py:method:: on_save_checkpoint() -> Dict[str, int]

      Called when saving a model checkpoint, use to persist loop state.

      :returns: The current loop state.



   .. py:method:: on_load_checkpoint(state_dict: Dict) -> None

      Called when loading a model checkpoint, use to reload loop state.



   .. py:method:: _reset_fitting() -> None


   .. py:method:: __getattr__(key) -> Any


