Question
will implement a simple Perceptron model using C. The net output of the artificial neuron shown can be determined by weighting each of the inputs,
will implement a simple Perceptron model using C. The net output of the artificial neuron shown can be determined by weighting each of the inputs, x1, x2, . . . , xn by a corresponding weight, w1, w2, . . . , wn The output for this neuron is NET = xsubscript1wsubscript1 + xsubscript2wsubscript2 + . . . + XsubscriptN WsubscriptN = i Xsubscript i Y subscript I
Ideally, we want to implement the following logic in the simplest Artificial
Neuron: if NET ? biasV alue then OUT = 1 else OUT = 0 end if
the basic idea is that we want a neuron to deliver an output of 1 if given one set of inputs, or 0 depending on another set. The decision to output either a 0 or a 1 can be done in several ways. One of the simpler methods is to use the following programming logic: if NET > 0.5, then OUT=1, else OUT = 0.
Initialize the weights to 0 and the threshold to 0.5. Weights may be initial- ized to 0 or a small random value. In the example below, we use 0.
Step 1: Apply the input pattern and calculate the output, OUT. OUT=1 if NET > T, OUT=0 otherwise. Step 2: a. If the output is correct, repeat step 1
b. If the output is incorrect, and is zero, add each input to its correspond- ing weight; or
c. If the output is incorrect and is one, subtract each input from its cor- responding weight.
Your program should not loop endlessly but rather stop when the iteration error is less than a small value such as 0.1.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started