# kentucky-kaneki/c-jepa-test architecture

> Architecture diagram of the GitHub repository kentucky-kaneki/c-jepa-test, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kentucky-kaneki/c-jepa-test
- Repository: https://github.com/kentucky-kaneki/c-jepa-test

## Overview

T-JEPA is a tabular self-supervised representation learner, demonstrated as an Adult Income classification pipeline. The user-facing run loads and encodes data, pre-trains the model without labels, extracts context-encoder representations, trains a classifier, and reports test accuracy against a raw-feature baseline. The graph includes the documented feature embedding, masking, target encoder, EMA, and predictor stages; excerpts do not expose every constructor or call, so uncertain internal wiring is omitted.

Main entry points: [`run.py`](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/run.py) (Pipeline runner), [`model.py`](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py) (T-JEPA model), [`trainer.py`](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/trainer.py) (Pretraining loop), [`data.py`](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/data.py) (Dataset loaders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Experiment pipeline"]
  node_run["Pipeline runner<br/>[run.py]"]
  node_baseline["Raw-feature baseline<br/>[run.py]"]
  node_result["Accuracy comparison<br/>[run.py]"]
end

subgraph group_data["Tabular data"]
  node_loader["Adult loader<br/>[data.py]"]
  node_preprocess["Preprocessor<br/>[data.py]"]
  node_splits["Dataset loaders<br/>[data.py]"]
end

subgraph group_tjepa["T-JEPA model"]
  node_embed["Feature embedding<br/>[model.py]"]
  node_masking["Context-target masking<br/>[model.py]"]
  node_context["Context encoder<br/>[model.py]"]
  node_target["EMA target encoder<br/>[model.py]"]
  node_predictor["Prediction transformer<br/>[model.py]"]
  node_tjepa["T-JEPA model<br/>[model.py]"]
end

subgraph group_learning["Training and evaluation"]
  node_pretrain["Pretraining loop<br/>[trainer.py]"]
  node_extract["Representation extraction<br/>[trainer.py]"]
  node_classifier["Downstream MLP<br/>[downstream.py]"]
  node_downtrain["Classifier training<br/>[trainer.py]"]
  node_accuracy["Accuracy evaluation<br/>[trainer.py]"]
end

node_user(("Experiment user"))
node_openml["OpenML Adult"]

node_user -->|"starts"| node_run
node_run -->|"loads data"| node_loader
node_loader -->|"fetches Adult"| node_openml
node_run -->|"builds loaders"| node_preprocess
node_preprocess -->|"encodes splits"| node_splits
node_run -->|"constructs"| node_tjepa
node_run -->|"invokes"| node_pretrain
node_pretrain -->|"reads batches"| node_splits
node_pretrain -->|"optimizes"| node_tjepa
node_tjepa -->|"samples masks"| node_masking
node_tjepa -->|"embeds features"| node_embed
node_tjepa -->|"encodes context"| node_context
node_tjepa -->|"encodes targets"| node_target
node_tjepa -->|"predicts targets"| node_predictor
node_pretrain -->|"updates EMA"| node_tjepa
node_run -->|"requests embeddings"| node_extract
node_extract -->|"reads batches"| node_splits
node_extract -->|"encodes features"| node_tjepa
node_run -->|"constructs"| node_classifier
node_run -->|"trains classifier"| node_downtrain
node_downtrain -->|"optimizes"| node_classifier
node_run -->|"evaluates test"| node_accuracy
node_accuracy -->|"scores"| node_classifier
node_run -->|"trains baseline"| node_baseline
node_run -->|"reports accuracies"| node_result
node_accuracy -->|"supplies score"| node_result
node_baseline -->|"supplies score"| node_result

click node_run "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/run.py"
click node_loader "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/data.py"
click node_preprocess "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/data.py"
click node_splits "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/data.py"
click node_embed "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py"
click node_masking "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py"
click node_context "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py"
click node_target "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py"
click node_predictor "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py"
click node_tjepa "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py"
click node_pretrain "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/trainer.py"
click node_extract "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/trainer.py"
click node_classifier "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/downstream.py"
click node_downtrain "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/trainer.py"
click node_accuracy "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/trainer.py"
click node_baseline "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/run.py"
click node_result "https://github.com/kentucky-kaneki/c-jepa-test/blob/main/run.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_run,node_baseline,node_result,node_user toneBlue
class node_loader,node_preprocess,node_splits toneAmber
class node_embed,node_masking,node_context,node_target,node_predictor,node_tjepa toneMint
class node_pretrain,node_extract,node_classifier,node_downtrain,node_accuracy toneRose
class node_openml toneIndigo
```

## Components

### Experiment pipeline

- [Pipeline runner](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/run.py): `run.py`
- [Raw-feature baseline](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/run.py): `run.py`
- [Accuracy comparison](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/run.py): `run.py`

### Tabular data

- [Adult loader](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/data.py): `data.py`
- [Preprocessor](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/data.py): `data.py`
- [Dataset loaders](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/data.py): `data.py`

### T-JEPA model

- [Feature embedding](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py): `model.py`
- [Context-target masking](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py): `model.py`
- [Context encoder](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py): `model.py`
- [EMA target encoder](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py): `model.py`
- [Prediction transformer](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py): `model.py`
- [T-JEPA model](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/model.py): `model.py`

### Training and evaluation

- [Pretraining loop](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/trainer.py): `trainer.py`
- [Representation extraction](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/trainer.py): `trainer.py`
- [Downstream MLP](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/downstream.py): `downstream.py`
- [Classifier training](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/trainer.py): `trainer.py`
- [Accuracy evaluation](https://github.com/kentucky-kaneki/c-jepa-test/blob/main/trainer.py): `trainer.py`

### Other components

- **Experiment user**
- **OpenML Adult**

## Connections

- Experiment user → Pipeline runner: starts
- Pipeline runner → Adult loader: loads data
- Adult loader → OpenML Adult: fetches Adult
- Pipeline runner → Preprocessor: builds loaders
- Preprocessor → Dataset loaders: encodes splits
- Pipeline runner → T-JEPA model: constructs
- Pipeline runner → Pretraining loop: invokes
- Pretraining loop → Dataset loaders: reads batches
- Pretraining loop → T-JEPA model: optimizes
- T-JEPA model → Context-target masking: samples masks
- T-JEPA model → Feature embedding: embeds features
- T-JEPA model → Context encoder: encodes context
- T-JEPA model → EMA target encoder: encodes targets
- T-JEPA model → Prediction transformer: predicts targets
- Pretraining loop → T-JEPA model: updates EMA
- Pipeline runner → Representation extraction: requests embeddings
- Representation extraction → Dataset loaders: reads batches
- Representation extraction → T-JEPA model: encodes features
- Pipeline runner → Downstream MLP: constructs
- Pipeline runner → Classifier training: trains classifier
- Classifier training → Downstream MLP: optimizes
- Pipeline runner → Accuracy evaluation: evaluates test
- Accuracy evaluation → Downstream MLP: scores
- Pipeline runner → Raw-feature baseline: trains baseline
- Pipeline runner → Accuracy comparison: reports accuracies
- Accuracy evaluation → Accuracy comparison: supplies score
- Raw-feature baseline → Accuracy comparison: supplies score
