import torch
from omnibias.torch import get_activation
x = torch.linspace(-2,2,9, dtype=torch.float64)
spec = get_activation("tanh")
first = spec.fastpath(x,1)
expected =1- torch.tanh(x).square()
torch.testing.assert_close(first, expected)print(first.shape)# torch.Size([9])
02 / LEARN BY EXPLORING
The limit is the beginning.
Move the controls. See how bias collapse extracts derivatives and temperature hardening sharpens decisions.
TWO LIMITS. TWO DIFFERENT IDEAS.
Nearby shifts. An exact derivative.
Move the bias gap toward zero. The normalized difference approaches the first derivative. omnibias evaluates the analytic limit directly, avoiding subtraction of nearby samples.
[tanh(z + δ) − tanh(z)] / δ → tanh′(z)
Normalized finite difference┄ Analytic derivative
03 / CHOOSE YOUR NEXT STEP
From an idea to a training loop.
Focused paths through the toolkit, with explicit assumptions and examples you can run.
More of your physics. More of your model’s structure. Inside the training loop. Explore four workflows you can inspect, reproduce, and build on.
01 / MechanicsThe bottleneck
Drag to explore. Scrolling continues the story.
< 0.001%Relative solution error Recorded notebook run · CPU float64Inspect result ↗
01 / Mechanics
Put more physics inside the training loop.
Conventional workflow
A fourth-order residual asks a spatial autodiff graph to differentiate itself again and again.
With omnibias
Carry the required derivatives forward. Train through the residual with gradients into every model parameter.
< 0.001% relative solution error · recorded example
A smooth, nondimensional, manufactured beam problem. Exact boundary conditions come from its polynomial envelope; global PDE convergence is not implied.
A Laplacian needs a Hessian trace. Constructing every Hessian entry does extra work for that particular quantity.
With omnibias
Propagate the supported contraction directly, then use it in a trainable field equation.
0.056% relative solution error · recorded example
A unit-square Poisson problem with a known smooth solution. Boundary values are penalized, not exactly enforced. This is not a measured training-speed comparison.
Parameter fitting needs more than a loss function: parameterization, residual sensitivities, and solver assumptions determine the result.
With omnibias
Use residual-Jacobian curvature in a supported Gauss–Newton solver, keeping the parameter and residual contracts explicit.
< 1e-12 held-out rmse · recorded example
Three parameters and noiseless synthetic decay observations. Recovery at floating-point precision is not a robustness or uncertainty guarantee for noisy measurements.