Activation in Neural Networks
Activation in a neural network is a crucial concept that refers to the output of a neuron after applying an activation function to the weighted sum of its inputs plus a bias. This process determines whether a neuron should be 'activated' or not, thereby influencing the final output of the network.
Understanding Activation
The activation of a neuron is essentially a number that represents an intermediate yes-or-no answer on the way to solving a classification problem. It is calculated based on a linear combination of the activations of all neurons in the previous layer, which is then passed through an activation function, such as the sigmoid function. This is illustrated in the following example:
Example of Activation Calculation
An example of activation calculation is given by the formula:
[ a_{11} = \sigma(w_{111} \cdot a_{10} + w_{122} \cdot a_{20} + w_{133} \cdot a_{30} + b_{11}) ]
where:
- (\sigma) is the sigmoid function,
- (w) are weights,
- (a) are activations, and
- (b) is the bias.
This formula shows how the activation of a neuron is computed using the weighted sum of inputs plus a bias, followed by the application of an activation function.
Calculating Activations
Calculating activations involves determining the output of each neuron in a neural network based on the inputs and the weights and biases associated with the connections. This process can be efficiently performed using matrix notation, which allows for the computation of activations across layers through matrix multiplication and vector addition.
Matrix Notation
In matrix notation, the weights and biases of a neural network are represented as matrices, simplifying the computation of activations for an entire layer at once. This approach is particularly useful for deep networks with many layers and neurons.
Visualizing Activation
The concept of activation can be visualized as a mathematical function, where different neurons have varying levels of activation. This is akin to the brighter or darker areas of a brain scan, as depicted in the following figure:
Figure 16.2 Picturing neuron activation as a mathematical function, where a1 , a2 , a3 , and a4 are the activation values applied to the function f.
Activation in Multi-Layer Perceptrons (MLP)
In a multi-layer perceptron (MLP), activations are calculated for each neuron in the network. The following figure provides an example of an MLP with all activations calculated:
Figure 16.12 An example of an MLP with all activations calculated
Specific Example in MLP
To focus on a specific example, consider the activation (a_{11}) in an MLP, which depends on the three input layer activations: (a_{10}), (a_{20}), and (a_{30}). The function giving (a_{11}) is a linear function of these inputs (including a constant) passed into a sigmoid function. This is represented in the following figure:
Figure 16.13 The general form of the function to calculate a11as a function of the input layer activations
In this context, the variables (A), (B), (C), and (D) need to be tuned to make (a_{11}) respond appropriately to inputs. The neurons in the middle of the network effectively break the overall classification problem into smaller yes-or-no classifications, using logistic functions to make decisions about the inputs.
FAQ (Frequently asked questions)
What is activation in a neural network?
How does activation influence a neural network?
What does Figure 16.12 illustrate in the context of neural networks?
How is activation calculated in a neural network?
What function is used in the example of activation calculation?
What does calculating activations involve in a neural network?
What function is typically used to compute the activation of a neuron?
How are activations calculated in matrix notation?
What is the advantage of using matrix notation for calculating activations?
What does the activation of a neuron represent in a neural network?
How is the activation of a neuron calculated?
What are activations in neural networks?
Why are activations important in neural networks?
What is the purpose of activation functions in neural networks?
What are some common activation functions used in neural networks?
What is GELU in neural networks?