How rks-2804/vista works
Project Type & Purpose
• VISTA is a modular, config-driven machine-learning pipeline for structured text analysis.
• Key use-cases: Mix-and-match encoder/decoder backbones (CNN/ViT/Swin + Transformer/BART), run experiments, log metrics to Weights & Biases, support dataset download & training.
File Structure
• Top-level modules:
• core/ — registry, abstract base classes
• data/ — dataset loaders and I/O
• encoders/ — CNN, ViT, Swin encoder implementations
• decoders/ — Transformer, BART decoder implementations
• models/ — model composition glue
• training/ — train.py harness
• evaluation/ — metric computation
• scripts/ — CLI entrypoints (run experiments, download data)
• configs/ — YAML configs for experiments & training
• utils/ — helpers
• Build & deploy: setup.py, requirements.txt
Extract Insights from README
• Config-based experiment orchestration (configs/*.yaml)
• Registry pattern in core/ to inject encoders/decoders
• Scripts invoke training and evaluation pipelines, optionally logging to wandb
• docs/ folder holds further architectural notes
Main Components
a. Command-Line Interface (scripts/)
• run_all_experiments.py
• download_synthdog_ja.py
b. Configuration Manager (configs/ + config_example.yaml)
• Loads YAML, passes to core.registry
c. Core Registry (core/registry.py)
• Factory for encoders/decoders/models
d. Data Pipeline (data/dataset.py)
• Downloads or loads SynthDoG-ja, CORD, etc.
e. Encoder Module (encoders/)
• CNN, ViT, Swin
f. Decoder Module (decoders/)
• Transformer, BART
g. Model Assembly (models/model.py)
• Combines selected encoder + decoder into one trainable model
h. Training Engine (training/train.py)
• Instantiates model, optimizer, loss, data loader; runs epochs
i. Evaluation Suite (evaluation/metrics.py)
• Computes Normed ED, TED, F1 after/between epochs
j. Logging & Tracking
• Weights & Biases integration (wandb)
k. Utilities (utils/)
• Miscellaneous helpers
Relationships & Data Flow
1. User invokes a script via CLI → script parses args (config path, wandb flag).
2. Config Manager loads YAML → hands config dict to core.registry.
3. Registry uses config entries to instantiate:
• Data loader
• Encoder
• Decoder
• Model wrapper
• Optimizer, scheduler
4. Training Engine receives these instances → loops over data batches:
• Data loader → batch → encoder → feature maps
• Decoder → predictions → loss
5. After each epoch or at checkpoints:
• Evaluation metrics module computes scores
• Metrics & hyperparams are logged to wandb
6. Final artifacts (models, logs) are stored locally or in wandb.
Architectural Patterns & Design Principles
• Plugin/Registry pattern in core.registry for pluggable encoders & decoders
• Config-driven pipeline (YAML files define all hyperparams & component choices)
• Clear separation of concerns: data, model, training, evaluation, logging
• Extensible directory structure allowing additional backbones or metrics
• Script-based orchestration for reproducible experiments