How alejandrodopico2/cifnet works
• Configuration Module: Represented by the “cfgs” directory that contains all YAML configuration files for different datasets (e.g., CIFAR10_random.yaml, MNIST_random.yaml). This module provides hyperparameters, dataset paths, and training options.
• Model Architecture Module: The “models” directory contains the core network implementations (e.g., CIFNet.py) and supportive modules such as “ROLANN.py”, “backbone.py”, as well as samplers (in models/samplers, e.g., MemoryExpansionBuffer.py and SamplingStrategy.py). This module is the heart of how incremental learning is achieved.
• Utility & Visualization Module: The “utils” directory features helper functions for loading data (load_cifar.py), model utilities (model_utils.py), plotting, and visualizing results, which are vital for debugging and analyzing training performance.
• Execution & Training Pipeline: The main execution scripts are “main.py” and “train_cifnet.py”. These scripts act as entry points that integrate configurations, data loaders, models, and utilities to perform training and experimentation.
Relationships/Interactions
• Startup Phase:
• The system begins in the top-level execution scripts (main.py/train_cifnet.py) that read a configuration file from the “cfgs” folder.
• Data Flow:
• The execution scripts invoke the “Data Loading & Preprocessing Module” to load and prepare data according to the specified configuration.
• Model Training:
• The trained model components are constructed from the “Model Architecture Module”. Data streams into the model from the loaders.
• Additionally, the samplers (e.g., MemoryExpansionBuffer) within the models interact to manage the compressed buffer mechanism that minimizes memory usage.
• Evaluation & Visualization:
• After training, utilities under the “Utility Module” (such as plotting and result visualization) process and produce training curves and performance metrics.
• External Dependencies:
• Use of external libraries such as PyTorch (with torchvision for dataset downloads), Python 3.9, and other dependencies from requirements.txt.
• Separate labeled external modules representing “PyTorch/torchvision” interacting with data loaders and model training.
Incorporate Architectural Patterns & Design Principles
• Layered design: configuration leads to data ingestion, then model training, and finally visualization and evaluation.
• Single-step training innovation and the compressed buffer mechanism in the “Model Architecture Module” to mitigate catastrophic forgetting—these should be annotated near relevant modules like “models/CIFNet.py” and samplers.
• Stress modularity: each directory (configuration, data loading, models, utilities) is an independent module, clearly isolated by its functionality.
Putting It All Together
▸ Configuration (cfgs) – provides parameters.
▸ Data Loader (incremental_dataloaders) – fetches and prepares data.
▸ Model (models folder) – houses CIFNet, backbone, and samplers.
▸ Utility (utils) – for model evaluation and results visualization.
• Wherever applicable, annotate that the design supports real-time training on resource-constrained devices, emphasizing the design goals of efficiency and low-energy consumption.