# rektpunk/mcqrnn architecture

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

- Interactive diagram: https://gitdiagram.com/rektpunk/mcqrnn
- Repository: https://github.com/rektpunk/mcqrnn

## Overview

MCQRNN is a small library for monotone composite quantile regression, with parallel TensorFlow and PyTorch implementations. In either example workflow, a user runs a script that generates sample data, fits a regressor for configured quantiles, predicts on test inputs, and plots the results. Each backend’s regressor owns training and prediction; its model implements the monotone network. The README documents both runnable examples. The source excerpts show the backend calls and model internals; no shared storage or external service is evident.

Main entry points: [`run_tensorflow.py`](https://github.com/rektpunk/mcqrnn/blob/main/run_tensorflow.py) (TF Example), [`run_torch.py`](https://github.com/rektpunk/mcqrnn/blob/main/run_torch.py) (Torch Example), [`mcqrnn/tensorflow.py`](https://github.com/rektpunk/mcqrnn/blob/main/mcqrnn/tensorflow.py) (TF Regressor), [`mcqrnn/torch.py`](https://github.com/rektpunk/mcqrnn/blob/main/mcqrnn/torch.py) (Torch Regressor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_examples["Examples"]
  node_tf_example["TF Example<br/>[run_tensorflow.py]"]
  node_tf_result["TF Quantile Plot<br/>[run_tensorflow.py]"]
  node_torch_example["Torch Example<br/>[run_torch.py]"]
  node_torch_result["Torch Quantile Plot<br/>[run_torch.py]"]
end

subgraph group_tf["TensorFlow"]
  node_tf_regressor["TF Regressor<br/>[tensorflow.py]"]
  node_tf_model["TF Network<br/>[tensorflow.py]"]
end

subgraph group_torch["PyTorch"]
  node_torch_regressor["Torch Regressor<br/>[torch.py]"]
  node_torch_model["Torch Network<br/>[torch.py]"]
end

node_user(("User"))

node_user -->|"runs"| node_tf_example
node_tf_example -->|"fits and predicts"| node_tf_regressor
node_tf_regressor -->|"trains and queries"| node_tf_model
node_tf_example -->|"plots predictions"| node_tf_result
node_user -->|"runs"| node_torch_example
node_torch_example -->|"fits and predicts"| node_torch_regressor
node_torch_regressor -->|"trains and queries"| node_torch_model
node_torch_example -->|"plots predictions"| node_torch_result

click node_tf_example "https://github.com/rektpunk/mcqrnn/blob/main/run_tensorflow.py"
click node_tf_regressor "https://github.com/rektpunk/mcqrnn/blob/main/mcqrnn/tensorflow.py"
click node_tf_model "https://github.com/rektpunk/mcqrnn/blob/main/mcqrnn/tensorflow.py"
click node_tf_result "https://github.com/rektpunk/mcqrnn/blob/main/run_tensorflow.py"
click node_torch_example "https://github.com/rektpunk/mcqrnn/blob/main/run_torch.py"
click node_torch_regressor "https://github.com/rektpunk/mcqrnn/blob/main/mcqrnn/torch.py"
click node_torch_model "https://github.com/rektpunk/mcqrnn/blob/main/mcqrnn/torch.py"
click node_torch_result "https://github.com/rektpunk/mcqrnn/blob/main/run_torch.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_tf_example,node_tf_result,node_torch_example,node_torch_result,node_user toneBlue
class node_tf_regressor,node_tf_model toneAmber
class node_torch_regressor,node_torch_model toneMint
```

## Components

### Examples

- [TF Example](https://github.com/rektpunk/mcqrnn/blob/main/run_tensorflow.py): `run_tensorflow.py`
- [TF Quantile Plot](https://github.com/rektpunk/mcqrnn/blob/main/run_tensorflow.py): `run_tensorflow.py`
- [Torch Example](https://github.com/rektpunk/mcqrnn/blob/main/run_torch.py): `run_torch.py`
- [Torch Quantile Plot](https://github.com/rektpunk/mcqrnn/blob/main/run_torch.py): `run_torch.py`

### TensorFlow

- [TF Regressor](https://github.com/rektpunk/mcqrnn/blob/main/mcqrnn/tensorflow.py): `mcqrnn/tensorflow.py`
- [TF Network](https://github.com/rektpunk/mcqrnn/blob/main/mcqrnn/tensorflow.py): `mcqrnn/tensorflow.py`

### PyTorch

- [Torch Regressor](https://github.com/rektpunk/mcqrnn/blob/main/mcqrnn/torch.py): `mcqrnn/torch.py`
- [Torch Network](https://github.com/rektpunk/mcqrnn/blob/main/mcqrnn/torch.py): `mcqrnn/torch.py`

### Other components

- **User**

## Connections

- User → TF Example: runs (evidence: `README.md`)
- TF Example → TF Regressor: fits and predicts (evidence: `run_tensorflow.py`)
- TF Regressor → TF Network: trains and queries (evidence: `mcqrnn/tensorflow.py`)
- TF Example → TF Quantile Plot: plots predictions (evidence: `run_tensorflow.py`)
- User → Torch Example: runs (evidence: `README.md`)
- Torch Example → Torch Regressor: fits and predicts (evidence: `run_torch.py`)
- Torch Regressor → Torch Network: trains and queries (evidence: `mcqrnn/torch.py`)
- Torch Example → Torch Quantile Plot: plots predictions (evidence: `run_torch.py`)
