Aleator.AutoDiff
0.3.0-preview.1
dotnet add package Aleator.AutoDiff --version 0.3.0-preview.1
NuGet\Install-Package Aleator.AutoDiff -Version 0.3.0-preview.1
<PackageReference Include="Aleator.AutoDiff" Version="0.3.0-preview.1" />
<PackageVersion Include="Aleator.AutoDiff" Version="0.3.0-preview.1" />
<PackageReference Include="Aleator.AutoDiff" />
paket add Aleator.AutoDiff --version 0.3.0-preview.1
#r "nuget: Aleator.AutoDiff, 0.3.0-preview.1"
#:package Aleator.AutoDiff@0.3.0-preview.1
#addin nuget:?package=Aleator.AutoDiff&version=0.3.0-preview.1&prerelease
#tool nuget:?package=Aleator.AutoDiff&version=0.3.0-preview.1&prerelease
Aleator.AutoDiff
Gradient-based inference stack of Aleator — capabilities that go beyond the original Scala Figaro:
- Reverse-mode autodiff tape (
Tape,Var,AdMath) with stable log-sigmoid / log-sum-exp primitives, unconstraining transforms (exp / interval / stick-breaking), and differentiable log-densities. JointModelbuilder +UniverseJointBuilderbridge from Aleator elements to a differentiable joint target.- Samplers —
HamiltonianMonteCarlo,NoUTurnSampler(dual averaging, mass-matrix adaptation). - Variational inference —
MeanFieldAdvi,FullRankAdvi,SteinVariationalGradientDescent. - Gaussian processes — composable kernels (RBF, Matérn, linear, …), marginal-likelihood hyperparameter learning through reverse-mode Cholesky, FITC sparse approximation.
var model = new JointModel();
var mu = model.Real("mu");
var target = model.Build(s =>
{
var logp = LogDensities.Normal(s[mu], 0.0, 10.0);
foreach (var y in data)
logp += LogDensities.Normal(s.Const(y), s[mu], 1.0);
return logp;
});
var nuts = new NoUTurnSampler(target, random: new DefaultRandomSource(42));
var draws = nuts.Sample(numSamples: 2000, warmup: 1000);
HMC and NUTS require a finite initial target value and gradient. Non-finite proposals are rejected as divergences;
inspect draws.Divergences after sampling. UniverseJointBuilder rejects element evidence because observations,
conditions, and constraints must be represented explicitly in its differentiable likelihood callback.
Public result metadata is exposed through read-only snapshots: kernel hyperparameters, GP optimisation history,
and variational means, histories, Cholesky rows, and particle rows cannot be changed through an IList cast.
UniverseJointBuilder.Latents is instead a live read-only view, so a retained view reflects subsequent Add calls.
For compatibility, PosteriorSamples.Draws keeps its IReadOnlyList<double[]> signature; because each row is still a
mutable array, every property access returns a fresh deep defensive copy. Cache that returned value when traversing
the same draws repeatedly; changing it never affects Mean, Variance, Map, or other sampler diagnostics.
Zero third-party dependencies.
Docs and examples: github.com/deecalov/Aleator.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Aleator.Core (>= 0.3.0-preview.1)
- Aleator.Library (>= 0.3.0-preview.1)
- System.Numerics.Tensors (>= 10.0.9)
-
net8.0
- Aleator.Core (>= 0.3.0-preview.1)
- Aleator.Library (>= 0.3.0-preview.1)
- System.Numerics.Tensors (>= 10.0.9)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Aleator.AutoDiff:
| Package | Downloads |
|---|---|
|
Aleator.Torch
TorchSharp bridge for Aleator — wraps a TorchSharp tensor program inside an IDifferentiableTarget so HMC/NUTS/ADVI/SVGD can consume neural-network log-densities and amortised encoders. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.3.0-preview.1 | 73 | 9/6/2026 |