Downloads · 30 days
0
ZiyaZhao/FinAlogy
FinAlogy is a machine learning model from ZiyaZhao. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This repository contains the pretrained visual encoder and demo data for FinAlogy, a visual analogy retrieval system for financial K-line analysis.
Downloads · 30 days
0
Access
Public
Updated Jun 2, 2026
Repo size
675 MB
Likes
2
Public
Click a slice to open those files.
.pth675 MB · 100%
From the Hugging Face model README
This repository contains the pretrained visual encoder and demo data for FinAlogy, a visual analogy retrieval system for financial K-line analysis.
| File | Description |
|---|---|
checkpoint_best.pth | Pretrained VICReg encoder checkpoint (CLIP-ViT-B/32 backbone, 675 MB) |
finalogy_demo_instances.zip | Demo K-line instances for quick inference testing |
The encoder is a CLIP-ViT-B/32 backbone fine-tuned with VICReg self-supervised learning on DOW30 historical K-line data (2010–2021). It maps candlestick chart images into a 512-dimensional morphology-aware embedding space, capturing shape-level properties (body size, shadow structure, local trend direction) while remaining invariant to absolute price scales.
Training details:
Evaluation (test set, 2,075 unique anchors):
| Method | 52D Alignment |
|---|---|
| Barlow Twins | 0.785 |
| SimSiam | 0.814 |
| VICReg (ours) | 0.910 |
52D Alignment measures cosine similarity between retrieved results and the query in the 52-dimensional morphological feature space — higher is better. VICReg achieves the best morphological alignment among all compared methods.
import torch
from huggingface_hub import hf_hub_download
# Download checkpoint
ckpt_path = hf_hub_download(
repo_id="ZiyaZhao/FinAlogy",
filename="checkpoint_best.pth"
)
# Load encoder
checkpoint = torch.load(ckpt_path, map_location="cpu")
# See https://github.com/nice-zzy/FinAlogy for full inference pipeline
For the full retrieval and report generation pipeline, see the GitHub repository.