Principle:Google deepmind Mujoco Finite Difference Derivatives
| Knowledge Sources | Domains | Last Updated |
|---|---|---|
| Google DeepMind MuJoCo | Physics Simulation, Numerical Methods | 2025-02-15 |
Overview
Description: Finite-difference derivative approximation computes numerical gradients of the dynamics by perturbing inputs and observing output changes. This serves as both a fallback when analytical derivatives are unavailable and a verification tool for analytical derivative correctness.
Context: MuJoCo provides finite-difference derivative computation for validating analytical derivatives and for use cases where the analytical path does not cover certain model features (e.g., custom plugins or user-defined callbacks).
Theoretical Basis
Finite-difference methods approximate derivatives using function evaluations at perturbed points:
- Forward differences: df/dx ≈ (f(x+h) - f(x)) / h, requiring n+1 evaluations for n parameters
- Central differences: df/dx ≈ (f(x+h) - f(x-h)) / 2h, achieving O(h^2) accuracy at the cost of 2n evaluations
- Step size selection: The perturbation h must balance truncation error (large h) against round-off error (small h); typically h ≈ sqrt(epsilon) for forward differences
Finite-difference derivatives scale linearly with the number of parameters, making them expensive for high-dimensional systems but invaluable for debugging and validation.
Related Pages
Implementations
Workflows
- (none yet)