Standard AD libraries (PyTorch, JAX) provide gradcheck() comparing analytic backprop
against numerical finite differences. VTL has no such utility.
Task
Add autograd/gradcheck.v:
pub fn grad_check[T](ctx &Context[T], f fn() &Variable[T], eps f64) bool
Compares Variable.grad at each node against (f(x+eps)-f(x-eps))/(2*eps) with configurable tolerance.
File
Standard AD libraries (PyTorch, JAX) provide
gradcheck()comparing analytic backpropagainst numerical finite differences. VTL has no such utility.
Task
Add
autograd/gradcheck.v:Compares
Variable.gradat each node against(f(x+eps)-f(x-eps))/(2*eps)with configurable tolerance.File
autograd/gradcheck.v