Skip to content

feat: complete Sprint 5 training infrastructure#3

Merged
Arvindhbabu merged 1 commit into
mainfrom
develop
Jul 8, 2026
Merged

feat: complete Sprint 5 training infrastructure#3
Arvindhbabu merged 1 commit into
mainfrom
develop

Conversation

@Arvindhbabu

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 8, 2026 10:52
@Arvindhbabu
Arvindhbabu merged commit 228279d into main Jul 8, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new “main” training entrypoint and expands the training infrastructure with factories (model/optimizer/scheduler), richer checkpointing (including resume-related state), and a new ViT-based temporal model, along with updates to the default config and a set of smoke-test scripts.

Changes:

  • Add train.py as the primary training script, wiring together config, model creation, optimization, scheduling, checkpointing, and early stopping.
  • Introduce factories for model/optimizer/scheduler selection via config and add a ViT + temporal pooling model implementation.
  • Extend checkpoint saving to include optimizer/scheduler state and config/metrics artifacts; update default YAML to match new config keys.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
train.py New main training entrypoint that orchestrates the full training pipeline.
tests/test_training_pipeline.py New end-to-end smoke script for a single forward/backward step.
tests/test_optimizer_scheduler.py New smoke script to verify optimizer/scheduler factory creation.
tests/test_model_factory.py New smoke script to verify model factory instantiation.
src/training/trainer.py Adds tqdm progress bars, non-blocking transfers, scheduler stepping logic, and richer checkpoint saves.
src/training/scheduler_factory.py New scheduler factory driven by config.
src/training/optimizer_factory.py New optimizer factory driven by config.
src/training/checkpoint.py Expands checkpoints to include optimizer/scheduler/epoch/best_loss and adds config/log/file artifact helpers.
src/models/vit_temporal_pooling.py Adds a ViT backbone model with temporal pooling over frame features.
src/models/model_factory.py New model factory keyed off config["model"]["name"].
src/models/efficientnet_bilstm.py Placeholder EfficientNet+BiLSTM model stub.
src/models/base_model.py Adds a base model interface with a name property.
src/models/init.py Exposes ModelFactory at the package level.
configs/default.yaml Updates config schema (dataloader/model keys) to match new training infrastructure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread train.py
Comment on lines +17 to +20
from src.utils.config import load_config
from src.utils.logger import create_logger

from src.datasets.dataloader import create_dataloaders
Comment thread train.py
Comment on lines +243 to +247
epoch, best_loss = checkpoint_manager.load_checkpoint(
checkpoint_path=args.resume,
model=model,
optimizer=optimizer,
scheduler=scheduler,
Comment thread src/training/trainer.py
Comment on lines 97 to 100
epoch_loss = running_loss / len(self.train_loader)

epoch_acc = 100 * correct / total
epoch_acc = 100.0 * correct / total

Comment thread src/training/trainer.py
Comment on lines 149 to 152
epoch_loss = running_loss / len(self.val_loader)

epoch_acc = 100 * correct / total
epoch_acc = 100.0 * correct / total

Comment thread src/training/trainer.py
Comment on lines +173 to +177
if self.scheduler is not None:

if self.scheduler.__class__.__name__ == "ReduceLROnPlateau":

self.scheduler.step()
self.scheduler.step(val_loss)
patience=3,
)

return None No newline at end of file
Comment on lines +31 to +33
elif model_name == "efficientnet_bilstm":

return EfficientNetBiLSTM()
Comment on lines +10 to +12
from src.utils.config import load_config
from src.datasets.dataloader import create_dataloaders
from src.models.model_factory import ModelFactory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants