aesara

Aesara is a Python library for defining, optimizing, and efficiently evaluating mathematical expressions involving multi-dimensional arrays.

https://github.com/aesara-devs/aesara

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    38 of 555 committers (6.8%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.3%) to scientific vocabulary

Keywords

aesara automatic-differentiation optimizing-compiler optimizing-compilers symbolic-computation tensors term-rewriting-system theano transpiler

Keywords from Contributors

closember jax cryptocurrencies transformers gtk qt tk wx cryptography exoplanet
Last synced: 6 months ago · JSON representation ·

Repository

Aesara is a Python library for defining, optimizing, and efficiently evaluating mathematical expressions involving multi-dimensional arrays.

Basic Info
Statistics
  • Stars: 1,216
  • Watchers: 17
  • Forks: 151
  • Open Issues: 330
  • Releases: 86
Topics
aesara automatic-differentiation optimizing-compiler optimizing-compilers symbolic-computation tensors term-rewriting-system theano transpiler
Created over 6 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation Security

README.md

logo [![Pypi][pypi-badge]][pypi] [![Downloads][downloads-badge]][releases] [![Contributors][contributors-badge]][contributors]
[![Gitter][gitter-badge]][gitter] [![Discord][discord-badge]][discord] [![Twitter][twitter-badge]][twitter] Aesara is a Python library that allows one to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays. *A fast and hackable meta-tensor library in Python* [Features](#features) • [Get Started](#get-started) • [Install](#install) • [Get help](#get-help) • [Contribute](#contribute) [Roadmap](https://github.com/orgs/aesara-devs/projects/3) • [Docs](https://aesara.readthedocs.io/en/latest/)

[!IMPORTANT] This project is no longer actively maintained. See https://github.com/aesara-devs/aesara/discussions/1521#discussioncomment-7687831 and https://x.com/BrandonTWillard/status/1729350499793588249 for more details.

Features

  • A hackable, pure-Python codebase
  • Extensible graph framework suitable for rapid development of custom operators and symbolic optimizations
  • Implements an extensible graph transpilation framework that currently provides compilation via C, JAX, and Numba.
  • Based on one of the most widely-used Python tensor libraries: Theano.

Aesara Overview Diagram: A graph linking the different components of Aesara. From left to right: Numpy API->Symbolic Graph<->Rewrites->Optimize/Stabilize->[C, Jax, Numba]"></img></p>

<h2>Get started</h2>

<p>``` python
import aesara
from aesara import tensor as at</p>

<h1>Declare two symbolic floating-point scalars</h1>

<p>a = at.dscalar("a")
b = at.dscalar("b")</p>

<h1>Create a simple example expression</h1>

<p>c = a + b</p>

<h1>Convert the expression into a callable object that takes <code>(a, b)</code></h1>

<h1>values as input and computes the value of <code>c</code>.</h1>

<p>f_c = aesara.function([a, b], c)</p>

<p>assert f_c(1.5, 2.5) == 4.0</p>

<h1>Compute the gradient of the example expression with respect to <code>a</code></h1>

<p>dc = aesara.grad(c, a)</p>

<p>f_dc = aesara.function([a, b], dc)</p>

<p>assert f_dc(1.5, 2.5) == 1.0</p>

<h1>Compiling functions with <code>aesara.function</code> also optimizes</h1>

<h1>expression graphs by removing unnecessary operations and</h1>

<h1>replacing computations with more efficient ones.</h1>

<p>v = at.vector("v")
M = at.matrix("M")</p>

<p>d = a/a + (M + a).dot(v)</p>

<p>aesara.dprint(d)</p>

<h1>Elemwise{add,no_inplace} [id A] ''</h1>

<h1>|InplaceDimShuffle{x} [id B] ''</h1>

<h1>| |Elemwise{true<em>divide,no</em>inplace} [id C] ''</h1>

<h1>|   |a [id D]</h1>

<h1>|   |a [id D]</h1>

<h1>|dot [id E] ''</h1>

<h1>|Elemwise{add,no_inplace} [id F] ''</h1>

<h1>| |M [id G]</h1>

<h1>| |InplaceDimShuffle{x,x} [id H] ''</h1>

<h1>|   |a [id D]</h1>

<h1>|v [id I]</h1>

<p>f_d = aesara.function([a, v, M], d)</p>

<h1><code>a/a</code> -> <code>1</code> and the dot product is replaced with a BLAS function</h1>

<h1>(i.e. CGemv)</h1>

<p>aesara.dprint(f_d)</p>

<h1>Elemwise{Add}[(0, 1)] [id A] ''   5</h1>

<h1>|TensorConstant{(1,) of 1.0} [id B]</h1>

<h1>|CGemv{inplace} [id C] ''   4</h1>

<h1>|AllocEmpty{dtype='float64'} [id D] ''   3</h1>

<h1>| |Shape_i{0} [id E] ''   2</h1>

<h1>|   |M [id F]</h1>

<h1>|TensorConstant{1.0} [id G]</h1>

<h1>|Elemwise{add,no_inplace} [id H] ''   1</h1>

<h1>| |M [id F]</h1>

<h1>| |InplaceDimShuffle{x,x} [id I] ''   0</h1>

<h1>|   |a [id J]</h1>

<h1>|v [id K]</h1>

<h1>|TensorConstant{0.0} [id L]</h1>

<p>```</p>

<p>See <a href=the Aesara documentation for in-depth tutorials.

Install

The latest release of Aesara can be installed from PyPI using pip:

python pip install aesara

Or via conda-forge:

python conda install -c conda-forge aesara

The current development branch of Aesara can be installed from GitHub, also using pip:

python pip install git+https://github.com/aesara-devs/aesara

Get help

Report bugs by opening an issue. If you have a question regarding the usage of Aesara, start a discussion. For real-time feedback or more general chat about Aesara use our Discord server, or Gitter.

Contribute

We welcome bug reports and fixes and improvements to the documentation.

For more information on contributing, please see the contributing guide and the Aesara Mission Statement.

A good place to start contributing is by looking through the issues.

Support

Special thanks to Bram Timmer for the logo.

Owner

  • Name: Aesara
  • Login: aesara-devs
  • Kind: organization
  • Email: aesara.devs@gmail.com

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: Aesara
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Brandon
    family-names: Willard
    name-particle: T
    email: bwillard@uchicago.edu
    affiliation: University of Chicago
    orcid: 'https://orcid.org/0000-0002-0951-3289'
  - given-names: Rémi
    family-names: Louf
  - given-names: Kaustubh
    family-names: Chaudhari
  - given-names: Ben
    family-names: Mares
  - given-names: Smit
    family-names: Lunagariya
    email: smitlunagariya.mat18@itbhu.ac.in
    affiliation: Indian Institute of Technology (BHU), Varanasi
  - given-names: Dan
    family-names: Foreman-Mackey
  - given-names: Daniel
    family-names: Gerlanc
repository-code: 'https://github.com/aesara-devs/aesara'
url: 'https://github.com/aesara-devs'
abstract: >-
  Aesara is a Python library for defining, optimizing, and
  efficiently evaluating mathematical expressions involving
  multi-dimensional arrays.
keywords:
  - automatic differentiation
  - symbolic computation
  - tensors
  - Theano
  - transpilation
license: BSD-3-Clause
commit: e02b23e
version: rel-2.9.1
date-released: '2023-06-28'
references:
  - authors:
      - family-names: Bergstra
        given-names: James
      - family-names: Breuleux
        given-names: Oliver
      - family-names: Bastien
        given-names: Frédéric
      - family-names: Lamblin
        given-names: Pascal
      - family-names: Pascanu
        given-names: Razvan
      - family-names: Desjardins
        given-names: Guillaume
      - family-names: Turian
        given-names: Joseph
      - family-names: Warde-Farley
        given-names: David
      - family-names: Bengio
        given-names: Yoshua
    title: "Theano: a CPU and GPU Math Expression Compiler"
    type: software

GitHub Events

Total
  • Watch event: 39
  • Delete event: 1
  • Issue comment event: 2
  • Pull request event: 3
  • Fork event: 1
  • Create event: 1
Last Year
  • Watch event: 39
  • Delete event: 1
  • Issue comment event: 2
  • Pull request event: 3
  • Fork event: 1
  • Create event: 1

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 25,612
  • Total Committers: 555
  • Avg Commits per committer: 46.148
  • Development Distribution Score (DDS): 0.716
Past Year
  • Commits: 3
  • Committers: 2
  • Avg Commits per committer: 1.5
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
Frederic n****z@n****g 7,283
Arnaud Bergeron a****n@g****m 1,803
Pascal Lamblin l****p@i****a 1,652
James Bergstra b****j@i****a 1,432
Brandon T. Willard b****d 1,288
Olivier Delalleau d****a@i****o 902
Ian Goodfellow g****n@g****m 626
--global c****c@g****m 594
Razvan Pascanu r****u@g****m 563
notoraptor s****o@g****m 445
Olivier Breuleux b****o@i****a 381
Razvan Pascanu p****r@i****o 368
David Warde-Farley w****r@i****a 320
João Victor Tozatti Risso j****o@g****m 272
Roy Xue x****y@g****m 205
Iban Harlouchet h****i@e****a 189
Iban Harlouchet i****t@g****m 183
affanv14 a****4@g****m 182
abalkin a****n@e****m 175
sentient07 v****5@g****m 172
ChienliMa m****e@g****m 162
Reyhane Askari r****t@g****m 161
Tanjay94 y****u@y****m 159
James Bergstra j****a@g****m 159
amrithasuresh s****t@g****m 159
Gijs van Tulder g****r@g****m 142
Nicolas Ballas b****n@g****m 140
Ian Goodfellow d****l@l****t 130
Rémi Louf r****f@g****m 129
Ricardo r****4@g****m 124
and 525 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 62
  • Total pull requests: 103
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 19
  • Total pull request authors: 29
  • Average comments per issue: 2.34
  • Average comments per pull request: 2.68
  • Merged pull requests: 80
  • Bot issues: 0
  • Bot pull requests: 13
Past Year
  • Issues: 0
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 month
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.33
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • rlouf (21)
  • brandonwillard (15)
  • PaulScemama (4)
  • twiecki (3)
  • maresb (3)
  • oscarbenjamin (2)
  • dfm (1)
  • davipatti (1)
  • ligonliu (1)
  • GaetanLepage (1)
  • MauricioGS99 (1)
  • dgerlanc (1)
  • dependabot[bot] (1)
  • mattearllongshot (1)
  • seberg (1)
Pull Request Authors
  • brandonwillard (37)
  • dependabot[bot] (10)
  • Smit-create (8)
  • aseyboldt (5)
  • rlouf (4)
  • github-actions[bot] (4)
  • dgerlanc (4)
  • maresb (4)
  • yahiahamdaoui (2)
  • ricardoV94 (2)
  • PaulScemama (2)
  • FredericWantiez (2)
  • sudarsan2k5 (2)
  • purna135 (2)
  • SauravMaheshkar (2)
Top Labels
Issue Labels
help wanted (28) enhancement (27) good first issue (19) random variables (14) NumPy compatibility (13) bug (11) JAX (9) Op implementation (8) important (7) performance concern (6) Numba (6) C-backend (5) graph rewriting (5) refactor (5) documentation (5) question (4) request discussion (3) testing (3) Scan (3) setup and installation (3) MacOS (2) MWE needed (1) miniKanren (1) graph objects (1) tooling (1) unexpected behavior (1) dependencies (1) github_actions (1)
Pull Request Labels
enhancement (38) bug (28) important (18) random variables (14) NumPy compatibility (12) dependencies (11) documentation (11) Op implementation (10) JAX (9) refactor (9) Numba (9) typing (7) Scan (5) C-backend (5) graph rewriting (4) CI (4) setup and installation (4) testing (4) MacOS (3) github_actions (3) performance concern (2) SciPy compatibility (2) graph objects (1) tensor algebra (1) gradient implementations (1) backend compatibility (1) shape inference (1)

Packages

  • Total packages: 4
  • Total downloads:
    • pypi 170,537 last-month
  • Total docker downloads: 104
  • Total dependent packages: 25
    (may contain duplicates)
  • Total dependent repositories: 143
    (may contain duplicates)
  • Total versions: 607
  • Total maintainers: 4
pypi.org: aesara

A library for defining, optimizing, and efficiently evaluating mathematical expressions involving multi-dimensional arrays.

  • Versions: 75
  • Dependent Packages: 16
  • Dependent Repositories: 128
  • Downloads: 169,677 Last month
  • Docker Downloads: 104
Rankings
Dependent packages count: 0.6%
Downloads: 0.8%
Dependent repos count: 1.3%
Docker downloads count: 1.7%
Average: 1.7%
Stargazers count: 1.9%
Forks count: 4.0%
Maintainers (3)
Last synced: 6 months ago
pypi.org: aesara-nightly

A library for defining, optimizing, and efficiently evaluating mathematical expressions involving multi-dimensional arrays.

  • Versions: 453
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 860 Last month
Rankings
Stargazers count: 1.9%
Forks count: 4.0%
Downloads: 4.4%
Dependent packages count: 7.4%
Average: 8.0%
Dependent repos count: 22.2%
Last synced: 6 months ago
conda-forge.org: aesara
  • Versions: 64
  • Dependent Packages: 6
  • Dependent Repositories: 10
Rankings
Dependent packages count: 9.0%
Dependent repos count: 11.0%
Average: 11.9%
Stargazers count: 12.8%
Forks count: 14.7%
Last synced: 6 months ago
conda-forge.org: aesara-base
  • Versions: 15
  • Dependent Packages: 3
  • Dependent Repositories: 4
Rankings
Stargazers count: 12.8%
Forks count: 14.7%
Average: 14.8%
Dependent packages count: 15.6%
Dependent repos count: 16.0%
Last synced: 6 months ago