:orphan: .. _trainer_tutorials: Trainer Tutorials ================== This tutorial will guide you through understanding and customizing the training pipeline in **RoboOrchardLab**, using the provided `ResNet50 on ImageNet example `_ as our foundation. We'll start with the basics of running the script and gradually delve into customizing each component. Here are the key highlights: * Configuration-Driven (Pydantic + Argparse): Uses Pydantic (SettingConfig, DatasetConfig, TrainerConfig) for typed, validated, and hierarchical configurations. This is excellent for clarity, reducing errors, and IDE support. * Hugging Face Accelerator Integration: Uses Accelerator for abstracting device management (CPU/GPU/TPU), distributed training (DDP, FSDP, etc.), and mixed precision. * Modular Training Pipeline: A clear abstraction for the main training loop, encapsulating the core logic. A hook system allows injecting custom logic at various points in the training loop without modifying the pipeline core. .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /build/trainer_tutorial/images/thumb/sphx_glr_nonb-01_basic_run_thumb.png :alt: :ref:`sphx_glr_build_trainer_tutorial_nonb-01_basic_run.py` .. raw:: html
Configuration & Your First Basic Training Run
.. raw:: html
.. only:: html .. image:: /build/trainer_tutorial/images/thumb/sphx_glr_nonb-02_built_in_hooks_thumb.png :alt: :ref:`sphx_glr_build_trainer_tutorial_nonb-02_built_in_hooks.py` .. raw:: html
Leveraging Built-in Hooks for Common Training Tasks
.. raw:: html
.. only:: html .. image:: /build/trainer_tutorial/images/thumb/sphx_glr_nonb-03_custom_hook_thumb.png :alt: :ref:`sphx_glr_build_trainer_tutorial_nonb-03_custom_hook.py` .. raw:: html
(Advanced) Creating Custom Hooks for Tailored Logic
.. thumbnail-parent-div-close .. raw:: html
.. toctree:: :hidden: /build/trainer_tutorial/nonb-01_basic_run /build/trainer_tutorial/nonb-02_built_in_hooks /build/trainer_tutorial/nonb-03_custom_hook .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_