49275 NEURAL NETWORKS AND FUZZY LOGIC (Autumn 2025)
ASSIGNMENT 1
QUESTION ONE [50 marks]
Two perceptron classifiers are trained to recognise the following classification of eight patterns x with known class membership d.
Q1.1 [Discrete Perceptron Training] [25 marks]
The first classifier is a discrete perceptron as shown in Figure Q1.1. Assign “+1” to all augmented inputs. For the training task of this classifier, the learning constant is η =0.05 and the discrete perceptron learning rule is used. The initial weight vector
Assuming that the above training set may need to be recycled if necessary,
i) Calculate the final weight vector w81
after 10 cycles. (A simulation code needs to be included)
ii) Demonstrate that the final weight vector in (i) correctly classifies the entire training set.
iii) Plot the pattern error curve and the cycle error curve for 10 cycles (80 steps). Comments both curves.
iv) Change the learning constant to 0.2 (η =0.2) and create a plot of the cycle error curve. Compare this curve with the one presented in (iii), and provide a discussion on the differences observed.
Note: The following formulae may be used to calculate the pattern error curve and the cycle error curve. There are 8 patterns in this question, i.e. P=8.
Pattern error:
Cycle error:
Figure Q1.1 Discrete Perceptron Classifier Training
Q1.2 [Continuous Perceptron Training] [25 marks]
The second classifier is a continuous perceptron with a bipolar logistic activation function
as shown in Figure Q1.2. Assign “−1” to all augmented inputs. For the training task of this classifier, the delta learning rule is used with an arbitrary selection of learning constant η = 0.2 with the same initial weight vector w1
in Question 1.1.
Assuming that the above training set may need to be recycled if necessary,
i) Calculate the weight vector w9
after one cycle and the weight vector w161
after 20 cycles. (A simulation code needs to be included)
ii) Obtain the cycle error at the end of each cycle and plot the cycle error curve. How would the weight vectors w9
and w161
classify the entire training set? Discuss your results.
iii) Change the learning constant to 0.6 (η =0.6) and create a plot of the cycle error curve. Compare this curve with the one presented in (ii), and provide a discussion on the differences observed.
iv) Provide a solution that can be implemented to achieve a classification error of zero after training.
Figure Q1.2 Continuous Perceptron Classifier Training
QUESTION TWO [50 marks]
Inverted Pendulum System
The inverted pendulum system shown in Figure Q2.1 consists of a pole and a trolley on which the pole is hinged. The trolley moves on the rail tracks to its right or left, depending on the force exerted on the trolley. The control goal is to balance the pole starting from nonzero conditions by applying appropriate force to the trolley.
Our control goal here is to balance the pole without regard to the trolley position and velocity, with x1
= θ and x2
= θ as the angular displacement and angular velocity of the pole. The relevant equation of motion is given by
Assume that trolley mass mc = 1.0 kg, pole mass m = 0.1 kg, half-length of pole l = 0.5 m, gravity acceleration g = 9.81m/s and F is the applied force in Newtons. From the above equation of motion, the state equations of this inverted pendulum system can be derived as
where
Assuming that the sampling time T = 0.02 sec, and using backward difference discretisation, the dynamics of the inverted pendulum system can be approximated by
The task here is to design a control system, whose inputs are x1∈[−0.2,0.2] rad, x2∈[−1.0, 1.0] rad/s, and whose output is F∈[−10, 10] N such that the final states will be x1=0 and x2=0.
Fuzzy logic is required for the control of this inverted pendulum system. In this simple fuzzy logic controller, a set of linguistic variables is chosen to represent 5 degrees of angular position x1 [−0.2, −0.1, 0, 0.1, 0.2], 5 degrees of angular velocity x2 [−1.0, −0.5, 0, 0.5, 1.0], and 5 degrees of control force F [−10, −5, 0, 5, 10] as shown in Figure Q2.2. The generic rule set in the form. of “Fuzzy Associate Memories” is shown in Figure Q2.3.
The initial states of this inverted pendulum system are given to
x1(1) = -0.05 rad and x2(1) = 0.4 rad/s.
2.1 If the Centre of Area (COA) defuzzification strategy is used with the fire strength αi of the i-th rule calculated from
i ) Determine the defuzzified control force F(1) and next state vectors [x1(2), x2(2)].
ii) Use the results of i), determine the next defuzzified control force F(2) and next state vectors [x1(3), x2(3)]. [35 marks]
2.2 If Mean of Maximum (MOM) defuzzification strategy is used with the fire strength αi
of the i-th rule calculated from
Determine the defuzzified control force F(1) and the next state vector [x1(2), x2(2)] [15 marks]
Figure Q2.1 An inverted pendulum system
Figure Q2.2 Membership functions of an inverted pendulum system
Figure Q2.3 Generic Fuzzy Associative Memories