pymc-devs/pytensor

PyTensor allows you to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays.

What it solves

PyTensor provides a way to define, optimize, and evaluate complex mathematical expressions involving multi-dimensional arrays. It acts as the computational backend for PyMC, enabling efficient numerical computation and gradient calculation.

How it works

It uses a symbolic graph framework to represent mathematical operations. Unlike some modern deep learning libraries, PyTensor maintains a static graph that can be modified in-place for advanced optimizations. It can transpile these graphs into executable code via C, JAX, or Numba to ensure high performance.

Who it’s for

It is designed for developers and researchers who need a flexible, hackable backend for symbolic mathematical computations, specifically those working with probabilistic programming or custom symbolic optimizations.

Highlights

  • Static Graph Optimization: Allows for in-place modification of expression graphs to remove unnecessary operations.
  • Multi-Backend Compilation: Supports compilation through C, JAX, and Numba.
  • Automatic Differentiation: Capable of computing gradients of symbolic expressions.
  • Extensible Framework: Pure-Python codebase that allows for the rapid development of custom operators.

Related

  • Project
  • Project
  • Project
  • Project
  • Project