# yahoo/ml-reproducibility-guidelines architecture

> Architecture diagram of the GitHub repository yahoo/ml-reproducibility-guidelines, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yahoo/ml-reproducibility-guidelines
- Repository: https://github.com/yahoo/ml-reproducibility-guidelines

## Overview

1. **Repository purpose**
   - This is primarily a **documentation repository for ML reproducibility**, not a production application.
   - Its core artifact is the “training recipe”: a Markdown document that explains how to reproduce a model’s data, training, evaluation, and inference.

2. **Top-level architecture**
   - The repo splits into two layers:
     - **Guidelines/documentation**: README, `recipe_resnet50_imagenet.md`, contributing and policy files.
     - **Example implementation**: `preprocess.py`, `model.py`, `train.py`, and `inference.ipynb`.

3. **Documentation subsystem**
   - `README.md` defines the recipe structure and the required sections: data, training, metrics, inference, timing, serialization, and misc.
   - `recipe_resnet50_imagenet.md` is the concrete example of those guidelines applied to a ResNet-50 on ImageNet.
   - `figures/` likely holds diagrams or illustrative assets used in the docs.

4. **Example ML pipeline subsystem**
   - The Python files represent a standard ML workflow:
     - `preprocess.py` for dataset preparation,
     - `model.py` for architecture definition,
     - `train.py` for optimization and experiment execution,
     - `inference.ipynb` for interactive prediction and usage examples.

5. **Data flow**
   - The intended flow is:
     - **Raw data** enters the preprocessing step.
     - `preprocess.py` transforms it into a training-ready dataset.
     - `train.py` consumes the processed data and instantiates the model from `model.py`.
     - The trained model is then exercised in `inference.ipynb` on new samples.

6. **Model/training boundary**
   - `model.py` is the architecture boundary: it defines the network and likely the loss-related model components.
   - `train.py` is the orchestration boundary: it controls batching, optimizer choice, learning rate schedule, metrics, and training dynamics.
   - This separation matches the repo’s documentation goal: making architecture and training procedure independently reproducible.

7. **Inference boundary**
   - `inference.ipynb` demonstrates how preprocessing and model execution combine for real inputs.
   - The notebook is explicitly recommended by the README as the preferred place to show inference examples, timing, and interactive exploration.

8. **Reproducibility emphasis**
   - The repository is centered on capturing the metadata needed to reproduce a result: dataset source, preprocessing code, commit SHA, hyperparameters, outputs, and evaluation targets.
   - The architecture is therefore as much about **process provenance** as about the model itself.

9. **Governance and collaboration layer**
   - `Contributing.md` and `Code-Of-Conduct.md` define how changes to recipes and examples should be reviewed and shared.
   - The README also suggests using GitHub pull requests as the review mechanism, making version control part of the workflow.

10. **What is not present**
   - There is no sign of a service backend, API server, deployment stack, or database.
   - No external runtime infrastructure is implied beyond standard ML tooling and Jupyter/Python for the example scripts.

11. **Best diagram framing**
   - A good architecture diagram would show:
     - a **documentation track** for the training recipe,
     - a **data preprocessing stage**,
     - a **model/training stage**,
     - an **inference notebook stage**,
     - and a **governance/versioning perimeter** around the whole repo.

Main entry points: [`recipe_resnet50_imagenet.md`](https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/recipe_resnet50_imagenet.md) (Recipe example), [`preprocess.py`](https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/preprocess.py) (Preprocess), [`train.py`](https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/train.py) (Train), [`README.md`](https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/README.md) (README)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs["Documentation"]
  node_readme["README<br/>guidelines<br/>[README.md]"]
  node_recipe["Recipe example<br/>example-doc"]
  node_figures["Figures<br/>assets"]
end

subgraph group_pipeline["ML Pipeline"]
  node_raw_data[("Raw data<br/>source-data")]
  node_preprocess["Preprocess<br/>data-prep<br/>[preprocess.py]"]
  node_processed_data[("Processed data<br/>dataset")]
  node_model["Model<br/>architecture<br/>[model.py]"]
  node_train["Train<br/>orchestration<br/>[train.py]"]
  node_trained_model[("Trained model<br/>artifact")]
  node_inference_nb["Inference notebook<br/>usage-demo<br/>[inference.ipynb]"]
end

subgraph group_governance["Governance"]
  node_contributing["Contributing<br/>policy<br/>[Contributing.md]"]
  node_conduct["Code of conduct<br/>policy<br/>[Code-Of-Conduct.md]"]
  node_versioning(("Version control<br/>process"))
