# winfredge/eventtsf architecture

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

- Interactive diagram: https://gitdiagram.com/winfredge/eventtsf
- Repository: https://github.com/winfredge/eventtsf

## Overview

EventTSF is a research framework for probabilistic, event-aware forecasting of non-stationary time series. The user selects a dataset and experiment configuration, then `main.py` starts training and testing through the sequence experiment, which sets up the data module and forecasting algorithm. The algorithm generates autoregressive predictions using a flow-matching model and a DiT-family network, and validation/test results are evaluated and visualized. The README also describes event-synchronized multimodal representations and event-aware timestep scheduling. Those capabilities are documented, but their exact internal components and wiring are not fully established by the sampled source.

Main entry points: [`experiments/sequence_prediction_experiment.py`](https://github.com/winfredge/eventtsf/blob/main/experiments/sequence_prediction_experiment.py) (Sequence experiment), [`main.py`](https://github.com/winfredge/eventtsf/blob/main/main.py) (CLI entry), [`algorithms/non_stationary_prediction_algorithm.py`](https://github.com/winfredge/eventtsf/blob/main/algorithms/non_stationary_prediction_algorithm.py) (Forecast algorithm), [`models/flow_matching_transition.py`](https://github.com/winfredge/eventtsf/blob/main/models/flow_matching_transition.py) (Flow matching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Experiment control"]
  node_main["CLI entry<br/>[main.py]"]
  node_config["Hydra configs"]
  node_experiment["Sequence experiment"]
  node_base["Experiment base<br/>[base_experiment.py]"]
  node_progress["Progress display<br/>[progress_bar.py]"]
end

subgraph group_data["Data and events"]
  node_datamodule["Dataset module"]
  node_eventdata["Event-synchronized data"]
end

subgraph group_forecast["Forecasting model"]
  node_algorithm["Forecast algorithm"]
  node_flow["Flow matching"]
  node_dit["DiT / U-DiT<br/>[timedit.py]"]
  node_scheduler["Event-aware scheduler"]
end

subgraph group_evaluation["Evaluation and logging"]
  node_metrics["Probabilistic metrics"]
  node_crps["CRPS calculator<br/>[CRPS.py]"]
  node_plots["Forecast plots<br/>[log_plots.py]"]
  node_logger["WandB logging<br/>[logger.py]"]
end

node_user(("Experiment user"))
node_wandb["Weights &amp; Biases"]

node_user -->|"runs"| node_main
node_main -->|"loads"| node_config
node_main -->|"starts"| node_experiment
node_main -->|"finishes logging"| node_logger
node_experiment -->|"extends"| node_base
node_experiment -->|"sets up"| node_datamodule
node_experiment -->|"builds"| node_algorithm
node_experiment -->|"initializes"| node_logger
node_experiment -->|"configures"| node_progress
node_datamodule -->|"loads event data"| node_eventdata
node_algorithm -->|"creates and samples"| node_flow
node_flow -->|"selects network"| node_dit
node_flow -.->|"adapts timesteps"| node_scheduler
node_algorithm -->|"evaluates predictions"| node_metrics
node_metrics -->|"uses calculator"| node_crps
node_algorithm -->|"renders forecasts"| node_plots
node_experiment -.->|"logs runs"| node_wandb
node_logger -->|"initializes"| node_wandb

click node_main "https://github.com/winfredge/eventtsf/blob/main/main.py"
click node_config "https://github.com/winfredge/eventtsf/tree/main/configs"
click node_experiment "https://github.com/winfredge/eventtsf/blob/main/experiments/sequence_prediction_experiment.py"
click node_base "https://github.com/winfredge/eventtsf/blob/main/experiments/base_experiment.py"
click node_datamodule "https://github.com/winfredge/eventtsf/blob/main/data/textandts_custom_datamodule.py"
click node_eventdata "https://github.com/winfredge/eventtsf/blob/main/data/textandts_custom_datamodule.py"
click node_algorithm "https://github.com/winfredge/eventtsf/blob/main/algorithms/non_stationary_prediction_algorithm.py"
click node_flow "https://github.com/winfredge/eventtsf/blob/main/models/flow_matching_transition.py"
click node_dit "https://github.com/winfredge/eventtsf/blob/main/models/timedit.py"
click node_scheduler "https://github.com/winfredge/eventtsf/blob/main/models/flow_matching_transition.py"
click node_metrics "https://github.com/winfredge/eventtsf/tree/main/metrics"
click node_crps "https://github.com/winfredge/eventtsf/blob/main/metrics/CRPS.py"
click node_plots "https://github.com/winfredge/eventtsf/blob/main/myutils/log_plots.py"
click node_logger "https://github.com/winfredge/eventtsf/blob/main/myutils/logger.py"
click node_progress "https://github.com/winfredge/eventtsf/blob/main/myutils/progress_bar.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_main,node_config,node_experiment,node_base,node_progress,node_user toneBlue
class node_datamodule,node_eventdata toneAmber
class node_algorithm,node_flow,node_dit,node_scheduler toneMint
class node_metrics,node_crps,node_plots,node_logger toneRose
class node_wandb toneIndigo
```

## Components

### Experiment control

- [CLI entry](https://github.com/winfredge/eventtsf/blob/main/main.py): `main.py`
- [Hydra configs](https://github.com/winfredge/eventtsf/tree/main/configs): `configs`
- [Sequence experiment](https://github.com/winfredge/eventtsf/blob/main/experiments/sequence_prediction_experiment.py): `experiments/sequence_prediction_experiment.py`
- [Experiment base](https://github.com/winfredge/eventtsf/blob/main/experiments/base_experiment.py): `experiments/base_experiment.py`
- [Progress display](https://github.com/winfredge/eventtsf/blob/main/myutils/progress_bar.py): `myutils/progress_bar.py`

### Data and events

- [Dataset module](https://github.com/winfredge/eventtsf/blob/main/data/textandts_custom_datamodule.py): `data/textandts_custom_datamodule.py`
- [Event-synchronized data](https://github.com/winfredge/eventtsf/blob/main/data/textandts_custom_datamodule.py): `data/textandts_custom_datamodule.py`

### Forecasting model

- [Forecast algorithm](https://github.com/winfredge/eventtsf/blob/main/algorithms/non_stationary_prediction_algorithm.py): `algorithms/non_stationary_prediction_algorithm.py`
- [Flow matching](https://github.com/winfredge/eventtsf/blob/main/models/flow_matching_transition.py): `models/flow_matching_transition.py`
- [DiT / U-DiT](https://github.com/winfredge/eventtsf/blob/main/models/timedit.py): `models/timedit.py`
- [Event-aware scheduler](https://github.com/winfredge/eventtsf/blob/main/models/flow_matching_transition.py): `models/flow_matching_transition.py`

### Evaluation and logging

- [Probabilistic metrics](https://github.com/winfredge/eventtsf/tree/main/metrics): `metrics`
- [CRPS calculator](https://github.com/winfredge/eventtsf/blob/main/metrics/CRPS.py): `metrics/CRPS.py`
- [Forecast plots](https://github.com/winfredge/eventtsf/blob/main/myutils/log_plots.py): `myutils/log_plots.py`
- [WandB logging](https://github.com/winfredge/eventtsf/blob/main/myutils/logger.py): `myutils/logger.py`

### Other components

- **Experiment user**
- **Weights & Biases**

## Connections

- Experiment user → CLI entry: runs (evidence: `README.md`)
- CLI entry → Hydra configs: loads (evidence: `main.py`)
- CLI entry → Sequence experiment: starts (evidence: `main.py`)
- CLI entry → WandB logging: finishes logging (evidence: `main.py`)
- Sequence experiment → Experiment base: extends (evidence: `experiments/sequence_prediction_experiment.py`)
- Sequence experiment → Dataset module: sets up (evidence: `experiments/sequence_prediction_experiment.py`)
- Sequence experiment → Forecast algorithm: builds (evidence: `experiments/sequence_prediction_experiment.py`)
- Sequence experiment → WandB logging: initializes (evidence: `experiments/sequence_prediction_experiment.py`)
- Sequence experiment → Progress display: configures (evidence: `experiments/sequence_prediction_experiment.py`)
- Dataset module → Event-synchronized data: loads event data (evidence: `data/textandts_custom_datamodule.py`)
- Forecast algorithm → Flow matching: creates and samples (evidence: `algorithms/non_stationary_prediction_algorithm.py`)
- Flow matching → DiT / U-DiT: selects network (evidence: `models/flow_matching_transition.py`)
- Flow matching → Event-aware scheduler: adapts timesteps (evidence: `models/flow_matching_transition.py`)
- Forecast algorithm → Probabilistic metrics: evaluates predictions (evidence: `algorithms/non_stationary_prediction_algorithm.py`)
- Probabilistic metrics → CRPS calculator: uses calculator (evidence: `metrics/myCRPS.py`)
- Forecast algorithm → Forecast plots: renders forecasts (evidence: `algorithms/non_stationary_prediction_algorithm.py`)
- Sequence experiment → Weights & Biases: logs runs (evidence: `README.md`)
- WandB logging → Weights & Biases: initializes (evidence: `myutils/logger.py`)
