Difference between revisions of "Neural Networks"
Jump to navigation
Jump to search
| Line 27: | Line 27: | ||
:: <math>\sigma(z) = \dfrac{1}{1 + e^{-z}} </math> | :: <math>\sigma(z) = \dfrac{1}{1 + e^{-z}} </math> | ||
* Softmax: used instead of sigmoid for multiclass output problems | * Softmax: used instead of sigmoid for multiclass output problems | ||
| − | :: <math> \sigma(x_j) = \dfrac{e^x_j}{\sum_i e^{x_i}} </math> | + | :: <math> \sigma(x_j) = \dfrac{e^{x_j}}{\sum_i e^{x_i}} </math> |
Revision as of 22:51, 1 March 2021
Basics
- simplest unit is the perceptron. It outputs a weighted sum of inputs and passes it through an binary activation function
- Feedforward: [math]\displaystyle{ \hat{y} = \text{activation} (\sum x_i \cdot w_i + b) }[/math]
- Calculate the error, [math]\displaystyle{ y - \bar{y} }[/math]
- Update the weight vector. Repeat 1-3
- MLPs
- Multilayer Perceptrons
Most basic neural network architecture
- Input layer containing the feature vector
- Hidden Layers take the input from one layer and output the input to another layer
- Weight connections between nodes reflect relative importance (graph theory: edges connect nodes)
- Output layer may be a classifier or a regressor. The activation function determines the type of output
Common Parameters
- number of hidden layers
- activation function (ReLU, softmax, sigmoid)
- error function: usually MSE for regression, cross-entropy for classification
- optimizer: finds optimal weights. Batch, mini-batch and stochastic gradient descent are common. Adam and RMSprop also popular
- batch size: number of sub-samples given to the network before parameters start to be updated. Start with 32.
- number of epochs: number of times entire training set is pass through the network
- learning rate: too small converges to 0 (in infinite time) but overfits, too big accelerates learning but won't necessarily find the minimum error
Activation Functions
- Linear transfer: passes signal through unchanged
- (Heaviside) Step function: usually used for classification since output is 0 or 1
- Sigmoid/logistic: usually used to predict probabilities (in logistic regression). More flexible version of step function
- [math]\displaystyle{ \sigma(z) = \dfrac{1}{1 + e^{-z}} }[/math]
- Softmax: used instead of sigmoid for multiclass output problems
- [math]\displaystyle{ \sigma(x_j) = \dfrac{e^{x_j}}{\sum_i e^{x_i}} }[/math]