CHAP 9 : Artificial Neural Networks Flashcards
What are the parts associated with a neuron in an Artificial Neural Network (ANN)?
- SET of input values
- Weights
- Bias, X0 = 1
- Activation function
- One output
What is an activation function?
It is a threshold function that maps output to class 0 if it is under a certain threshold; and 1 if it is over or equal to the threshold
What is the purpose of activation functions?
Activation function helps to solve complex non-linear models
- without activation function, neuron can only learn linear models –> summation of WiXi (weight * input features)
- however, in reality, alot of data is complex and non-linear
[An activation function allows the neural network to model complex non-linear relationships between the input and output variables. It takes the weighted sum of the inputs and biases and applies a non-linear function to the result, producing the output of the neuron. The output of the activation function becomes the input to the next layer of neurons in the neural network.]
What are the 4 commonly used activation functions?
write out the equations (refer to notes)
- Step function (binary step function)
- Sigmoid function
- ReLu – rectified linear units
- Leaky ReLu
What is a perceptron?
A perceptron is a type of artificial neural network that is used for binary classification tasks. It consists of a single layer of artificial neurons. (one neuron)
- NOTE : In lecture notes, perceptron model given is just a single neuron which gives a single output but there is multiple neuron perceptron (aka NN)
[In the case of a multi-neuron perceptron, the output of each neuron is still determined by a weighted sum of the input features, followed by an activation function. However, instead of having a single output value, the multi-neuron perceptron has multiple output values, each corresponding to a different class or category.]
What does a perceptron do?
It takes a vector of real-valued inputs,
calculates a linear combination of these inputs,
and outputs a 1 if result is greater than a threshold and 0 otherwise
** Can only model linear data (linear decision boundary, OR or AND logic gate but not XOR) –> thus for non-linear data, NN is needed
What does an output 0 and input 1 mean for a neuron?
Output 0 : negative ;; output 1 : positive
Output 0 means a neuron will not get activated (or fired), and output 1 means that a neuron will be activated.
What is the purpose of bias in neural network?
- The purpose of a bias term is to allow the activation function to be shifted to the left and right along the x-axis/ up or down along the y-axis, which can be useful for improving the performance of the neural network.
Without a bias term, the output of the activation function would always be centered around zero, which could limit the representational power of the neural network.
** See notes on illustration of diagram
What is the purpose of a decision boundary?
to separate the data into different classes or categories.
- A decision boundary is a boundary or surface in the input feature space that separates the different classes of data points.
During training, the algorithm adjusts the weights and biases of the model to optimize the decision boundary so that it can accurately classify the input data. True or False?
True.
What happens to the decision boundary when there is overfitting?
How does it affect the performance of the model in classifying test data?
- can lead to a decision boundary that is too complex and wiggly, which fits the training data very well but does not generalize well to new data.
- the decision boundary might not be able to separate the classes of new data points correctly, leading to poor performance on the test data.
How is the perceptron trained?
The weights are adjusted based on the expected output and actual output, using gradient descent algorithm (dont need to know the details)
- What are 3 benefits of using a perceptron over logisitic regression for binary classification?
- Perceptron is a simpler model
- It uses linear classifier that directly classifies data points based on their feature value
- Logistic regression conducts non-linear transformation on input data, making it more complex.
- Perceptron has faster computations
- only requires dot product and comparison operation to classify point ;; LR requires complex calcs (logistic fn, gradients)
3.Perceptron is robust (resistant) to outliers
- It updates weights based on misclassified points;; while LR can be sensitive to outliers since it tries to minimise error
- Give an example of a binary classification task that is not linearly separable. Draw out the decision boundary.
XOR logic gate
- XOR, aka exclusive OR, gives true when number if positive outputs (class 1) is odd
See notes for decision boundary
What are 4 steps in feed forward process in neural networks? (in general for the whole network, not for the neuron)
- Get labelled training data
- Plug data into input layer
- Compute values for hidden layer using input layer and weights
- Compute values for output layer using hidden layer as input and weights