# dariocazzani/pytorch-ae architecture

> Architecture diagram of the GitHub repository dariocazzani/pytorch-ae, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dariocazzani/pytorch-ae
- Repository: https://github.com/dariocazzani/pytorch-ae

## Overview

This is a PyTorch autoencoder training project. The user selects AE or VAE and a dataset; the model wrapper loads data, trains and evaluates, then the entry point generates samples and latent interpolations as image/GIF results. The README also describes ACAI, but the visible tree contains no ACAI implementation, so it is represented as documented-only. Edges reflect the shown imports and calls; no unshown ACAI runtime wiring is inferred.

Main entry points: [`train.py`](https://github.com/dariocazzani/pytorch-ae/blob/master/train.py) (Training entry point), [`models/AE.py`](https://github.com/dariocazzani/pytorch-ae/blob/master/models/AE.py) (Vanilla AE), [`models/VAE.py`](https://github.com/dariocazzani/pytorch-ae/blob/master/models/VAE.py) (Variational AE), [`datasets.py`](https://github.com/dariocazzani/pytorch-ae/blob/master/datasets.py) (Dataset loaders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Training workflow"]
  node_trainer["Training entry point<br/>[train.py]"]
end

subgraph group_models["Autoencoder models"]
  node_ae["Vanilla AE<br/>[AE.py]"]
  node_vae["Variational AE<br/>[VAE.py]"]
  node_acai["ACAI &#40;documented&#41;"]
  node_architectures["Encoder and decoder<br/>[architectures.py]"]
end

subgraph group_data["Data input"]
  node_datasets["Dataset loaders<br/>[datasets.py]"]
  node_torchvision["Torchvision datasets"]
end

subgraph group_results["Generated results"]
  node_interpolation["Latent interpolation<br/>[utils.py]"]
  node_artifacts["Image and GIF output<br/>[train.py]"]
end

node_user(("User"))

node_user -->|"selects options"| node_trainer
node_trainer -->|"selects model"| node_ae
node_trainer -->|"selects model"| node_vae
node_ae -->|"loads batches"| node_datasets
node_vae -->|"loads batches"| node_datasets
node_datasets -->|"loads datasets"| node_torchvision
node_ae -->|"uses networks"| node_architectures
node_vae -->|"uses networks"| node_architectures
node_trainer -->|"requests interpolations"| node_interpolation
node_trainer -->|"saves results"| node_artifacts
node_trainer -.->|"documents capability"| node_acai

click node_trainer "https://github.com/dariocazzani/pytorch-ae/blob/master/train.py"
click node_ae "https://github.com/dariocazzani/pytorch-ae/blob/master/models/AE.py"
click node_vae "https://github.com/dariocazzani/pytorch-ae/blob/master/models/VAE.py"
click node_acai "https://github.com/dariocazzani/pytorch-ae/tree/master/models"
click node_architectures "https://github.com/dariocazzani/pytorch-ae/blob/master/architectures.py"
click node_datasets "https://github.com/dariocazzani/pytorch-ae/blob/master/datasets.py"
click node_interpolation "https://github.com/dariocazzani/pytorch-ae/blob/master/utils.py"
click node_artifacts "https://github.com/dariocazzani/pytorch-ae/blob/master/train.py"

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_trainer,node_user toneBlue
class node_ae,node_vae,node_acai,node_architectures toneAmber
class node_datasets,node_torchvision toneMint
class node_interpolation,node_artifacts toneRose
```

## Components

### Training workflow

- [Training entry point](https://github.com/dariocazzani/pytorch-ae/blob/master/train.py): `train.py`

### Autoencoder models

- [Vanilla AE](https://github.com/dariocazzani/pytorch-ae/blob/master/models/AE.py): `models/AE.py`
- [Variational AE](https://github.com/dariocazzani/pytorch-ae/blob/master/models/VAE.py): `models/VAE.py`
- [ACAI (documented)](https://github.com/dariocazzani/pytorch-ae/tree/master/models): `models`
- [Encoder and decoder](https://github.com/dariocazzani/pytorch-ae/blob/master/architectures.py): `architectures.py`

### Data input

- [Dataset loaders](https://github.com/dariocazzani/pytorch-ae/blob/master/datasets.py): `datasets.py`
- **Torchvision datasets**

### Generated results

- [Latent interpolation](https://github.com/dariocazzani/pytorch-ae/blob/master/utils.py): `utils.py`
- [Image and GIF output](https://github.com/dariocazzani/pytorch-ae/blob/master/train.py): `train.py`

### Other components

- **User**

## Connections

- User → Training entry point: selects options (evidence: `README.md`)
- Training entry point → Vanilla AE: selects model (evidence: `train.py`)
- Training entry point → Variational AE: selects model (evidence: `train.py`)
- Vanilla AE → Dataset loaders: loads batches (evidence: `models/AE.py`)
- Variational AE → Dataset loaders: loads batches (evidence: `models/VAE.py`)
- Dataset loaders → Torchvision datasets: loads datasets (evidence: `datasets.py`)
- Vanilla AE → Encoder and decoder: uses networks (evidence: `models/AE.py`)
- Variational AE → Encoder and decoder: uses networks (evidence: `models/VAE.py`)
- Training entry point → Latent interpolation: requests interpolations (evidence: `train.py`)
- Training entry point → Image and GIF output: saves results (evidence: `train.py`)
- Training entry point → ACAI (documented): documents capability (evidence: `README.md`)
