>> x=[1 1 0;0 1 1;1 0 1];
>> y=[1 0;0 1;1 1]';
>> x=x';
net=newff(minmax(x),[5 2],{'logsig','purelin'},'trainlm');
>> net=train(net,x,y)
TRAINLM, Epoch 0/100, MSE 3.60405/0, Gradient 10.7438/1e-010
TRAINLM, Epoch 4/100, MSE 9.94807e-031/0, Gradient 2.59087e-015/1e-010
TRAINLM, Minimum gradient reached, performance goal was not met.
net =
Neural Network object:
architecture:
numInputs: 1
numLayers: 2
biasConnect: [1; 1]
inputConnect: [1; 0]
layerConnect: [0 0; 1 0]
outputConnect: [0 1]
targetConnect: [0 1]
numOutputs: 1 (read-only)
numTargets: 1 (read-only)
numInputDelays: 0 (read-only)
numLayerDelays: 0 (read-only)
subobject structures:
inputs: {1x1 cell} of inputs
layers: {2x1 cell} of layers
outputs: {1x2 cell} containing 1 output
targets: {1x2 cell} containing 1 target
biases: {2x1 cell} containing 2 biases
inputWeights: {2x1 cell} containing 1 input weight
layerWeights: {2x2 cell} containing 1 layer weight
functions:
adaptFcn: 'trains'
initFcn: 'initlay'
performFcn: 'mse'
trainFcn: 'trainlm'
parameters:
adaptParam: .passes
initParam: (none)
performParam: (none)
trainParam: .epochs, .goal, .max_fail, .mem_reduc,
.min_grad, .mu, .mu_dec, .mu_inc,
.mu_max, .show, .time
weight and bias values:
IW: {2x1 cell} containing 1 input weight matrix
LW: {2x2 cell} containing 1 layer weight matrix
b: {2x1 cell} containing 2 bias vectors
other:
userdata: (user stuff)
>> y1=sim(net,x)
y1 =
1.0000 0 1.0000
-0.0000 1.0000 1.0000