Professional Documents
Culture Documents
All Types of Numericals - ML
All Types of Numericals - ML
(/)
Login (/site/login/?next=/p/39252/all-types-of-numericals-1/)
teamques10 (/u/1/teamques
♣ 16k
2 ADD COMMENT
FOLLOW
SHARE
EDIT (/p/edit/39252/)
15k
views
1 Answer
teamques10 (/u/1/teamques
♣ 16k
Q1. For the network shown in figure, calculate the net input to the neuron?
https://www.ques10.com/p/39252/all-types-of-numericals-1/ 1/11
3/23/22, 9:14 AM All types of Numericals
yin = x1 w1 + x2 w2 + x3 w3
Q2. Calculate the net input for the network shown in figure with bias included in the network?
yin = b + x1 w1 + x2 w2
Q3. Obtain the output of the neuron Y for the network shown in the figure using activation functions as
https://www.ques10.com/p/39252/all-types-of-numericals-1/ 2/11
3/23/22, 9:14 AM All types of Numericals
Solution: The given network has three input neurons with bias and one output neuron. These form a
single layer network,
y = f (yin ) = − 1 =
−y −y
1 + e in 1 + e in
−0.53
1 − e
y = = 0.259
1 + e−0.53
Q4. Implement AND function using McCulloch-Pitts Neuron (take binary data).
https://www.ques10.com/p/39252/all-types-of-numericals-1/ 3/11
3/23/22, 9:14 AM All types of Numericals
With these assumed weights the net input is calculated for four inputs,
(i) (1, 1) − y in = x1 w1 + x2 w2 = 1 × 1 + 1 × 1 = 2
(ii) (1, 0) − y in = x1 w1 + x2 w2 = 1 × 1 + 0 × 1 = 1
(iii) (0, 1) − y in = x1 w1 + x2 w2 = 1 × 0 + 1 × 1 = 1
(iv) (0, 0) − y in = x1 w1 + x2 w2 = 0 × 1 + 0 × 1 = 0
For, AND function the output is high if both the inputs are high. For this function, the net input is
calculated as 2.
Hence, based on this input the threshold value is set, i.e., if the output value is greater than or equal to
2 then the neuron fires, else it does not fire.
So, the threshold value is set to 2 (θ = 2). This can be obtained by,
θ ≥ nw − p
∴ θ ≥ 2 × 1 − 0
⇒ θ ≥ 2
1, if yin ≥ 2
y = f (yin ) = {
0, if yin < 2
Q5. Use McCulloch-Pitts Neuron to implement AND NOT function (take binary data representation).
https://www.ques10.com/p/39252/all-types-of-numericals-1/ 4/11
3/23/22, 9:14 AM All types of Numericals
The given function gives an output only when x 1 = 1 and x 2 = 0 . The weights have to be decided
only after analysis.
θ ≥ nw − p
θ ≥ 2 × 1 − 0 ≥ 2
(i) (1, 1) − y in = x1 w1 + x2 w2 = 1 × 1 + 1 × 1 = 2
(ii) (1, 0) − y in = x1 w1 + x2 w2 = 1 × 1 + 0 × 1 = 1
(iii) (0, 1) − y in = x1 w1 + x2 w2 = 1 × 0 + 1 × 1 = 1
(iv) (0, 0) − y in = x1 w1 + x2 w2 = 0 × 1 + 0 × 1 = 0
From the calculated net input, it is possible to fire the neuron with input (1, 0) only.
Case 2:
i.e., w 1 = 1, w2 = 1
https://www.ques10.com/p/39252/all-types-of-numericals-1/ 5/11
3/23/22, 9:14 AM All types of Numericals
From the net inputs now it is possible to conclude that the neuron will only fire with input (1, 0) by
fixing the threshold θ ≥ 1.
Thus, w 1 = 1, w2 = −1; θ ≥ 1
θ ≥ nw − p
θ ≥ 2 × 1 − 1
θ ≥ 1
1, if yin ≥ 1
y = f (in ) = {
0, if yin < 1
Q6. Implement XOR function using M-P neuron. (consider Binary Data)
In this case, the output is "ON" only for odd number of 1's. For the rest it is "OFF". XOR function cannot
be represented by simple and single logic function, it is represented as
¯
¯¯¯¯ ¯
¯¯¯¯
y = x1 x2 + x1 x2
y = z1 + z2
where z 1 = x1 . x2
¯
¯¯¯¯
is the first functio,
and z 2
¯
¯¯¯¯
= x1 . x2 is the second function.
⇒ y = z1 + z2 is the third function
A single layer net is not sufficient to represent it, we require an intermediate layer. An intermediate
layer is necessary,
https://www.ques10.com/p/39252/all-types-of-numericals-1/ 6/11
3/23/22, 9:14 AM All types of Numericals
First Function: z 1
¯
¯¯
= x1 . x2
¯¯
i.e., w 11 = 1, w21 = 1
(1, 1) − yin = 1 × 1 + 1 × 1 = 2
(1, 0) − yin = 1 × 1 + 0 × 1 = 1
(0, 1) − yin = 0 × 1 + 1 × 1 = 1
(0, 0) − yin = 0 × 1 + 0 × 1 = 0
i.e., w 11 = 1, w21 = −1
https://www.ques10.com/p/39252/all-types-of-numericals-1/ 7/11
3/23/22, 9:14 AM All types of Numericals
w11 = 1, w21 = −1
∴ θ ≥ nw − p
⇒ θ ≥ 2 × 1 − 1
θ ≥ 1
Second Function: z 2
¯
¯¯¯¯
= x1 . x2
i.e., w 12 = 1, w22 = 1
(1, 1) − yin = 1 × 1 + 1 × 1 = 2
(1, 0) − yin = 1 × 1 + 0 × 1 = 1
(0, 1) − yin = 0 × 1 + 1 × 1 = 1
(0, 0) − yin = 0 × 1 + 0 × 1 = 0
https://www.ques10.com/p/39252/all-types-of-numericals-1/ 8/11
3/23/22, 9:14 AM All types of Numericals
∴ θ ≥ nw − p
⇒ θ ≥ 2 × 1 − 1
θ ≥ 1
Third Function: y = z1 or z 2
yin = z1 v 1 + z2 v 2
756
views The net input,
(0, 0) − yin = 0 × 1 + 0 × 1 = 0
(0, 1) − yin = 0 × 1 + 1 × 1 = 1
(1, 0) − yin = 1 × 1 + 0 × 1 = 1
(1, 1) − yin = 0 × 1 + 0 × 1 = 0
Therefore,
https://www.ques10.com/p/39252/all-types-of-numericals-1/ 9/11
3/23/22, 9:14 AM All types of Numericals
θ ≥ nw − p
θ ≥ 4 × 1 − 0
θ ≥ 4
Thus, the weights are obtained as following for the XOR function,
v1 = v2 = 1
ADD COMMENT
SHARE
EDIT (/p/edit/60173/)
https://www.ques10.com/p/39252/all-types-of-numericals-1/ 10/11
3/23/22, 9:14 AM All types of Numericals
https://www.ques10.com/p/39252/all-types-of-numericals-1/ 11/11