Skip to content

About

Ready-to-use time series models implemented in PyTorch and Lightning.

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

chronocratic-models

PyPI version Total downloads CI status License GitHub stars Code style: ruff

Python Docs
Python versions Documentation status

⭐ Found this useful? Give it a star. chronocratic-models is free and open source. A star takes one click, tells us the work is worth continuing, and helps other time series researchers find the project.

Note: The PyPI package name uses a hyphen (chronocratic-models), but the import uses the chronocratic.models namespace.

Installation

With pip:

pip install chronocratic-models

With uv:

uv add chronocratic-models

Quick Start

import torch
from lightning.pytorch import Trainer
from chronocratic.models import TS2Vec, TS2VecModelParameters

# Create model using parameters dataclass
params = TS2VecModelParameters(input_dims=1)
model = TS2Vec(**vars(params))

# Prepare synthetic time series (n_instance, n_timestamps, n_features)
synthetic_data = torch.randn(2, 100, 1)

# Train the model first (models do not ship with pre-trained weights)
trainer = Trainer(max_epochs=1, accelerator="cpu", enable_checkpointing=False)
trainer.fit(model, train_dataloaders=synthetic_data)

# Get multi-scale representations
representations = model.encode(
    synthetic_data,
    batch_size=2,
    num_workers=0,
    encoding_window="multiscale",
)
print(representations.shape)

Models

The package ships with self-supervised time-series models across these architectures:

Category Import
Convolutional (Dilated) TS2Vec, CoST, AutoTCL
Convolutional (Standard) Series2Vec, TSTCC, SimCLR, MHCCL, MCL
Transformer TST
Recurrent TimeNet, RecurrentAutoEncoder
Generative TimeVAE

For details (original papers, encoder architecture, default hyperparameters), see the API reference and the ModelParameters dataclass for each model. The list above is maintained by the exports in chronocratic.models; adding a model is just extending __init__.py.

Important: No pre-trained weights are included — train on your own data before inference.

Features

  • Polymorphic augmentation producer contract — models accept any augmentation through a unified interface, eliminating enum-based branching.
  • Lightning integration — all models are built on PyTorch Lightning for clean training loops and extensibility.
  • Self-supervised representation learning — train encoders for downstream tasks without labeled data.
  • Pre-configured model parameters — each model ships with tested default configuration dataclasses.
  • NumPy and PyTorch tensor support — flexible input handling for both frameworks.

Documentation

For full API reference, guides, and examples, visit chronocratic-models.readthedocs.io.

Contributing

For development setup, linting, testing, and coding standards, see docs/contributing.md.

License

This project is licensed under the BSD 3-Clause License — see the LICENSE file for details.

The Chronocratic name and logo are not covered by the license. All rights reserved.

About

Ready-to-use time series models implemented in PyTorch and Lightning.

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages