# syh3x/activeglimpse architecture

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

- Interactive diagram: https://gitdiagram.com/syh3x/activeglimpse
- Repository: https://github.com/syh3x/activeglimpse

## Overview

ActiveGlimpse is a research product for reconstructing images from a limited sequence of observed patches. The documented workflow runs a per-dataset notebook experiment: a learned actor-critic selects glimpses, transformer scene memory accumulates them, and a decoder reconstructs the image; PSNR is used to report results. The graph preserves the documented model stages, dataset coverage, configuration, and reported metrics. Notebook internals were not sampled, so the stage links are documented relationships, not verified code calls.

Main entry points: [`MNIST.ipynb`](https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb) (Dataset notebooks), [`configs`](https://github.com/syh3x/activeglimpse/tree/main/configs) (Dataset configs), [`src/config.py`](https://github.com/syh3x/activeglimpse/blob/main/src/config.py) (Config loader), [`src/metrics.py`](https://github.com/syh3x/activeglimpse/blob/main/src/metrics.py) (PSNR metric)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experiments["Experiments"]
  node_notebooks["Dataset notebooks<br/>[MNIST.ipynb]"]
  node_dataset_configs["Dataset configs"]
  node_datasets["Image datasets<br/>[MNIST.ipynb]"]
end

subgraph group_model["Reconstruction model"]
  node_policy["Actor-critic policy<br/>[MNIST.ipynb]"]
  node_glimpses["Patch observations<br/>[MNIST.ipynb]"]
  node_memory["Transformer scene memory<br/>[MNIST.ipynb]"]
  node_decoder["Image decoder<br/>[MNIST.ipynb]"]
  node_reconstruction["Reconstructed image<br/>[MNIST.ipynb]"]
end

subgraph group_support["Experiment support"]
  node_metrics["PSNR metric<br/>[metrics.py]"]
  node_config_loader["Config loader<br/>[config.py]"]
  node_reported_metrics["Reported metrics<br/>[metrics.json]"]
end

node_researcher(("Researcher"))

node_researcher -->|"runs"| node_notebooks
node_notebooks -->|"uses settings"| node_dataset_configs
node_notebooks -->|"loads data"| node_datasets
node_datasets -.->|"provides images"| node_policy
node_policy -->|"selects patches"| node_glimpses
node_glimpses -->|"accumulates"| node_memory
node_memory -->|"informs reconstruction"| node_decoder
node_decoder -->|"produces"| node_reconstruction
node_reconstruction -.->|"evaluated by"| node_metrics
node_config_loader -->|"loads YAML"| node_dataset_configs
node_notebooks -.->|"reports results"| node_reported_metrics

click node_notebooks "https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb"
click node_dataset_configs "https://github.com/syh3x/activeglimpse/tree/main/configs"
click node_datasets "https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb"
click node_policy "https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb"
click node_glimpses "https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb"
click node_memory "https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb"
click node_decoder "https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb"
click node_reconstruction "https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb"
click node_metrics "https://github.com/syh3x/activeglimpse/blob/main/src/metrics.py"
click node_config_loader "https://github.com/syh3x/activeglimpse/blob/main/src/config.py"
click node_reported_metrics "https://github.com/syh3x/activeglimpse/blob/main/results/metrics.json"

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_notebooks,node_dataset_configs,node_datasets toneBlue
class node_policy,node_glimpses,node_memory,node_decoder,node_reconstruction toneAmber
class node_metrics,node_config_loader,node_reported_metrics toneMint
class node_researcher toneIndigo
```

## Components

### Experiments

- [Dataset notebooks](https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb): `MNIST.ipynb`
- [Dataset configs](https://github.com/syh3x/activeglimpse/tree/main/configs): `configs`
- [Image datasets](https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb): `MNIST.ipynb`

### Reconstruction model

- [Actor-critic policy](https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb): `MNIST.ipynb`
- [Patch observations](https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb): `MNIST.ipynb`
- [Transformer scene memory](https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb): `MNIST.ipynb`
- [Image decoder](https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb): `MNIST.ipynb`
- [Reconstructed image](https://github.com/syh3x/activeglimpse/blob/main/MNIST.ipynb): `MNIST.ipynb`

### Experiment support

- [PSNR metric](https://github.com/syh3x/activeglimpse/blob/main/src/metrics.py): `src/metrics.py`
- [Config loader](https://github.com/syh3x/activeglimpse/blob/main/src/config.py): `src/config.py`
- [Reported metrics](https://github.com/syh3x/activeglimpse/blob/main/results/metrics.json): `results/metrics.json`

### Other components

- **Researcher**

## Connections

- Researcher → Dataset notebooks: runs (evidence: `README.md`)
- Dataset notebooks → Dataset configs: uses settings (evidence: `README.md`)
- Dataset notebooks → Image datasets: loads data (evidence: `README.md`)
- Image datasets → Actor-critic policy: provides images
- Actor-critic policy → Patch observations: selects patches (evidence: `README.md`)
- Patch observations → Transformer scene memory: accumulates (evidence: `README.md`)
- Transformer scene memory → Image decoder: informs reconstruction (evidence: `README.md`)
- Image decoder → Reconstructed image: produces (evidence: `README.md`)
- Reconstructed image → PSNR metric: evaluated by
- Config loader → Dataset configs: loads YAML (evidence: `src/config.py`)
- Dataset notebooks → Reported metrics: reports results
