Neural Network

Neural Network

Basically a cascading of multiple Logistic Regressions . It is non linear score function. Also see: From Linear Regression to a Neural Network .

Use for Image Classification #

The score function would assign each label a certain probability, and the classifier would assign the label with the highest probability.

Structure of a neural network #

  • One layer neual network is just a Linear Regression
  • Each step of the evaluation of the neural network has its own dimensionality:
    • Image: Pixels * Color channels
    • Output: Number of Labels
    • Hidden layers: Can be any number

Layer structure #

  • Each layer consists of neurons
  • Usually: every neuron is connected with every other neuron of the adjacent layers.
  • The output of a neuron is sent to all its successors in the next layers. (Every successor will recieve the same value from it)
  • neural_network_2cbe0e539c5867bb0349aa778e5d6b31be5d5290.svg is the non-linear function: Activation Function
  • neural_network_bd3bfa7a41e1fb4b025f266a85fe7db917d018ef.svg is the weight matrix (not an enty in on matrix)
    • So neural_network_26222c561d0f7b6496cf6656e48561c92b7aab66.svg is a neural_network_59b3a0ea34ff5c0c0cf180ee2a4d95413d8c4325.svg matrix
    • and neural_network_cec86d65e55bac3875071914543150a204845aa4.svg is a neural_network_1a16092b9c99359325982302f79fdf198272d880.svg matrix
    • and neural_network_14f455b97bd52896d7d7dda8d6f893354006f9fe.svg is a neural_network_59b3a0ea34ff5c0c0cf180ee2a4d95413d8c4325.svg matrix
  • neural_network_e3a9bd5a15aa566a3a05ba70c93970b2d360cbc1.svg are scalars – one for each neuron
  • neural_network_4c331405047e31fa129009cf7a41fc1688f2f613.svg refers to the result of the previous layer

Comparison with neurons in a real brain #

  • Neurons in a brain also get input from other neurons and as a response sends ouput to connected neurons.
  • However the innermost conditions of the neuron are to this day not well known, so our simple mathematical model is at best inspired by the real neurons.

Training the neural network #

  • Find neural_network_21d0c303da4bd236a2d4d9a73e41a7fcc4ad5b76.svg which contains all neural_network_bd3bfa7a41e1fb4b025f266a85fe7db917d018ef.svg and neural_network_e3a9bd5a15aa566a3a05ba70c93970b2d360cbc1.svg to minimize the loss function
  • Do this by for example with Backpropagation to do a Gradient Descent over the Loss Function
  • There are many optimization methods, however
  • Since the core of each neuron is a dot product, there are are usually multiple weights that would produce the same result. Use Regularization to find weights that help preventing Overfitting .

Debugging neural networks #

  • Try to Overfit the network first. If the network can’t overfit on small amount of data, it might not be complex enough
  • Visualize
Calendar October 22, 2023