Code Monkey home page Code Monkey logo

backpropagation's Introduction

A Derivation of the Backpropagation Algorithm

Andrew Ng's Coursera courses on Machine Learning and Deep Learning provide only the equations for backpropagation, without their derivations. To accompany my studies, I have written up full derivations of the backpropagation algorithm (for differentiating a neural network's cost function) as they apply to both the Stanford Machine Learning course and the deeplearning.ai Deep Learning specialization.

My first derivation here, which is just an excerpt from my lecture notes, was motivated mostly by the need to make sense of the strange notation and network structure (e.g. using bias nodes rather than bias vectors) used throughout the Machine Learning Coursera course offered by Stanford.

My second derivation here formalizes, streamlines, and updates my derivation so that it is more consistent with the modern network structure and notation used in the Coursera Deep Learning specialization offered by deeplearning.ai, as well as more logically motivated from step to step. In other words, it better shows how the backpropagation algorithm might be obtained from first principles if we had never heard of the algorithm before.

equations

backpropagation's People

Contributors

chrismbryant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

backpropagation's Issues

A small question regarding accumulation

So it seems I found an issue after all, but its probably a misunderstanding on my part!

You specify that the error delta(j) is calculated by taking the difference between the activation versus the y example. This makes sense as theres usually a corresponding y example for each output class. The exact quote is: we will use the backpropagation algorithm to compute an โ€œerrorโ€ ๐›ฟ๐‘—(๐‘™) for each unit in each layer. In the final layer ๐ฟ, this error calculation is straightforward:

With this and backpropagation, the errors of earlier layers can be found, until an accumulation matrix is used. You write: To do this, weโ€™ll build up a matrix for each layer, adding to it after each training example like so (starting with a matrix of zeros)

My question concerns the role of each unit in a layer for this accumulation. You spoke of calculating individual errors in each unit of a layer, but in the accumulation I dont see the units being mentioned? Are they subscripted as p & j ? Specifically, in your "errors in earlier layers formula", the units are not specified. I assume this is because all of the nodes are intrinsically included in a vector?

Thanks

Possible error in partial derivative calculation

On page 4 of the 2017_29_27 derivation, there appears to be an inconsistency in the denominators of lines 1, 2, and 4. This needs to be either verified as correct or explained and corrected.

Redundant term in backprop derivation ?

In 2017_06_21 Backpropagation Derivation (for Coursera ML).pdf, on page 30, the last term of the 3rd step: ฮดjk seems to be redundant if I am not wrong ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.