# michaelhush/m-loop architecture

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

- Interactive diagram: https://gitdiagram.com/michaelhush/m-loop
- Repository: https://github.com/michaelhush/m-loop

## Overview

M-LOOP automates online optimization of experiment or controller parameters. A user launches a configured run; the controller coordinates a learner and an experiment interface, returns measured costs to guide later parameter proposals, and can launch visualizations after optimization. The graph preserves the principal runtime stages and the documented visualization capability. Evidence is limited to the README, source index, and excerpts provided; unsampled subsystem details are not inferred.

Main entry points: [`mloop/interfaces.py`](https://github.com/michaelhush/m-loop/blob/master/mloop/interfaces.py) (Interface runner), [`mloop/launchers.py`](https://github.com/michaelhush/m-loop/blob/master/mloop/launchers.py) (Run launcher), [`mloop/visualizations.py`](https://github.com/michaelhush/m-loop/blob/master/mloop/visualizations.py) (Result visualizations), [`mloop/controllers.py`](https://github.com/michaelhush/m-loop/blob/master/mloop/controllers.py) (Controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Run entry"]
  node_launcher["Run launcher<br/>[launchers.py]"]
end

subgraph group_control["Optimization loop"]
  node_controller["Controller<br/>[controllers.py]"]
  node_learner["Optimization learners<br/>[learners.py]"]
end

subgraph group_experiment["Experiment interfaces"]
  node_interface["Interface runner<br/>[interfaces.py]"]
  node_fileinterface["File interface<br/>[interfaces.py]"]
  node_shellinterface["Shell interface<br/>[interfaces.py]"]
end

subgraph group_support["Models and results"]
  node_neuralnet["Neural network models<br/>[neuralnet.py]"]
  node_testtools["Test landscapes<br/>[testing.py]"]
  node_utilities["Utilities and archives<br/>[utilities.py]"]
  node_visualization["Result visualizations<br/>[visualizations.py]"]
end

node_user(("User"))
node_experiment["Experiment system"]

node_user -->|"launches"| node_launcher
node_launcher -->|"creates"| node_interface
node_launcher -->|"creates"| node_controller
node_launcher -->|"loads config"| node_utilities
node_launcher -->|"launches extras"| node_visualization
node_controller -->|"starts; exchanges proposals and costs"| node_learner
node_controller -->|"starts; exchanges parameters and costs"| node_interface
node_interface -.->|"evaluates parameters"| node_experiment
node_fileinterface -.->|"extends"| node_interface
node_shellinterface -.->|"extends"| node_interface
node_learner -->|"uses models"| node_neuralnet
node_interface -->|"uses test landscape"| node_testtools
node_visualization -->|"reads learner results"| node_learner
node_visualization -->|"reads controller archive"| node_controller
node_visualization -->|"loads archive"| node_utilities

click node_launcher "https://github.com/michaelhush/m-loop/blob/master/mloop/launchers.py"
click node_controller "https://github.com/michaelhush/m-loop/blob/master/mloop/controllers.py"
click node_learner "https://github.com/michaelhush/m-loop/blob/master/mloop/learners.py"
click node_interface "https://github.com/michaelhush/m-loop/blob/master/mloop/interfaces.py"
click node_fileinterface "https://github.com/michaelhush/m-loop/blob/master/mloop/interfaces.py"
click node_shellinterface "https://github.com/michaelhush/m-loop/blob/master/mloop/interfaces.py"
click node_neuralnet "https://github.com/michaelhush/m-loop/blob/master/mloop/neuralnet.py"
click node_testtools "https://github.com/michaelhush/m-loop/blob/master/mloop/testing.py"
click node_utilities "https://github.com/michaelhush/m-loop/blob/master/mloop/utilities.py"
click node_visualization "https://github.com/michaelhush/m-loop/blob/master/mloop/visualizations.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_launcher,node_user toneBlue
class node_controller,node_learner toneAmber
class node_interface,node_fileinterface,node_shellinterface toneMint
class node_neuralnet,node_testtools,node_utilities,node_visualization toneRose
class node_experiment toneIndigo
```

## Components

### Run entry

- [Run launcher](https://github.com/michaelhush/m-loop/blob/master/mloop/launchers.py): `mloop/launchers.py`

### Optimization loop

- [Controller](https://github.com/michaelhush/m-loop/blob/master/mloop/controllers.py): `mloop/controllers.py`
- [Optimization learners](https://github.com/michaelhush/m-loop/blob/master/mloop/learners.py): `mloop/learners.py`

### Experiment interfaces

- [Interface runner](https://github.com/michaelhush/m-loop/blob/master/mloop/interfaces.py): `mloop/interfaces.py`
- [File interface](https://github.com/michaelhush/m-loop/blob/master/mloop/interfaces.py): `mloop/interfaces.py`
- [Shell interface](https://github.com/michaelhush/m-loop/blob/master/mloop/interfaces.py): `mloop/interfaces.py`

### Models and results

- [Neural network models](https://github.com/michaelhush/m-loop/blob/master/mloop/neuralnet.py): `mloop/neuralnet.py`
- [Test landscapes](https://github.com/michaelhush/m-loop/blob/master/mloop/testing.py): `mloop/testing.py`
- [Utilities and archives](https://github.com/michaelhush/m-loop/blob/master/mloop/utilities.py): `mloop/utilities.py`
- [Result visualizations](https://github.com/michaelhush/m-loop/blob/master/mloop/visualizations.py): `mloop/visualizations.py`

### Other components

- **User**
- **Experiment system**

## Connections

- User → Run launcher: launches (evidence: `README.rst`)
- Run launcher → Interface runner: creates (evidence: `mloop/launchers.py`)
- Run launcher → Controller: creates (evidence: `mloop/launchers.py`)
- Run launcher → Utilities and archives: loads config (evidence: `mloop/launchers.py`)
- Run launcher → Result visualizations: launches extras (evidence: `mloop/launchers.py`)
- Controller → Optimization learners: starts; exchanges proposals and costs (evidence: `mloop/controllers.py`)
- Controller → Interface runner: starts; exchanges parameters and costs (evidence: `mloop/controllers.py`)
- Interface runner → Experiment system: evaluates parameters (evidence: `mloop/interfaces.py`)
- File interface → Interface runner: extends (evidence: `mloop/interfaces.py`)
- Shell interface → Interface runner: extends (evidence: `mloop/interfaces.py`)
- Optimization learners → Neural network models: uses models (evidence: `mloop/learners.py`)
- Interface runner → Test landscapes: uses test landscape (evidence: `mloop/interfaces.py`)
- Result visualizations → Optimization learners: reads learner results (evidence: `mloop/visualizations.py`)
- Result visualizations → Controller: reads controller archive (evidence: `mloop/visualizations.py`)
- Result visualizations → Utilities and archives: loads archive (evidence: `mloop/visualizations.py`)
