How tsun/lada works
Project type and purpose
• This is a PyTorch‐based research codebase implementing “Local Context‐Aware Active Domain Adaptation (LADA).”
• It’s neither a web app nor a microservice mesh but a machine‐learning training pipeline that:
• Reads configurations and datasets
• Runs active‐learning samplers to select target samples
• Adapts a neural network via one of several domain‐adaptation solvers
• Logs metrics and checkpoints
• “main.py” (or run.sh) reads YAML → populates Config Manager →
• Config → instantiate Dataset class → DataLoader → feeds minibatches to Solver
• Solver calls Model → computes features → passes to loss & GRL layers → backprop
• After each iteration/epoch, Solver calls Active Sampler → queries new labels from target pool → updates labeled set
• Utilities (logger, lr_schedule) are invoked by Solver throughout
• Checkpoints & logs are written to disk (→ log/…)
Architectural patterns & principles
• Modular layering: clear separation between config, data, model, solver, sampler, utils
• Strategy pattern for both samplers and solvers: plug‐and‐play criteria and adaptation methods
• Single‐entry point: main.py orchestrates the pipeline based on configuration
• Reuse of PyTorch abstractions (Dataset, DataLoader, nn.Module, Optimizer, Scheduler)