Training
========

Patch samplers
--------------

Samplers are used to randomly extract patches from volumes.
They are called with a sample generated by an
:py:class:`~torchio.ImagesDataset` and return a Python generator that yields
cropped versions of the sample.

For more information about patch-based training, see
`this NiftyNet tutorial <https://niftynet.readthedocs.io/en/dev/window_sizes.html>`_.


.. currentmodule:: torchio.data


:class:`PatchSampler`
^^^^^^^^^^^^^^^^^^^^^

.. autoclass:: PatchSampler
    :show-inheritance:


:class:`WeightedSampler`
^^^^^^^^^^^^^^^^^^^^^^^^

.. autoclass:: WeightedSampler
    :show-inheritance:


:class:`UniformSampler`
^^^^^^^^^^^^^^^^^^^^^^^

.. autoclass:: UniformSampler
    :show-inheritance:


:class:`LabelSampler`
^^^^^^^^^^^^^^^^^^^^^

.. autoclass:: LabelSampler
    :show-inheritance:


Queue
-----


.. currentmodule:: torchio.data

:class:`Queue`
^^^^^^^^^^^^^^

.. autoclass:: Queue
    :members:
    :show-inheritance:
