create an XOR GATE using a feed forward neural net

72 visualizaciones (últimos 30 días)
Newman
Newman el 16 de Mzo. de 2016
Respondida: Multi Vac el 26 de Abr. de 2020
Hello I am new to neural networrks in matlab.And I want to create a feedforward neural net to calculate XORs of two input values.
The theoretical neural network is given below in the pic.I want to replicate the same using matlab neural net toolbox.
for this i have created a simple neural network
net=feedforwardnet(2);
since i need two inputs A and B I have changed the inputs as the following code:
net.numInputs=2;
view(net);
After running the code I am getting the following figure:
The matlab representation for neural network is quite different than the theoretical one. Now i can't understand why the second input is not connected .I need to specify the input values for A[0 0 1 1 ] and B[0 1 0 1] so that i get the out put as t[0 1 1 0] which is XOR.Kindly explain me how t set the bias as magnitude one and the weights for the branches as in the theoretical figure to the same as in my neural network in matlab.

Respuesta aceptada

Greg Heath
Greg Heath el 16 de Mzo. de 2016
You are mistaken. You should only use 1 input. However, it should be two dimensional.
Hope this helps.
Thank you for formally accepting my answer*
Greg
  1 comentario
Newman
Newman el 16 de Mzo. de 2016
Editada: Newman el 16 de Mzo. de 2016
Sir r u trying to say that my input x should be in this form:
[0 0 1 1;0 1 0 1].
But sir can you please tell me how should i change the weights and set the biases ?

Iniciar sesión para comentar.

Más respuestas (2)

Aya Ahmed
Aya Ahmed el 24 de Abr. de 2020
Newman have you reach to the code ??
PLZ help me , i want to make that but i cant

Multi Vac
Multi Vac el 26 de Abr. de 2020

Categorías

Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by