Neural Networks And Deep Learning Web Book

Chapter 1

Sigmoid neuron: a type of neuron where the weights and bias changes have a capped/limited impact on the neuron's output. This allows for more effective learning. Feedforward: a neural network type where the information is only fed forward towards output. not back towards input. recurrent neural networks: networks that do allow for loops of feedback.

Cost Function: (or loss/objective function) C(w,b)12nxy(x)a2C(w,b)\equiv\frac{1}{2n}\sum_{x}||y(x)-a||^2

  • ww denotes collection of all weights in network
  • bb all biases
  • nn the total number of training inputs
  • aa the vector of outputs
  • xx training input
  • y(x)y(x) the output, a 10-D vector
  • \sum is all training inputs summed
  • v||v|| denotes the usual length for a vector vv
  • CC the quadratic cost function If C(w,b)C(w,b) is large the training is doing poorly, but if its 0\approx0 then it is doing great. η\eta is the learning rate for the model.

Chapter 2

Back propagation: an algorithm for calculating the gradient of the cost function.

  • wjklw_{jk}^l denotes the weight for the connection from the kthk^{th} neuron in the (l1)th(l-1)^{th} layer to the jthj^{th} neuron in the lthl^{th} layer.
  • For Bias: bjlb_j^l is the bias of the jthj^{th} neuron in the lthl^{th} layer.
  • The activation of a layer from the last, lthl^{th} from jthj^{th} as follows: ajl=σ(kwjklakl1+bjl)a_j^l = \sigma(\sum_k{w_{jk}^{l}a_k^{l-1}+b_j^l})
    - Here the sum is over all neurons $k$ in the $(l-1)^{th}$ layer. 
    
    Vectorization: apply a function, such as σ\sigma to every element in a vector vv, so σ(v)\sigma(v) to denote this element-wise application of the function, or to say: σ(v)j=σ(vj)\sigma(v)_j = \sigma(v_j)
  • So ajl=σ(kwjklakl1+bjl)a_j^l = \sigma(\sum_k{w_{jk}^{l}a_k^{l-1}+b_j^l}) is rewritten in the smaller vectorized form: al=σ(wlal1+bl)a^l = \sigma(w^la^{l-1}+b^l) Weighted input: While computing σ(v)\sigma(v) the weighted input is computed: zlwlal1+blz^l \equiv w^la^{l-1}+b^l , and thus ala^l can also be written as al=σ(zl)a^l = \sigma(z^l) elementwise product: Where each element is multiplied by the corresponding element in another matrix Hadamard product: Elementwise multiplication of two vectors: sts\odot t , so (st)j=sjtj(s\odot{t})_j = s_jt_j Error in output layer: δL\delta^L contains these components: δjL=CajLσ(zjL)\delta_j^L = \frac{\partial C}{\partial a_j^L}\sigma'(z_j^L) . Where CajL\frac{\partial C}{\partial a_j^L} measures the rate the cost is changing as a function of the jthj^{th} output activation. And σ(zjL)\sigma'(z_j^L) measures rate of activation function σ\sigma is changing at zjLz_j^L. Rewritten in the matrix basic form: δL=aCσ(zL)\delta^L = \nabla_a C \odot \sigma'(z^L), where aC\nabla_a C expresses the rate of change of CC. Changes propagate through later layers and cause the cost to change by: CzjlΔzjl\frac{\partial C}{\partial z^l_j} \Delta z^l_j .

The error δjl\delta^l_j for neuron jj in layer ll: δjlCzjl\delta^l_j\equiv \frac{\partial{C}}{\partial{z^l_j}}, so that δl\delta^l are the errors associate with layer ll. The back propagation will allow for computing the δl\delta^l for every layer. Plan of attack: using back propagation's 4 equations, can compute the error for each level and therefore the gradient cost function.

An equation for the error in the output layer: so δL\delta^L has: δjL=CajLσ(zjL)\delta^L_j=\frac{\partial{C}}{\partial{a^L_j}}\sigma^`(z^L_j) the \partial part measures the speed the cost changes.