All Exams Test series for 1 year @ ₹349 only
Question

Consider the following table defining the sample inputs and corresponding target values for a perceptron model.
 

Sample Nox1x2targetw1w2
S100000
S2011  
S3101  
S4111  


What shall be the value of updated weights after applying all the samples S1 to S4 (in the order S1, S2, S3, S4) to this model. Given that the initial weights w1=0, w2=0, learning rate =0.1 and no bias is involved in the perceptron. The activation function for this perceptron is given below
$y_{observed} = \{ \begin{matrix} 1 & \text{if } y_{in} > 0 \\ 0 & \text{if } y_{in} < 0 \end{matrix}$

The correct answer is
w1=0.1, w2 = 0.1

Perceptron Weights Update Calculation

This solution details the step-by-step process of calculating the updated weights for a perceptron model using the provided input samples and learning parameters. We will apply the perceptron learning rule iteratively.

Perceptron Model Setup

The perceptron model is defined with the following initial parameters:

  • Initial Weights: $w_1 = 0.0$, $w_2 = 0.0$
  • Learning Rate ($\eta$): $0.1$
  • Bias: The model does not involve a bias term.
  • Activation Function: The activation function determines the observed output ($y_{observed}$) based on the net input ($y_{in}$): $y_{observed} = \begin{cases} 1 & \text{if } y_{in} \gt 0 \\ 0 & \text{if } y_{in} \lt 0 \end{cases}$

Training Data

The following table shows the sample inputs ($x_1, x_2$) and their corresponding target values ($t$):

Sample $x_1$ $x_2$ Target ($t$)
S1 0 0 0
S2 0 1 1
S3 1 0 1
S4 1 1 1

Applying the Perceptron Learning Rule

We will now iterate through each sample (S1, S2, S3, S4) and update the weights ($w_1, w_2$) if the predicted output does not match the target.

Processing Sample S1

  • Inputs ($x_1, x_2$): $(0, 0)$
  • Target ($t$): $0$
  • Current Weights ($w_1, w_2$): $(0.0, 0.0)$
  • Calculate Net Input ($y_{in}$): $y_{in} = w_1 x_1 + w_2 x_2 = (0.0 \times 0) + (0.0 \times 0) = 0$
  • Determine Observed Output ($y_{observed}$): Based on the activation function, since $y_{in} = 0$, $y_{observed} = 0$.
  • Calculate Error: $error = t - y_{observed} = 0 - 0 = 0$
  • Update Weights: The error is 0. No update is needed. $w_1 = 0.0$ $w_2 = 0.0$
  • Weights after S1: $w_1 = 0.0, w_2 = 0.0$

Processing Sample S2

  • Inputs ($x_1, x_2$): $(0, 1)$
  • Target ($t$): $1$
  • Current Weights ($w_1, w_2$): $(0.0, 0.0)$
  • Calculate Net Input ($y_{in}$): $y_{in} = w_1 x_1 + w_2 x_2 = (0.0 \times 0) + (0.0 \times 1) = 0$
  • Determine Observed Output ($y_{observed}$): Since $y_{in} = 0$, $y_{observed} = 0$.
  • Calculate Error: $error = t - y_{observed} = 1 - 0 = 1$
  • Update Weights: The error is non-zero. Apply the update rule: $\Delta w_1 = \eta \cdot error \cdot x_1 = 0.1 \times 1 \times 0 = 0.0$ $\Delta w_2 = \eta \cdot error \cdot x_2 = 0.1 \times 1 \times 1 = 0.1$ New weights: $w_1 = w_1 + \Delta w_1 = 0.0 + 0.0 = 0.0$ $w_2 = w_2 + \Delta w_2 = 0.0 + 0.1 = 0.1$
  • Weights after S2: $w_1 = 0.0, w_2 = 0.1$

Processing Sample S3

  • Inputs ($x_1, x_2$): $(1, 0)$
  • Target ($t$): $1$
  • Current Weights ($w_1, w_2$): $(0.0, 0.1)$
  • Calculate Net Input ($y_{in}$): $y_{in} = w_1 x_1 + w_2 x_2 = (0.0 \times 1) + (0.1 \times 0) = 0$
  • Determine Observed Output ($y_{observed}$): Since $y_{in} = 0$, $y_{observed} = 0$.
  • Calculate Error: $error = t - y_{observed} = 1 - 0 = 1$
  • Update Weights: The error is non-zero. Apply the update rule: $\Delta w_1 = \eta \cdot error \cdot x_1 = 0.1 \times 1 \times 1 = 0.1$ $\Delta w_2 = \eta \cdot error \cdot x_2 = 0.1 \times 1 \times 0 = 0.0$ New weights: $w_1 = w_1 + \Delta w_1 = 0.0 + 0.1 = 0.1$ $w_2 = w_2 + \Delta w_2 = 0.1 + 0.0 = 0.1$
  • Weights after S3: $w_1 = 0.1, w_2 = 0.1$

Processing Sample S4

  • Inputs ($x_1, x_2$): $(1, 1)$
  • Target ($t$): $1$
  • Current Weights ($w_1, w_2$): $(0.1, 0.1)$
  • Calculate Net Input ($y_{in}$): $y_{in} = w_1 x_1 + w_2 x_2 = (0.1 \times 1) + (0.1 \times 1) = 0.1 + 0.1 = 0.2$
  • Determine Observed Output ($y_{observed}$): Since $y_{in} = 0.2 \gt 0$, $y_{observed} = 1$.
  • Calculate Error: $error = t - y_{observed} = 1 - 1 = 0$
  • Update Weights: The error is 0. No update is needed. $w_1 = 0.1$ $w_2 = 0.1$
  • Weights after S4: $w_1 = 0.1, w_2 = 0.1$

Conclusion

After applying the perceptron learning algorithm to all the samples sequentially (S1, S2, S3, S4), the final updated weights are $w_1 = 0.1$ and $w_2 = 0.1$.

Was this answer helpful?

Important Questions from Artificial Neural Network

  1. In a feed forward neural network with the following specifications:

    Input layer has 4 neurons, hidden layer has 3 neurons and output layer has 2 neurons using the sigmoid activation function for given input values [0.5, 0.8, 0.2, 0.6] as well as the initial weights for the connections.

    W1: [0.1, 0.3, 0.5, 0.2]

    W2: [0.2, 0.4, 0.6, 0.2] Input layer to hidden layer weights

    W3: [0.3, 0.5, 0.7, 0.2]

    W4: [0.4, 0.1, 0.3]

    W5: [0.5, 0.2, 0.4] Hidden layer to output layer weights

    What is the output of the output layer when the given input values are passed through neural network? Round the answer to two decimal places :

  2. Given that $\eta$ refers to learning rate and $x_i$ refers to the $i^{th}$ input to the neuron, Which of the followings most suitably describes the weight updation rule of a Kohonen SOM? (where 'j' refers to the $j^{th}$ neuron in the lattice)

  3. In a multilayer perceptron, an error signal originates at an output neuron of the network and propagates ___________ through the network.

  4. Which of the following is true about discrete hopfield network ?
    (i) may be modified to a continuous model
    (ii) can be used for associative memory problems
    (iii) nodes of the network have a continuous graded output
    (iv) energy of the network increases continuously with time
  5. Consider the two class classification task that consists of the following points :

    Class \(C_{1}\) : [-1, -1], [-1, 1], [1, -1]

    Class \(C_{2}\) : [1, 1]

    The decision boundary between the two classes \(C_{1}\) and \(C_{2}\) using single perceptron is given by :

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App