Perceptron Matlab

Embed Size (px)

Citation preview

  • 7/23/2019 Perceptron Matlab

    1/1

    %%%Funcion AND - hardlimsclear allclcp = [[-1;-1] [-1;1] [1;-1] [1;1]]t =[-1 -1 -1 1]net = newp(p,t,'hardlims');w=[0.5 -1.5];b=[-0.5];net.IW{1,1}= w;net.b{1} = b;net.trainParam.epochs = 40;net = train(net,p,t);a = sim(net,p);wf=net.IW{1,1}bt=net.b{1}%%%Funcion OR - hardlimsclear allclcp = [[-1;-1] [-1;1] [1;-1] [1;1]]t =[-1 1 1 1]net = newp(p,t,'hardlims');w=[0.5 -1.5];b=[-0.5];net.IW{1,1}= w;

    net.b{1} = b;net.trainParam.epochs = 40;net = train(net,p,t);a = sim(net,p);wf=net.IW{1,1}bt=net.b{1}%%%Funcion AND - hardlimclear allclcp = [[0;0] [0;1] [1;0] [1;1]]t =[0 0 0 1]net = newp(p,t,'hardlim');

    w=[0.5 -1.5];b=[-0.5];net.IW{1,1}= w;net.b{1} = b;net.trainParam.epochs = 40;net = train(net,p,t);a = sim(net,p);wf=net.IW{1,1}bt=net.b{1}%%%Funcion OR - hardlimclear allclcp = [[0;0] [0;1] [1;0] [1;1]]

    t =[0 1 1 1]net = newp(p,t,'hardlim');w=[0.5 1];b=[-0.5];net.IW{1,1}= w;net.b{1} = b;net.trainParam.epochs = 400;net = train(net,p,t);a = sim(net,p);wf=net.IW{1,1}bt=net.b{1}