# leonardosabattini/amc_oven architecture

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

- Interactive diagram: https://gitdiagram.com/leonardosabattini/amc_oven
- Repository: https://github.com/leonardosabattini/amc_oven

## Overview

amc-oven iteratively searches for neural-network parameters that define a bounded temperature schedule. Running `opt_step.py` samples parameters, converts them into a protocol, and saves optimizer state; an external experiment evaluates the protocol and writes a score for the next run. The README documents this user loop. The optimizer and protocol-generation code are excerpted; the external evaluator is not part of the listed repository.

Main entry points: [`opt_step.py`](https://github.com/leonardosabattini/amc_oven/blob/main/opt_step.py) (Optimization runner), [`aMC_optimizer.py`](https://github.com/leonardosabattini/amc_oven/blob/main/aMC_optimizer.py) (Adaptive Monte Carlo), [`nets.py`](https://github.com/leonardosabattini/amc_oven/blob/main/nets.py) (Neural networks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Experiment orchestration"]
  node_runner["Optimization runner<br/>[opt_step.py]"]
  node_score["Experiment score"]
end

subgraph group_optimization["Parameter search"]
  node_optimizer["Adaptive Monte Carlo<br/>[aMC_optimizer.py]"]
  node_parameters["Sampled parameters"]
  node_state_file["Saved optimizer state"]
end

subgraph group_protocol["Protocol generation"]
  node_model["Neural networks<br/>[nets.py]"]
  node_protocol_file["Temperature protocol"]
end

node_operator(("Experiment operator"))
node_experiment["External experiment"]

node_runner -->|"calls sampling and step"| node_optimizer
node_runner -->|"instantiates"| node_model
node_optimizer -->|"writes samples"| node_parameters
node_runner -->|"loads parameters"| node_parameters
node_runner -->|"sets weights"| node_model
node_runner -->|"writes protocol"| node_protocol_file
node_operator -.->|"runs protocol"| node_experiment
node_experiment -->|"provides score"| node_score
node_optimizer -->|"reads score"| node_score
node_runner -->|"saves state"| node_state_file
node_runner -->|"restores state"| node_optimizer

click node_runner "https://github.com/leonardosabattini/amc_oven/blob/main/opt_step.py"
click node_optimizer "https://github.com/leonardosabattini/amc_oven/blob/main/aMC_optimizer.py"
click node_model "https://github.com/leonardosabattini/amc_oven/blob/main/nets.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_runner,node_score toneBlue
class node_optimizer,node_parameters,node_state_file toneAmber
class node_model,node_protocol_file toneMint
class node_operator,node_experiment toneIndigo
```

## Components

### Experiment orchestration

- [Optimization runner](https://github.com/leonardosabattini/amc_oven/blob/main/opt_step.py): `opt_step.py`
- **Experiment score**

### Parameter search

- [Adaptive Monte Carlo](https://github.com/leonardosabattini/amc_oven/blob/main/aMC_optimizer.py): `aMC_optimizer.py`
- **Sampled parameters**
- **Saved optimizer state**

### Protocol generation

- [Neural networks](https://github.com/leonardosabattini/amc_oven/blob/main/nets.py): `nets.py`
- **Temperature protocol**

### Other components

- **Experiment operator**
- **External experiment**

## Connections

- Optimization runner → Adaptive Monte Carlo: calls sampling and step (evidence: `opt_step.py`)
- Optimization runner → Neural networks: instantiates (evidence: `opt_step.py`)
- Adaptive Monte Carlo → Sampled parameters: writes samples (evidence: `aMC_optimizer.py`)
- Optimization runner → Sampled parameters: loads parameters (evidence: `opt_step.py`)
- Optimization runner → Neural networks: sets weights (evidence: `opt_step.py`)
- Optimization runner → Temperature protocol: writes protocol (evidence: `opt_step.py`)
- Experiment operator → External experiment: runs protocol (evidence: `README.md`)
- External experiment → Experiment score: provides score (evidence: `README.md`)
- Adaptive Monte Carlo → Experiment score: reads score (evidence: `aMC_optimizer.py`)
- Optimization runner → Saved optimizer state: saves state (evidence: `opt_step.py`)
- Optimization runner → Adaptive Monte Carlo: restores state (evidence: `opt_step.py`)