end

node_readme -->|"guides"| node_recipe
node_readme -->|"references"| node_figures
node_recipe -->|"documents"| node_preprocess
node_recipe -->|"documents"| node_train
node_recipe -->|"documents"| node_inference_nb
node_raw_data -->|"inputs"| node_preprocess
node_preprocess -->|"outputs"| node_processed_data
node_processed_data -->|"feeds"| node_train
node_model -->|"used by"| node_train
node_train -->|"produces"| node_trained_model
node_trained_model -->|"runs in"| node_inference_nb
node_preprocess -->|"reused by"| node_inference_nb
node_contributing -->|"defines"| node_versioning
node_conduct -->|"supports"| node_versioning
node_versioning -.->|"governs"| node_readme

click node_readme "https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/README.md"
click node_recipe "https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/recipe_resnet50_imagenet.md"
click node_figures "https://github.com/yahoo/ml-reproducibility-guidelines/tree/master/figures"
click node_preprocess "https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/preprocess.py"
click node_model "https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/model.py"
click node_train "https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/train.py"
click node_inference_nb "https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/inference.ipynb"
click node_contributing "https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/Contributing.md"
click node_conduct "https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/Code-Of-Conduct.md"

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_readme,node_recipe,node_figures toneBlue
class node_raw_data,node_preprocess,node_processed_data,node_model,node_train,node_trained_model,node_inference_nb toneAmber
class node_contributing,node_conduct,node_versioning toneMint
```

## Components

### Documentation

Recipe guidance and the worked ResNet-50 example.

- [README](https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/README.md): guidelines · Defines the training recipe structure and required reproducibility sections. · `README.md`
- [Recipe example](https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/recipe_resnet50_imagenet.md): example-doc · Concrete ResNet-50 on ImageNet recipe following the repository guidelines. · `recipe_resnet50_imagenet.md`
- [Figures](https://github.com/yahoo/ml-reproducibility-guidelines/tree/master/figures): assets · Illustrative diagrams and visuals used by the documentation. · `figures`

### ML Pipeline

Example preprocessing, model, training, and inference flow.

- **Raw data**: source-data · Original dataset inputs to the reproducible workflow.
- [Preprocess](https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/preprocess.py): data-prep · Transforms raw data into a training-ready dataset. · `preprocess.py`
- **Processed data**: dataset · Prepared dataset consumed by training.
- [Model](https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/model.py): architecture · Defines the network boundary and model components. · `model.py`
- [Train](https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/train.py): orchestration · Runs optimization, batching, scheduling, and metric tracking. · `train.py`
- **Trained model**: artifact · Serialized model and learned parameters produced by training.
- [Inference notebook](https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/inference.ipynb): usage-demo · Interactive inference and timing examples for new inputs. · `inference.ipynb`

### Governance

Contribution and conduct rules for collaborating on recipes.

- [Contributing](https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/Contributing.md): policy · Process for proposing and reviewing recipe changes. · `Contributing.md`
- [Code of conduct](https://github.com/yahoo/ml-reproducibility-guidelines/blob/master/Code-Of-Conduct.md): policy · Community behavior and collaboration expectations. · `Code-Of-Conduct.md`
- **Version control**: process · Pull-request based review and commit-based provenance for reproducibility.

## Connections

- README → Recipe example: guides · The README defines the recipe template and the example follows it.
- README → Figures: references · Documentation may include diagrams and other illustrative assets.
- Recipe example → Preprocess: documents · The recipe records how data preparation is performed.
- Recipe example → Train: documents · The recipe records training procedure, metrics, and timing.
- Recipe example → Inference notebook: documents · The recipe records inference usage and examples.
- Raw data → Preprocess: inputs · Raw data is transformed during preprocessing.
- Preprocess → Processed data: outputs · Preprocessing produces training-ready data.
- Processed data → Train: feeds · Training consumes prepared data.
- Model → Train: used by · Training instantiates and optimizes the model definition.
- Train → Trained model: produces · Training emits a trained model artifact and related metadata.
- Trained model → Inference notebook: runs in · Inference demonstrates how the trained model is applied to new inputs.
- Preprocess → Inference notebook: reused by · Inference may reuse the same preprocessing logic for real inputs.
- Contributing → Version control: defines · Contribution guidance centers on pull-request review and repository history.
- Code of conduct → Version control: supports · Community rules shape collaborative version control workflows.
- Version control → README: governs · The repository documentation and examples are maintained through version control.
