File size: 2,646 Bytes
61295de
 
 
 
997ba0f
b00c47d
997ba0f
 
 
 
b00c47d
997ba0f
b00c47d
997ba0f
 
 
 
 
 
 
 
b00c47d
997ba0f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b00c47d
 
 
997ba0f
 
 
b00c47d
997ba0f
 
 
 
 
b00c47d
 
997ba0f
 
 
 
 
 
 
61295de
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
tags:
- ml-intern
---
# FinJEPA: Financial Joint-Embedding Predictive Architecture

FinJEPA is a JEPA-based world model for portfolio optimization over a **separated action space** consisting of:
- **Portfolio weights** (continuous, simplex-constrained)
- **Trading signals** (discrete: long/short/flat per asset)
- **Hedging signal** (binary: on/off)

## Architecture (SOTA Blend)

| Component | Source | Key Innovation |
|-----------|--------|----------------|
| Time Series Encoder | TS-JEPA (Sennadir 2025) | 1D-CNN patch tokenizer + Transformer |
| Action Conditioning | JEPA-WMs (Terver 2025) | AdaLN + RoPE in predictor |
| Collapse Prevention | EB-JEPA (Terver 2026) | SIGReg + Inverse Dynamics Model |
| Multi-step Rollout | EB-JEPA | K-step autoregressive training |
| Planner | JEPA-WMs + EB-JEPA | CEM L2 cost / MPPI cumulative cost in latent space |
| TD Branch | TD-JEPA (Bagatella 2025) | Optional separate task encoder for zero-shot RL |

## Model

```
Financial Time Series (T, F)
    β”‚
    β–Ό
[TimeSeriesTokenizer] ── 1D-CNN patches + position encoding
    β”‚
    β”œβ”€β”€β”€β–Ί [Context Encoder] (student)
    β”‚          β”‚
    β”‚          β–Ό
    β”‚     [Predictor] ◄─── Action embedding (weights + signals)
    β”‚     (AdaLN + RoPE)       β”‚
    β”‚          β”‚               β”‚
    β”‚          β–Ό               β–Ό
    β”‚     Predicted target  [ActionEmbedder]
    β”‚     embeddings           β”œβ”€β”€ weights (continuous)
    β”‚                            β”œβ”€β”€ signals (discrete)
    β”‚                            └── hedge (binary)
    β”‚
    └───► [Target Encoder] (teacher, EMA frozen)
              β”‚
              β–Ό
         Ground truth target embeddings
```

## Usage

```bash
python finjepa/run_training_fast.py
```

Full training on real data:
```bash
python finjepa/train.py --data_source hf \
  --dataset_name paperswithbacktest/Stocks-Daily-Price \
  --n_assets 5 --batch_size 128 --epochs 50 --push_to_hub
```

## References

1. TS-JEPA β€” Sennadir et al. (2025). arxiv:2509.25449
2. JEPA-WMs β€” Terver et al. (2025). arxiv:2512.24497
3. EB-JEPA β€” Terver et al. (2026). arxiv:2602.03604
4. V-JEPA 2 β€” Assran et al. (2025). arxiv:2506.09985
5. TD-JEPA β€” Bagatella et al. (2025). arxiv:2510.00739

<!-- ml-intern-provenance -->
## Generated by ML Intern

This model repository was generated by [ML Intern](https://github.com/huggingface/ml-intern), an agent for machine learning research and development on the Hugging Face Hub.

- Try ML Intern: https://smolagents-ml-intern.hf.space
- Source code: https://github.com/huggingface/ml-intern