This repository holds the experimental code for a Master's thesis project at Chalmers University of Technology with Scaleout Systems and AI Sweden. The goal of this project is to explore MoE and other models and see if they can be used for online continual learning.
Experiments are driven by the DIL_Experiment.ipynb notebook which
reads a JSON configuration file describing dataset, partitioning,
model architecture, optimization details and miscellaneous hyperparameters.
Sample configurations can be found under configs/example_config.json.
Files use a JSONC style: lines starting with // (and /* … */ blocks) are
ignored by the loader, making it convenient to comment out options and
provide example blocks. The reader function experiment_fcns.load_config
strips comments, prints a summary of key settings (including individual
seeds for dataset, model and training), ensures the dataset is available,
partitions data according to the chosen method (Dirichlet, static, etc.),
and returns instantiated objects such as the model, optimizer, loss,
dataloaders, replay buffer, and device.
Key fields in the config file include:
dataset,dataset_root,mini_dataset– dataset selection.num_partitionsandpartitionblock – specify how to split training data.train_frac,batch_size,shuffle– loader parameters.pretrain– optional balanced pretraining set-up.model– name (e.g.convnext_tiny,vit_moe) and model-specific settings.optimizer,scheduler,loss– training settings.epochs_per_domain– number of epochs to run on each partition/domain.replay,router_balancing,router_freeze_after_batches– continual learning options.
- Edit or duplicate a configuration JSON in
configs/. - Open
DIL_Experiment.ipynband updatecfg_filevariable to point to your config. - Execute the notebook. The results (metrics, confusion matrices) are
saved under
logs/(or the directory specified in the config). - Use
DIL_Metrics.plot_resultsormetrics_fcns.plot_expert_loadsto visualize outcomes.
dataset_fcns– dataset construction, partitioning, loader creation and helper plotting functions.models_fcns– model factory for standard vision backbones and MoE ViT.metrics_fcns– parameter counting and expert-load visualizations.experiment_fcns– configuration reader and experiment setup logic.data_analysis_fcns– existing DIL logging and metrics utilities used by the notebook.
Apache v2.0 License, please see LICENSE