HIPS/autograd

Efficiently computes derivatives of NumPy code.

What it solves

Autograd 簡化了數學函式梯度計算的過程,免除手動推導與編寫函式導數的需求。這主要用於機器學習與科學計算中的基於梯度的優化。

How it works

它提供了一層薄薄的 NumPy 包裝,使其能自動微分原生 Python 與 NumPy 程式碼。它支援反向模式微分(反向傳播)以有效處理純量值函式,亦支援前向模式微分,且可任意組合以計算高階導數(導數的導數)。

Who it’s for

從事基於梯度的優化、神經網路與科學模擬的研究人員與開發者,想要在不手動推導的情況下計算 Python/NumPy 程式碼的導數。

Highlights

  • Native Python Support: Handles loops, if-statements, recursion, and closures.
  • Higher-Order Derivatives: Ability to calculate derivatives of any order.
  • Flexible Modes: Supports both forward and reverse-mode differentiation.
  • Broad Application: Used for building neural networks (CNNs, RNNs, LSTMs) and backpropagating through fluid simulations.