Question: Question 1. Write a computer program using Python to implement the learning algorithm or rule for (a) perceptron learning and (b) delta learning for a
Question 1.
Write a computer program using Python to implement the learning algorithm or rule for (a) perceptron learning and (b) delta learning for a single layer single neuron network with multiple inputs and single output.
Weight adjustment equation for perceptron is: Wk+1 = Wk + Wk
where W = X is change in weight, W is the weight vector, is a learning function, is a learning rate (0, 1), and X is the input vector. The initial weight W0 is given at random. You also need to define a desired error level for the training
Bias adjustment equation for the perceptron is : bk+1 = bk + bk
where bk = X0, is change in bias and X0 = 1 is the input vector for the bias. The initial weight b0 is given at random.
Question 2.
Provide a truth table for the OR gate function with three inputs. Use your perceptron learning algorithms in Q1 to train the single neuron network to realize this OR gate function for the 3-input. Your program should print the weights, bias, and outputs for each input sample or pattern.
Question 3.
Apply your 3-input OR gate function Q2 to train the neuron to realize the AND gate function using the following input samples or patterns and their corresponding target output or teacher signals:
Input data X = (0,0,-1), (0,1,-1), (1,0,-1), (1,1,-1) and Teacher T = {-1,-1,-1,1}.
Your program should print the weights of the neuron and the neuron outputs for each input pattern.
Question 4.
Extend your computer program in Q1 above to implement the perceptron learning for a single-layer multiple-neuron network with multiple inputs and each neuron giving a single output. Test your network for the case of three neurons in the layer with three inputs. Assume the input samples and the target for each input sample are as follows: X = (x1, x2, x3) = (10, 2, -1), (5, -5, -1), (2, -5, -1) and the target signals T = (t1, t2, t3) = (1, -1, -1), (-1, -1, 1), (-1, 1, -1). Your program should print the weights of the neuron and the neuron outputs for each input pattern.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
