Automatic differentiation (AD) is a range of algorithms to compute the numeric value of a function's (partial) derivative, where the function is typically given as a computer program or abstract syntax tree. AD has become immensely popular as part of many learning algorithms, notably for neural networks. This paper uses Prolog to systematically derive gradient-based forward- and reverse-mode AD variants from a simple executable specification: evaluation of the symbolic derivative. Along the way we demonstrate that several Prolog features (DCGs, co-routines) contribute to the succinct formulation of the algorithm. We also discuss two applications in probabilistic programming that are enabled by our Prolog algorithms. The first is parameter learning for the Sum-Product Loop Language and the second consists of both parameter learning and variational inference for probabilistic logic programming.
Automatic Differentiation in Prolog
Riguzzi F.Ultimo
2023
Abstract
Automatic differentiation (AD) is a range of algorithms to compute the numeric value of a function's (partial) derivative, where the function is typically given as a computer program or abstract syntax tree. AD has become immensely popular as part of many learning algorithms, notably for neural networks. This paper uses Prolog to systematically derive gradient-based forward- and reverse-mode AD variants from a simple executable specification: evaluation of the symbolic derivative. Along the way we demonstrate that several Prolog features (DCGs, co-routines) contribute to the succinct formulation of the algorithm. We also discuss two applications in probabilistic programming that are enabled by our Prolog algorithms. The first is parameter learning for the Sum-Product Loop Language and the second consists of both parameter learning and variational inference for probabilistic logic programming.File | Dimensione | Formato | |
---|---|---|---|
2305.07878.pdf
accesso aperto
Descrizione: Pre-print
Tipologia:
Pre-print
Licenza:
Creative commons
Dimensione
246.38 kB
Formato
Adobe PDF
|
246.38 kB | Adobe PDF | Visualizza/Apri |
automatic-differentiation-in-prolog.pdf
solo gestori archivio
Descrizione: Full text editoriale
Tipologia:
Full text (versione editoriale)
Licenza:
Copyright dell'editore
Dimensione
264.94 kB
Formato
Adobe PDF
|
264.94 kB | Adobe PDF | Visualizza/Apri Richiedi una copia |
I documenti in SFERA sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.