# rahulrayy/cifar-double-descent architecture

> Architecture diagram of the GitHub repository rahulrayy/cifar-double-descent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rahulrayy/cifar-double-descent
- Repository: https://github.com/rahulrayy/cifar-double-descent

## Overview

This is a research project reproducing epoch-wise double descent on CIFAR-10 with a CIFAR-adapted ResNet-18. The main workflow injects training-label noise, trains across noise levels and seeds, evaluates test performance and memorization, and analyzes aggregated curves and peak statistics. The README also documents label-smoothing and mixup interventions. Some analysis and result-generation connections are documented but their implementation details are not shown in the excerpts, so those links are identified as documented rather than inferred from source.

Main entry points: [`experiments/train.py`](https://github.com/rahulrayy/cifar-double-descent/blob/main/experiments/train.py) (Training and evaluation), [`core/metrics.py`](https://github.com/rahulrayy/cifar-double-descent/blob/main/core/metrics.py) (Peak and seed metrics), [`core/data.py`](https://github.com/rahulrayy/cifar-double-descent/blob/main/core/data.py) (Noisy dataset), [`experiments/sweep.py`](https://github.com/rahulrayy/cifar-double-descent/blob/main/experiments/sweep.py) (Seed and noise sweep)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_cifar["CIFAR-10<br/>[data.py]"]
  node_noisy_data["Noisy dataset<br/>[data.py]"]
  node_loaders["Data loaders<br/>[data.py]"]
end

subgraph group_experiments["Training experiments"]
  node_sweep["Seed and noise sweep<br/>[sweep.py]"]
  node_trainer["Training and evaluation<br/>[train.py]"]
  node_model["CIFAR ResNet-18<br/>[resnet.py]"]
  node_interventions["Smoothing and mixup<br/>[train.py]"]
end

subgraph group_analysis["Analysis"]
  node_analysis_notebook["Plotting and analysis<br/>[analysis.ipynb]"]
  node_peak_metrics["Peak and seed metrics<br/>[metrics.py]"]
end

subgraph group_artifacts["Research outputs"]
  node_run_store[("Run checkpoints and metrics<br/>[train.py]")]
  node_summary["Peak summary table<br/>[summary_table.csv]"]
  node_figures["Research figures"]
end

node_researcher(("Researcher"))

node_researcher -->|"starts sweep"| node_sweep
node_sweep -->|"launches runs"| node_trainer
node_trainer -->|"requests batches"| node_loaders
node_loaders -->|"creates datasets"| node_noisy_data
node_noisy_data -->|"downloads and wraps"| node_cifar
node_trainer -->|"constructs model"| node_model
node_trainer -->|"applies options"| node_interventions
node_trainer -->|"saves run state"| node_run_store
node_peak_metrics -->|"loads metric arrays"| node_run_store
node_researcher -->|"reviews results"| node_analysis_notebook
node_analysis_notebook -.->|"produces plots"| node_figures
node_peak_metrics -.->|"summarizes peaks"| node_summary

click node_cifar "https://github.com/rahulrayy/cifar-double-descent/blob/main/core/data.py"
click node_noisy_data "https://github.com/rahulrayy/cifar-double-descent/blob/main/core/data.py"
click node_loaders "https://github.com/rahulrayy/cifar-double-descent/blob/main/core/data.py"
click node_sweep "https://github.com/rahulrayy/cifar-double-descent/blob/main/experiments/sweep.py"
click node_trainer "https://github.com/rahulrayy/cifar-double-descent/blob/main/experiments/train.py"
click node_model "https://github.com/rahulrayy/cifar-double-descent/blob/main/models/resnet.py"
click node_interventions "https://github.com/rahulrayy/cifar-double-descent/blob/main/experiments/train.py"
click node_run_store "https://github.com/rahulrayy/cifar-double-descent/blob/main/experiments/train.py"
click node_analysis_notebook "https://github.com/rahulrayy/cifar-double-descent/blob/main/notebooks/analysis.ipynb"
click node_peak_metrics "https://github.com/rahulrayy/cifar-double-descent/blob/main/core/metrics.py"
click node_summary "https://github.com/rahulrayy/cifar-double-descent/blob/main/results/summary_table.csv"
click node_figures "https://github.com/rahulrayy/cifar-double-descent/tree/main/results/figures"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cifar,node_noisy_data,node_loaders toneBlue
class node_sweep,node_trainer,node_model,node_interventions toneAmber
class node_analysis_notebook,node_peak_metrics toneMint
class node_run_store,node_summary,node_figures toneRose
class node_researcher toneIndigo
```

## Components

### Data preparation

- [CIFAR-10](https://github.com/rahulrayy/cifar-double-descent/blob/main/core/data.py): `core/data.py`
- [Noisy dataset](https://github.com/rahulrayy/cifar-double-descent/blob/main/core/data.py): `core/data.py`
- [Data loaders](https://github.com/rahulrayy/cifar-double-descent/blob/main/core/data.py): `core/data.py`

### Training experiments

- [Seed and noise sweep](https://github.com/rahulrayy/cifar-double-descent/blob/main/experiments/sweep.py): `experiments/sweep.py`
- [Training and evaluation](https://github.com/rahulrayy/cifar-double-descent/blob/main/experiments/train.py): `experiments/train.py`
- [CIFAR ResNet-18](https://github.com/rahulrayy/cifar-double-descent/blob/main/models/resnet.py): `models/resnet.py`
- [Smoothing and mixup](https://github.com/rahulrayy/cifar-double-descent/blob/main/experiments/train.py): `experiments/train.py`

### Analysis

- [Plotting and analysis](https://github.com/rahulrayy/cifar-double-descent/blob/main/notebooks/analysis.ipynb): `notebooks/analysis.ipynb`
- [Peak and seed metrics](https://github.com/rahulrayy/cifar-double-descent/blob/main/core/metrics.py): `core/metrics.py`

### Research outputs

- [Run checkpoints and metrics](https://github.com/rahulrayy/cifar-double-descent/blob/main/experiments/train.py): `experiments/train.py`
- [Peak summary table](https://github.com/rahulrayy/cifar-double-descent/blob/main/results/summary_table.csv): `results/summary_table.csv`
- [Research figures](https://github.com/rahulrayy/cifar-double-descent/tree/main/results/figures): `results/figures`

### Other components

- **Researcher**

## Connections

- Researcher → Seed and noise sweep: starts sweep (evidence: `README.md`)
- Seed and noise sweep → Training and evaluation: launches runs (evidence: `experiments/sweep.py`)
- Training and evaluation → Data loaders: requests batches (evidence: `experiments/train.py`)
- Data loaders → Noisy dataset: creates datasets (evidence: `core/data.py`)
- Noisy dataset → CIFAR-10: downloads and wraps (evidence: `core/data.py`)
- Training and evaluation → CIFAR ResNet-18: constructs model (evidence: `experiments/train.py`)
- Training and evaluation → Smoothing and mixup: applies options (evidence: `experiments/train.py`)
- Training and evaluation → Run checkpoints and metrics: saves run state (evidence: `experiments/train.py`)
- Peak and seed metrics → Run checkpoints and metrics: loads metric arrays (evidence: `core/metrics.py`)
- Researcher → Plotting and analysis: reviews results (evidence: `README.md`)
- Plotting and analysis → Research figures: produces plots (evidence: `README.md`)
- Peak and seed metrics → Peak summary table: summarizes peaks (evidence: `README.md`)
