Skip to content

ForeBlocks Docs

foreBlocks v0.1.41 | Documentation

Modular time-series forecasting for PyTorch

foreblocks provides forecasting models, training, evaluation, and preprocessing. darts is a standalone differentiable neural-architecture-search package. foretools offers companion utilities for synthetic data, feature engineering, decomposition, and hyperparameter search. All three ship in the same foreblocks wheel. The docs guide you from a simple baseline to advanced architectures and architecture search.

Start smallUse ForecastingModel + Trainer + ModelEvaluator for a quick baseline.
Raw series readyTimeSeriesHandler converts raw [T, D] arrays into training windows automatically.
Search includedDARTS guides cover screening, bilevel search, retraining, and analysis.
Toolbox utilitiesforetools adds synthetic data generation, BOHB search, VMD decomposition, and feature engineering.

Choose your route

Path 01

Train a baseline model

Start with the smallest reliable public API path. Validates imports, dataloader shapes, and evaluation before adding extras.

Path 02

Handle raw time series

Use TimeSeriesHandler to automatically scale, filter, window, and prepare raw multivariate arrays.

Path 03

Explore advanced backbones

Learn transformer attention, MoE routing, custom blocks, and Custom Mamba for stronger models. See Advanced Transformer Features for LLRD, per-layer dropout, GateSkip, MoD, mHC, and Advanced MoE for production tuning.

Path 04

Automate architecture search

Run DARTS to automatically discover optimal architecture combinations from a defined operation pool.

Path 05

Add uncertainty intervals

Use conformal prediction to generate prediction intervals when you need coverage guarantees.

Path 06

Use companion utilities

Access synthetic data generation, BOHB search, VMD decomposition, and feature engineering tools.

1. Run a baselineFollow Getting Started to validate the core training loop with minimal dependencies.
2. Understand the stackRead Overview to see how foreblocks and foretools connect.
3. Explore the public APIBrowse Public API to learn stable imports before diving into subsystems.
4. Choose your workflowPick a guide based on your task: preprocessing, transformers, DARTS search, uncertainty, or foretools.

Install by intent

NeedCommandNext page
Core forecastingpip install foreblocksGetting Started
Raw-series preprocessingpip install "foreblocks[preprocessing]"Preprocessor Guide
Architecture search (DARTS)pip install "foreblocks[darts]"DARTS Guide
Experiment tracking (MLTracker)pip install "foreblocks[mltracker]"Web UI
VMD decompositionpip install "foreblocks[vmd]"VMD Guide
Wavelet preprocessingpip install "foreblocks[wavelets]"Preprocessor Guide
All runtime extraspip install "foreblocks[all]"Overview

Documentation map

Tutorials

Step-by-step runnable paths:

Guides

Topic-based deep dives:

Foretools

Companion utilities and helpers:

Architecture

Internals and system notes:

Stable public entry points

Start here before using deep imports:

Core

python
from foreblocks import (
    ForecastingModel,
    Trainer,
    ModelEvaluator,
    TimeSeriesHandler,
    TimeSeriesDataset,
    create_dataloaders,
    ModelConfig,
    TrainingConfig,
)
```python

### Uncertainty

```python
from foreblocks.core import ConformalPredictionEngine
```python

### Wavelet & frequency attention

Spectral attention is available today through the transformer stack rather than a
standalone import — select it with the `att_type` argument:

```python
from foreblocks import TransformerEncoder

# Wavelet-domain (Haar DWT) attention
enc = TransformerEncoder(input_size=8, d_model=64, num_layers=2, att_type="dwt")

# Frequency-domain (FEDformer-style) attention
enc = TransformerEncoder(input_size=8, d_model=64, num_layers=2, att_type="frequency")

MIT License