Config

EasyLightning is designed with modularity and customizability in mind. All experiment settings—ranging from datasets and data loaders to models and training routines—are defined through human-readable YAML configuration files.

These configuration files make it easy to:

  • Reproduce experiments

  • Swap models or datasets

  • Customize the data pipeline

  • Tune hyperparameters

  • Define evaluation metrics and logging preferences

Each section of the YAML file corresponds to a major component of the pipeline, including:

  • Dataset parameters – Define how data is loaded, filtered, and preprocessed.

  • Loader parameters – Control batching and data pipeline settings.

  • Training parameters – Specify hardware configuration, training duration, logging, and checkpointing.

  • Model parameters – Configure model architecture, hyperparameters, and specific components.

  • Global and routing parameters – Enable advanced data handling and specify how data flows through the system.

This structured configuration ensures consistency, reusability, and clarity across projects, making it easy to scale or adapt experiments to new scenarios with minimal effort.

Note: Both Easy Torch and Easy Rec support seamless integration with PyTorch and PyTorch Lightning. Models, checkpoints, loss functions, and metrics can be directly referenced from these frameworks using string-based import paths in the YAML configuration (e.g., CrossEntropyLoss). This design provides full flexibility and extensibility while maintaining the simplicity of EasyLightning’s unified configuration system.

Easy Rec

Easy Torch

Common Features

  1. Optimizer

    You can specify any optimizer available in PyTorch by providing its import path as a string in the configuration file.

    Example:

    optimizer:
        name: Adam
        params:
            lr: 0.001
    
  2. Scheduler

    Similar to optimizers, you can define any learning rate scheduler from PyTorch by specifying its import path. You can also use warmup schedulers by adding a warmup_params section.

    Example:

    scheduler:
         name: StepLR
         params:
            step_size: 10
            gamma: 0.1
         warmup_params: [optional]
            type: linear
            epochs: 5
    

Special Characters

YAML configuration files in EasyLightning use special characters to control behavior in experiment definitions. Proper quoting and formatting are essential to avoid parsing errors.

Below are some special characters and their usage:

  1. £ (Sweep Operator)

    The £ prefix is used to define a hyperparameter sweep over a range of values.

    Example:
    £learning_rate:
    • default: 0.001

    • values: [0.001, 0.01, 0.1]

    In your quick_start.py script, you can iterate over the sweep like this:

    for _ in cfg.sweep(cfg[“model”][“learning_rate”]):

    This enables automatic experimentation over multiple values. See quick_start.py for more details.

  2. / (Exclude from Config and Experiment ID)

    The / prefix marks a parameter as excluded from being saved in the final config file and from affecting the exp_id (experiment identifier).

    Example:

    /learning_rate: 0.001

    This means the parameter will be used during execution but ignored when saving configuration files or generating experiment names.

Experiment Saving and Reproducibility

EasyLightning ensures experiment reproducibility and organization through a structured saving system.

Unique Experiment Identification

Each experiment is assigned a unique name, generated by applying a hash function to the configuration file. This guarantees that experiments with identical configurations always produce the same identifier (exp_id), avoiding duplicate runs.

Experiment Directory Structure

The base directory for saving experiments is defined in the global configuration using the exp_name field. This corresponds to a top-level folder that will contain all related experiment runs.

Within this folder, EasyLightning automatically organizes output files into the following structure:

  • out/log/ — Contains all logs and metric outputs, including training and evaluation statistics.

  • out/exp/ — Stores the full YAML configuration files used for each experiment.

  • out/models/ — Contains the saved model weights (checkpoints) generated during training.

Duplicate Experiment Check

Before launching a new run, EasyLightning checks whether an experiment with the same configuration (i.e., same exp_id) already exists in the specified exp_name folder. If an identical experiment is found, it will not be re-executed, avoiding unnecessary duplication and saving computation time.

This system makes it easy to reproduce past results, track hyperparameter changes, and maintain a clean record of all experiments.