Skip to content

Online deep learning with PyTorch and river

deep-river

Train PyTorch models incrementally on data streams with river's familiar predict_one, learn_one, metrics, and pipeline APIs.

Install

pip install deep-river

or install through river extras:

pip install "river[deep]"

Streaming model loop

metric = metrics.Accuracy()

for x, y in stream:
    y_pred = model.predict_one(x)
    metric.update(y, y_pred)
    model.learn_one(x, y)

Why deep-river

Online updates

Learn from one sample or mini-batch at a time with stream-first estimators.

PyTorch modules

Bring your own architectures, losses, optimizers, and representation learning setup.

river ecosystem

Compose with river preprocessing, datasets, metrics, and pipelines.

Start here

  • Getting started: build and evaluate your first online classifier.
  • Examples: run complete workflows for classification, regression, anomaly detection, and continual learning.
  • API Reference: inspect estimator parameters, methods, and module-level utilities.
  • Benchmarks: compare model behavior across standard streaming datasets.