This repository contains an implementation of the paper Gradients without backpropagation.
For a better understanding of the mathematical concepts covered, we recommend first viewing the file prerequisites.ipynb
.
After understanding the mathematical concepts, we recommend proceeding with fwdgrad.ipynb
: in this notwbook, the Forward Gradient Descent (FGD) algorithm is implemented on some known functions and on a convolutional network. For the convolutional network, the MNIST dataset have been used. In addition, there is also a comparison of model training using SGD and backpropagation.
Compared with the results reported in the paper, no improvement was found in the execution time of the forward gradient descent algorithm. Although the results on losses are about the same, backpropagation still turns out to be faster in execution than forward gradient.
Implemented in Python3 using Pytorch. Required packages: Matplotlib, Numpy, Pytorch.
All the references can also be find inside the python notebooks:
- Derivative.
- Kofi Asiedu Brempong, 2020 I Finally Understood Backpropagation: And you can too....
- Atılım Gunes Baydin, Barak A. Pearlmutter, Don Syme, Frank Wood, Philip Torr, 2022. Gradients without Backpropagation.
- Dual number.
- Mark Saroufim, 2019. Automatic Differentiation Step by Step.
- Robert Lange, 2019. Forward Mode Automatic Differentiation & Dual Numbers.
- Atılım Gunes Baydin, Barak A. Pearlmutter, Alexey Andreyevich Radul, Jeffrey Mark Siskind, 2018. Automatic Differentiation in Machine Learning: a Survey.
- Daniel Worrall, 2021. Dual numbers
- Robert Kübler, 2022. Papers Simplified: Gradients without Backpropagation.
This project is licensed under the MIT License
Copyright (c) 2023 Luigi Gallo