Unit 2-stu-RG
Unit 2-stu-RG
Fundamental concepts of Neural Networks: Neural networks are a type of machine learning
model inspired by the structure and function of the human brain. They consist of interconnected
nodes, called neurons, organized into layers. Each neuron receives input, processes it, and
produces an output. The connections between neurons have associated weights that determine
the strength of the signal transmitted between them. Neural networks learn by adjusting these
weights based on input data and desired output.
Artificial neuron model: Figure below shows artificial neuron model. Here, x 1, x 2, x 3, ..., xn
are the n inputs to the artificial neuron. w 1, w 2, ... ,wn are the weights attached to the input links.
The weights are real numbers that represent the strength of the connections between neurons.
The larger the weight, the stronger the connection. Hence the total input received by the soma of
the artificial neuron is the sum of the inputs multiplied by their corresponding weights.To
generate the final output y, the weighted input sum is passed onto a non-linear filter called
activation function which releases the output
This activation function introduces non-linearity to the model, allowing the neural network to
capture complex patterns and relationships in the data.
Commonly used activation functions include tanh , ReLU, sigmoid, signum, and softmax,
depending on the specific task and network architecture.
Basic models of Neural Networks (or Architectures of ANN): Artificial Neural networks are
computational models inspired by the structure and function of the human brain. Basic models of
Neural Networks are
4. Modular network
Single Layer Feedforward Network: It is also known as the Perceptron. It consists of an input
layer and an output layer, with no hidden layers. The input layer is the first layer of the neural
network and is responsible for receiving the input data. Each node (artificial neuron) in the input
layer represents a feature or attribute of the input data. The number of nodes in the input layer is
determined by the number of input features.The output layer is the final year which is
responsible for producing the network's outputs or predictions. The synaptic links carrying the
weights connect every input neuron to the output neuron but not vice-versa.
Despite the two layers, the network is termed single layer since it is the output layer, alone which
performs computation. The input layer merely transmits the signals to the output layer. Hence,
the name single layer feedforward network. Figure 2.8 illustrates an example network.
Perceptrons are limited to solving linearly separable problems and have relatively limited
learning capabilities.
Multilayer Feedforward Network: It is also known as a Multi-Layer Perceptron (MLP). It
consists of an input layer, one or more hidden layers, and an output layer. Each node in a hidden
layer is connected to every node in the preceding and succeeding layers through weighted
connections as shown in figure below. Information flows in a single direction, from the input to
the output layer, without any feedback loops. The hidden layer aids in performing useful
intermediary computations before directing the input to the output layer.The introduction of
hidden layers and non-linear activation functions allows MLPs to learn complex patterns and
solve more intricate problems. Backpropagation is commonly used to train these networks.
The basic structure of an RNN consists of an input layer, a hidden layer, and an output layer. The
hidden layer contains a set of neurons with a feedback connection that allows them to pass
information from one time step to the next.
The diagram above shows the basic structure of an RNN. The input is fed into the RNN at time
step xt, and the hidden state ht-1 from the previous time step is fed back into the RNN. The output
y(t) is a function of the hidden state at time step t and can be fed into another layer or used as the
final output.
The main and most important feature of RNN is its Hidden state, which remembers some
information about a sequence. The state is also referred to as Memory State since it remembers
the previous input to the network. It uses the same parameters for each input as it performs the
same task on all the inputs or hidden layers to produce the output. This reduces the complexity of
parameters, unlike other neural networks.
• One of the challenges of training RNNs is the vanishing gradient problem, which occurs
when the gradient signal becomes too small to be useful during training.
• To address this problem, several variants of RNNs have been developed, such as Long
Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) networks. These
networks use additional memory cells and gating mechanisms to better control the flow
of information through the network.
Fig shows a block diagram of a modular neural network (MNN) for image recognition. The
MNN consists of Module 1, Module 2 ---- Module Z, and gating network.
The input image is first divided into two sub-images. The first sub-image is processed by Module
1, and the second sub-image is processed by Module 2. The outputs of the two modules are then
combined by the gating network to produce a final classification.
The gating network is a neural network that decides which module to use for each input image.
The gating network takes the outputs of the two modules as input and outputs a single value,
which represents the probability that the first module should be used.
Learning rules in Neural Networks: Artificial Neural Networks (ANNs) learn from data using
learning rules or algorithms that adjust the weights and biases of the network's connections.
These rules enable the network to gradually improve its performance on a given task.
(or)
Learning rules are a set of instructions that tell an artificial neural network (ANN) how to adjust
its weights and biases to improve its performance.
Learning rules can be categorized into two broad categories based on their underlying
mechanisms and goals:
1. Error correction learning rules are primarily used in supervised learning, where the
network aims to minimize the error between predicted and actual output. Key learning
rules in this category include:
• Gradient Descent: Calculates the gradient of the error (loss) function with respect to the
network's weights and updates weights in the opposite direction to reduce the error.
Variants include batch, stochastic, and mini-batch gradient descent.
• Least Mean Squares (LMS): A straightforward error correction rule that updates
weights in the direction of the error, commonly used in linear regression.
• Stochastic: Stochastic learning rules use a random process to update the weights of the
neural network. This type of learning rule is often used for classification problems
• Competitive Learning: Neurons compete based on input, often used for clustering and
feature extraction.
Training or learning methods for Neural Networks can be broadly classified into three basic
types:
1. Supervised
2. unsupervised
3. Reinforced
In neural networks, supervised learning works by adjusting the weights and biases of the
neurons in the network based on the error between the predicted output and the actual output.
This process is repeated many times until the error is minimized and the network can
accurately predict the output for new data.
2. Regression is the task of predicting a continuous output, such as the price of a house.
Unsupervised learning: Unsupervised learning is a type of machine learning where the model is
not given any labeled data. This means that the model does not know what the correct output
should be. The model must then find patterns in the data on its own.
There are two main types of unsupervised learning: Clustering and Dimensionality reduction.
1. Clustering is the process of grouping similar data points together based on their features.
For example, in customer segmentation, clustering can be used to group customers with
similar buying patterns together.
• Load Forecasting: Neural networks can predict future electricity demand based on
historical usage patterns, weather conditions, and other relevant factors. Accurate load
forecasting helps power companies optimize generation and distribution resources.
• Economic dispatch: Neural networks can be trained to find the optimal set of power
plants to operate in order to meet the demand for electricity at the lowest cost. This can
help to reduce the cost of electricity generation.
• Fault Detection and Diagnosis: Neural networks can analyze power system data to
detect faults, anomalies, or equipment failures. They can learn normal operating patterns
and identify deviations, enabling quicker detection and timely maintenance.
• Voltage and Frequency Control: Neural networks can help in maintaining stable
voltage and frequency levels in power grids by predicting potential issues and suggesting
control strategies.
• Renewable Energy Forecasting: For systems with renewable energy sources like solar
and wind, neural networks can predict power output based on weather conditions,
enabling better integration into the grid.
• Power Quality Improvement: Neural networks can analyze power quality data and
suggest corrective measures to mitigate issues like harmonics, voltage sags, and flicker.
• Energy Theft Detection: Neural networks can detect abnormal usage patterns that might
indicate energy theft, helping utilities identify and prevent unauthorized usage.
• Market Price Prediction: Neural networks can predict electricity market prices by
analyzing historical pricing data and considering factors like supply-demand dynamics
and fuel prices.
Short questions
2.What are the basic models of neural networks, and how do they differ?
The basic models of neural networks include the perceptron model for single-layer networks and
the multi-layer perceptron (MLP) model for multi-layer feedforward networks. The perceptron is
limited to solving linearly separable problems, while the MLP, with hidden layers and non-linear
activation functions, can handle complex, non-linear problems.
4.How do single layer and multi-layer feedforward and feedback networks differ?
Single-layer feedforward networks consist of one layer of neurons with no feedback connections,
making them suitable for simple tasks. In contrast, multi-layer feedforward networks, with
hidden layers, can handle more complex problems. Feedback networks, such as recurrent neural
networks, have connections that loop back, enabling memory and temporal processing.
5. What are the differences between supervised and unsupervised training methods in neural
networks?
Supervised training involves providing labeled data (input-output pairs) to the network to learn
from, while unsupervised training uses unlabeled data to uncover patterns and relationships
without explicit output targets.
a) Activation function
b) Backpropagation
c) Neuron
d) Tensor
a) It contains one hidden layer between the input and output layers.
c) It has feedback connections from the output layer to the input layer.
3. The learning rule commonly used in training feed-forward neural networks is:
a) Hebbian learning
c) Reinforcement learning
d) Genetic algorithm
a) Unsupervised learning
b) Reinforcement learning
c) Supervised learning
d) Semi-supervised learning
c) Simplicity in design.
9. Which learning rule enables a neural network to adjust its weights based on the difference
between its output and the desired output?
a) Hebbian learning
b) Competitive learning
d) Backpropagation
Answers:
1. d) 2. d) 3. b) 4. b) 5. c) 6. b) 7. a) 8. b) 9. d) 10. b)
Long Questions