Symbolic differentiation framework for the JVM
Top 59.9% on sourcepulse
Kotlin∇ is a type-safe automatic differentiation framework for the JVM, designed for users who need to express differentiable programs with higher-dimensional data structures and operators. It leverages Kotlin's type system to enforce algebraic validity at compile-time, aiming to eliminate runtime errors and provide an expressive, mathematically similar notation.
How It Works
Kotlin∇ implements automatic differentiation (AD) using a combination of operator overloading, first-class functions, and algebraic data types. Expressions are represented as directed acyclic graphs (dataflow graphs) rather than being immediately evaluated. This approach allows for symbolic manipulation, higher-order differentiation, and compile-time shape safety, particularly for up to rank-2 tensors (matrices).
Quick Start & Requirements
build.gradle
or pom.xml
. For Jupyter notebooks, use @file:DependsOn("ai.hypergraph:kotlingrad:0.4.7")
.Highlighted Details
Maintenance & Community
The project lists numerous contributors and acknowledges inspiration from many AD and differentiable programming projects. Community links (Discord/Slack) are not explicitly provided in the README.
Licensing & Compatibility
The project is distributed under the Apache License 2.0, which is permissive for commercial use and closed-source linking.
Limitations & Caveats
Shape safety is currently limited to rank-2 tensors. Higher-order derivatives for matrix functions and N-dimensional tensors beyond rank 2 are noted as future work. The "Type arithmetic" section mentions experimental features and known issues with large number computations in the type system.
7 months ago
1 day