NN Part1
NN Part1
NN Part1
Lida Aleksanyan
Biological Neurons
Biological neuron vs Artificial neuron
It is believed that neurons are
arranged in a hierarchical
fashion and each layer has its
own role and responsibility.
To detect a face, the brain
could be relying on the entire
network and not on a single
layer.
McCulloch-Pitts Neuron
The first computational
model of a neuron was
proposed by Warren
MuCulloch (neuroscientist)
and Walter Pitts (logician)
in 1943.
Example: watch a random football game or not on TV?
inputs are all boolean i.e., {0,1}
output variable is also boolean {0: Will watch it, 1: Won’t watch it}
● x_1 could be isPremierLeagueOn (I like Premier League more)
● x_2 could be isItAFriendlyGame (I tend to care less about the
friendlies)
● x_3 could be isNotHome (Can’t watch it when I’m outside)
and so on.
An AND function neuron would only fire when When will OR function neuron fire?
ALL the inputs are ON i.e., g(x) ≥ 3 here.
When will NOR function neuron fire? When will NOT function neuron fire?
Why did we put here threshold 1?
● Whenever x_2 is 1, the output will be 0.
● x_1 AND !x_2 would output 1 only when x_1 is 1 and x_2 is 0
Lets verify that, the g(x) i.e., x_1 + x_2 would be ≥ 1 in only 3 cases:
x_1 AND !x_2 would output 1 for Case 1 so our thresholding parameter
holds good for the given function.
Geometric Interpretation Of M-P Neuron
Decision boundary
There is no appropriate
decision boundary
What about functions which are not linearly separable ?
● Frank Rosenblatt, an American
psychologist, proposed the
classical perceptron model
(1958).
● A more general computational
model than Mcculloch–Pitts
neurons.
● Main differences:Introduction of
numerical weights for inputs and
a mechanism for learning these
weights.
● Inputs are no longer limited to
boolean values.
Then what is the difference?
cosα=wTx/(||w||*||x||)= 0
Since the vector w is perpendicular to
every point on the line it is actually
perpendicular to the line itself.
Why would this work ?
For x∈N if wTx≥0 then it means that the angle (α) between
this x and the current w is less than 90° (but we want α to
be greater than 90°) What happens to the new angle(αnew)
when wnew=w−x?
? ? ?
Solution
XOR(x1,x2) = AND(NOT(AND(x1,x2)), OR(x1,x2))
Note: b1 here is vector of biases not a
single number, as we have 2 Perceptrons
(different w0s for each neuron).
X1 X2 OR NAND AND
0 0
1 0
0 1
1 1
X1 X2 NAND
1 0 1 W0+1*W1+0*W2>=0
0 1 1 W0+0*W1+1*W2>=0
1 1 0 W0+1*W1+1*W2<0
OR NAND XOR
1 1 1 W0+1*W1+1*W2>=0
1 1 1 W0+1*W1+1*W2>=0
1 0 0 W0+1*W1+0*W2<0