AyushChokhani AI Asiignment 2
AyushChokhani AI Asiignment 2
AI TECHNIQUES
ASSIGNMENT 2
Submitted By - Submitted To -
The deep neural network above contains an input layer, a hidden layer, and an output
layer. It contains two inputs (x1 and x2), three hidden units (nodes)(ℎ1,ℎ2, and ℎ3), and
two outputs (y1 and y2).
This section introduces key concepts and formulas to understand the more complex
backpropagation computations below.
The sigmoid (logistic function) is one of the most common non-linearities. We represent it
using the following equation.
σ(x)=1/1+e^−x
σ′(x)=σ(x) (1−σ(x))
The sigmoid activation function transforms the input values to obtain a new vector with
values comprising the next layer.
We obtain this by calculating the sum of the squared differences between the outputs y and
the targets t. Its mathematical expression is the following:
f(x) = xw + b
where:
x – input
w – coefficient (weight)
b – intercept (bias)
Here, we’ll use a for the linear combination before activation, where:
a(1)=xw+b(1) and
a(2)=hu+b(2)
With this notation, the output y equals the activated linear combination. Since we cannot
exhaust all activation and loss functions, we focus on the most common
ones: sigmoid activation and L2-norm loss. Therefore, for the output layer, we have
y=σ(a(2)) while for the hidden layer we obtain h=σ(a(1)).
u←u−η∇uL(u)
Let's take a single weight uij. The partial derivative of the loss w.r.t. uij equals:))
Where:
i corresponds to the previous layer (input layer for this transformation) and
∂L/∂yj = (yj−tj)
∂a(2)j/∂uij = hi
replacing the partial derivatives in the expression above, we get:
∂L/∂uij = ∂L/∂yj ∂yj/∂a(2)j ∂a(2)j/∂uij = (yj−tj) yj (1−yj) hi = δjhi
Therefore, we obtain the update rule for a single weight for the output layer using the
following:
uij←uij−η δj hi
Similarly to the backpropagation of the output layer, the update rule for a single
weight, wij, is the following:
We use the sigmoid activation and linear model formulas to obtain the following:
=(y1−t1)y1(1−y1)u11+(y2−t2)y2(1−y2)u12
Now, we can calculate ∂L/∂w11, which was the only missing part of the update rule for the
hidden layer. The final expression is:
Backpropagation Generalization
We combine the backpropagation for the output and the hidden layers to obtain the general
backpropagation formula with the L2-norm loss and sigmoid activations.
∂L/∂wij = δj xi
where for a hidden layer:
Solution:
Activation functions play a crucial role in artificial neural networks by introducing
non-linearity into the model. They help neural networks approximate complex, non-linear
relationships in the data. In this explanation, we will discuss some common activation
functions, their mathematical modelling, and their characteristics.
1. Step Function:
- Mathematical Model:
f(x) = 1, if x > 0
f(x) = 0, if x <= 0
- Characteristics:
- Output is binary: 1 or 0.
- Discontinuous and non-differentiable at x = 0.
- Mainly used in binary classification tasks.
2. Sigmoid Function:
- Mathematical Model:
f(x) = 1 / (1 + e^(-x))
- Characteristics:
- Output is in the range (0, 1).
- Smooth, continuous, and differentiable.
- Has a problem of vanishing gradients for extreme input values.
- Commonly used in the output layer for binary classification tasks.
5. Leaky ReLU:
- Mathematical Model:
f(x) = x, if x > 0
f(x) = αx, if x <= 0
(α is a small positive constant)
- Characteristics:
- Similar to ReLU but allows a small gradient for x < 0.
- Mitigates the dying ReLU problem.
- Commonly used in deep neural networks.
Each activation function has its own characteristics and is suitable for different scenarios.
Choosing the right activation function depends on the specific problem, network
architecture, and the challenges of training. It's common to experiment with different
activation functions to find the one that works best for a given task.
1. Predictive Maintenance:
- AI models, particularly machine learning algorithms, can analyse historical data from
transmission lines, such as voltage, current, temperature, and weather conditions.
- These models can predict when a component, such as an insulator or conductor, is
likely to fail by identifying patterns and anomalies in the data.
- Early detection of potential faults allows utilities to schedule maintenance or repairs,
minimising downtime and reducing the risk of catastrophic failures.
2. Real-time Monitoring:
- AI systems can continuously monitor transmission lines in real-time, using sensors and
IoT devices.
- Machine learning models process data from these sensors to detect any unusual
behaviour or deviations from normal operating conditions.
- When irregularities are detected, automated alerts can be generated, allowing operators
to take immediate action.
8. Continuous Learning:
- AI systems can adapt and learn from new data, improving their fault detection accuracy
over time.
- Ongoing machine learning ensures that the system remains effective in identifying
emerging fault patterns.
Question 4. Write steps for designing a Fuzzy logic based voltage controller for a
synchronous generator?
Solution.
Designing a Fuzzy Logic-Based Voltage Controller for a Synchronous Generator involves
several steps to ensure that the controller effectively maintains the generator's voltage
within the desired range. Here are the steps for designing such a controller:
1. Problem Formulation:
- Define the problem and the control objectives. In this case, the objective is to maintain
the output voltage of the synchronous generator within specified limits under varying load
conditions and disturbances.
2. System Modelling:
- Develop a mathematical model of the synchronous generator. This model should
include the generator's dynamics and its response to changes in load and disturbances. The
generator model typically includes the field voltage, rotor angle, and electrical equations
governing the system.
6. Controller Integration:
- Integrate the fuzzy logic-based voltage controller into the generator's excitation system.
Ensure that the controller can accept input signals such as load deviation and generator
voltage error and provide control signals to the excitation system.
8. Hardware Implementation:
- Once the controller design is validated through simulation, implement it in the physical
synchronous generator system. This may involve programming a microcontroller or digital
signal processor to execute the controller algorithm.
11. Documentation:
- Document the design process, controller parameters, and test results for future
reference and troubleshooting.
2. Controller Parameters:
- The PI controller has two main parameters: proportional gain (Kp) and integral gain
(Ki). These gains are the target outputs of the neural network. The network learns to
predict the optimal values of Kp and Ki for the given input conditions.
3. Data Collection:
- Data is collected during the normal operation of the control system. This data includes
the control error (the difference between the reference and the process variable), the
integral of the error (cumulative error over time), and any other relevant process variables.
The data also includes the current values of Kp and Ki. This data is used to train the neural
network.
5. Real-time Control:
- During normal control operation, the neural network takes the current error and integral
of error as input and predicts the optimal Kp and Ki values. These predicted controller
parameters are used to calculate the control output signal, which is then applied to the
system.
7. Performance Evaluation:
- The controller tuner may include mechanisms to evaluate the control system's
performance, such as monitoring the setpoint tracking, response time, and steady-state
error. If the performance does not meet the desired criteria, the neural network continues to
adapt its predictions to optimise the control parameters.
the PI controller parameters in real-time, ensuring efficient and stable control of the
system, even in the presence of disturbances or variations in the controlled process. It
leverages machine learning and neural networks to continually improve control
performance without the need for manual parameter tuning.