Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can anyone modify this matlab probblem instruction: This is the modified version of Perceptron_XOR which should solve the problem 'somehow' without using an MLP. A

can anyone modify this matlab probblem

instruction: This is the modified version of Perceptron_XOR which should solve the problem 'somehow' without using an MLP. A way to approach this is to create a 3D perceptron, and progress it from there.

echo on; % % % % % % ==================================================================== % The perceptron: an attempt to learn linearly non-separable functions % ====================================================================

% =========================================================================== % Problem: Two-input perceptron is required to perform logical operation XOR. % ===========================================================================

% Hit any key to define four 2-element input vectors denoted by "p". pause

p=[0 0 1 1;0 1 0 1]

% Hit any key to define four 1-element target vectors denoted by "t". pause

t=[0 1 1 0]

% Hit any key to plot the input and target vectors. v=[-2 3 -2 3];

plotpv(p,t,v);

% Hit any key to create the perceptron and set its initial weights to random % numbers in the range [0, 1]. The perceptron's threshold is set to zero. pause

net=newp([0 1;0 1],1); w=(rands(2))'; b=[0]; net.IW{1,1}=w; net.b{1}=b;

plotpv(p,t,v); linehandle=plotpc(net.IW{1},net.b{1});

% Hit any key to train the perceptron for one pass and plot the classification line. % The training will be stoped after 10 passes. pause

for a=1:10; [net,Y,E]=adapt(net,p,t); linehandle=plotpc(net.IW{1},net.b{1},linehandle); pause end;

% Hit any key to see that the perceptron has not learned the XOR operation. pause

p=[1;1] a=sim(net,p)

% Hit any key to continue. pause

p=[0;1] a=sim(net,p)

% Hit any key to continue. pause

p=[1;0] a=sim(net,p)

% Hit any key to continue. pause

p=[0;0] a=sim(net,p) echo off disp('end of Perceptron_XOR')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

What would the person you least admire do?

Answered: 1 week ago

Question

What are the strengths of each option?

Answered: 1 week ago

Question

What are the costs of each one?

Answered: 1 week ago