raven-ml/raven

Modern scientific computing for OCaml

What it solves

Raven provides a comprehensive ecosystem of libraries for numerical computing, machine learning, and data science specifically for the OCaml language. It aims to bring the functionality of the Python scientific stack (like NumPy, JAX, and PyTorch) to OCaml, while maintaining the language's strong type safety.

How it works

Raven is composed of several specialized packages that handle different parts of the ML pipeline:

  • nx: Handles n-dimensional arrays and linear algebra.
  • tolk: A minimal ML compiler for GPU tensor computation.
  • rune: Provides automatic differentiation and functional transformations.
  • rune and kaun: Used together for building and training neural networks.
  • brot: Implements fast, HuggingFace-compatible tokenization.
  • talon: Provides type-safe dataframes.
  • hugin: Used for publication-quality plotting.
  • quill: An interactive REPL and markdown notebooks for exploration.
  • munin: Local experiment tracking with a TUI dashboard.
  • sowilo: Differentiable computer vision.
  • fehu: Reinforcement learning environments.

Who it’s for

Developers and researchers who want to perform scientific computing and machine learning in OCaml, benefiting from type safety and functional programming paradigms.

Highlights

  • Full-stack ML ecosystem: Covers everything from dataframes (Talon) and tokenization (Brot) the same way Python's ecosystem does.
  • Type-safe operations: Rebuilds scientific computing tools with OCaml's type system.
  • GPU acceleration: Includes a compiler for GPU tensor computation via Tolk.
  • Automatic differentiation: Integrated automatic differentiation via Rune.
  • Integration: HuggingFace-compatible tokenization and RL environments.

Related

  • Project
  • Project
  • Project
  • Project
  • Project