Example Problems - NN
Example-1:
Calculate the output of a 3-input neuron with X=[0,1.0,0.5], W=[0.9,0.2,0.3] and b= -0.04.Use sigmoid activation function.Step 1: Calculate the weighted sum
The neuron first calculates:
Substituting the values:
Calculate each term:
Therefore,
Step 2: Apply the sigmoid activation function
The sigmoid function is:
For :
We know:
Therefore:
✅ Final Answer
and the neuron output is:
So, the output of the neuron using sigmoid activation is approximately
Use the following Python Code
import numpy as np# defining the Sigmoid Function
def sigmoid (x):
return 1/(1 + np.exp(-x))
# creating the input array
X=np.array([0,1.0,0.5])
W=np.array([0.9,0.2,0.3])
b=-0.04
o=np.dot(X,W)+b
sigmoutput=sigmoid(o)
print ('\n Output:',sigmoutput)
Output:
Output: 0.5768852611320463
Comments
Post a Comment