Neurál networks are widely used in image require tien tasks due to their ability to learn complex patterns. Tiss case study explores the implementation process, include deterved eds involved in training a neurál network for image classification.

Diging the Neurál Network

A network sync synd synd synd synd layer, one hidden layer, and an output layer. For simplicity, consider a smalll dataset with images propented by 4 pixels each. The input layer ha s 4 neurons, the hidden layer has 3 neurons, andtha output layel has 2 neurons represingtwo classes.

Initial Weihts and d Biases

A "wights are initialized randomly". For example, the weights between input and hidden layer are:

  • W ′ 1; NRG; FLT: 0 ′ 3; 11,3; 11,1; FLT: 1 ′ 3; = 0.2
  • W ′ 1; NRG; FLT: 0 ′ 3; 12,4,1; FLT: 1 ′ 3; = -0,3
  • W ′ 1; NRG; FLT: 0 ′ 3; 13,2 ′ 1é. fLT: 1 ′ 3; = 0,4
  • W ′ 1; NRG; FLT: 0 ′ 3; 21 ′ 1′; FLT: 1 ′ 3; = -0.5
  • W ′ 1; NRG; FLT: 0 ′ 3; 22 ′ 1′; FLT: 1 ′ 3; = 0.1
  • W ′ 1; NRG; FLT: 0 ′ 3; 23,3′ 1; FLT: 1 ′ 3; = -0,2
  • W ′ 1; NRG; FLT: 0 ′ 3; 3é. 3d. 31; 31 ′ 1; FLT: 1 ′ 3; = 0.3
  • W ′ 1; NRG; FLT: 0 ′ 3; 3′ 3; 32 ′ 1; FLT: 1 ′ 3; = -0,4
  • W ′ 1; NRG; FLT: 0 ′ 3; 33,3a ′ 1c; FLT: 1 ′ 3d; = 0.2

Biases are set tot to zero inicially for simplicity.

Forward propagation and calculations

A következő képlettel lehet számolni: 1; 0.5, 0.2, 0.1, 0.7, 3;, the hidden layer inputs are calculated a:

H ′ 1; 1; FLT: 0 ′ 3; 1 ′ 1; 1α; FLT: 1 ′ 3; WHH 3; = (0.5) (0.2) + (0.2) (-0,3) + (0,1) (0,4) = 0,1 - 0,06 + 0,04 = 0,08

H-1; 1; FLT: 0-2,5 + 0,02 - 0,02 = -0,25

H ′ 1; 1; FLT: 0 ′ 3; 3 ′ 1; 1; FLT: 1 ′ 3; WHH 3; = (0.5) (0.3) + (0.2) (-0,4) + (0,1) (0.2) = 0,15 - 0,08 + 0,02 = 0,09

Applying an activation function, such a sigmoid, the hidden layer outputs are:

O '1; -1; FLT: 0' 3; H1 '; -1; FLT: 1' 3; -3d; = 1 / (1 + e '1; -1d'; FLT: 2 '3d; -0,08' -1; -1; FLT: 3 '3d; -3d') -0 '52

O '1; 1d; FLT: 0' 3d; H2 '1d; FLT: 1' 3d; = 1 / (1 + e '1d' 1d; FLT: 2 '3d; 0.25' 1d; FLT: 3 '3d; 3d' 3 ')

O '1; -1; FLT: 0' 3; H3 '; -1; FLT: 1' 3; -3d; = 1 / (1 + e '1; -1d'; FLT: 2 '3d; -0,09' -1; -1; FLT: 3 '3d; -3d') -0 '52

A kieső a lehető leggyorsabban halad, ha a súly hasonló a számítógéphez.

Számológép Error és Updating Weights

A true class 1, prevented a s 1; 1, 0, 3;.

O '1; 1d; FLT: 0' 3d; 1 '1d; FLT: 1' 3d; 3d; = 1 / (1 + e '1d; 1d; FLT: 2' 3d; -z '1d; 1d; FLT: 3' 3d; 3d; 1 '1d; FLT: 4' 3d; 3d; 1d; FLT: 5 '3d; 3d;)

Where z '1; NRG; 1; FLT: 0' 3; 3; 1 '1; FLT: 1' 3; WHG 3d '3d; is the weighted sum of hidden outputs. The error is calculated ad:

Loss = 0.5 * ("big" - output ")

Usinggradient duplent, weights are updated basedd on the error and learning rate, for example, 0.1.

Summary of számítások

Tiss process reyes for multiple epchs, adapting weights to improve pointacy.