Sei sulla pagina 1di 5

>> p1 = [-3 : 3];

>> p
p =
3 -3
-3 3
>> p1
p1 =
-3 -2 -1 0 1 2 3
>> perceptron = newp(p1, 1);
??? Error using ==> newp>new_5p1_size at 153
Input ranges is not a two column matrix.
Error in ==> newp at 78
net = new_5p1_size(varargin{:});
>> perceptron = newp(p, 1);
??? Error using ==> newp>new_5p1_size at 156
Input ranges has values in the second column larger in the values in the same
row of the first column.
Error in ==> newp at 78
net = new_5p1_size(varargin{:});
>> p2 = [-3 3 ; -3 3];
>> perceptron = newp(p2, 1);
>> entrada = [0 1 2 -1 1;0 2 1 -1 0];
>> entrada
entrada =
0 1 2 -1 1
0 2 1 -1 0
>> objetivo = [1 1 0 1 0];
>> objetivo
objetivo =
1 1 0 1 0
>> plotpv(entrada,objetivo);
>> perceptron = train(perceptron,entrada,salida);
??? Undefined function or variable 'salida'.
>> perceptron = train(perceptron,entrada,objetivo);
>> y = sim(perceptron,entrada);
>> y = sim(perceptron,entrada)
y =
1 1 0 1 0
>> objetivo
objetivo =
1 1 0 1 0
>> plotpv y
??? Error using ==> plotpv at 48
Not enough arguments.
>> plotpv (y);
??? Error using ==> plotpv at 48
Not enough arguments.
>> y1 = sim(perceptron, [1 ;1])
y1 =
1
>> plotpc(perceptron.IW{1},perceptron.b{1});
--------------------------------------------------------------------------------
--

>> entradas = [-2 -1 0 1 ; -1 0 1 2 ; 1 1 1 1];


>> objetivos = [-1.5 -1 1 1.5 ];
>> Wi = random('Normal', 0,1,2,1);
>> Wi = random('Normal', 0,1,3,1);
>> Wi
Wi =
-2.2588
0.8622
0.3188
>> Wo = random('Normal', 0,1,2,1);
>> Wo
Wo =
-1.3077
-0.4336
>> Zin = entradas' * Wi';
??? Error using ==> mtimes
Inner matrix dimensions must agree.
>> Zin = entradas' * Wi;
>> Zin
Zin =
3.9743
2.5776
1.1809
-0.2157
>> Z = tansig(Zin);
>> Z
Z =
0.9993
0.9885
0.8277
-0.2124
>> Entz= [Z' ; 1 1 1 1 ];
>> Entz
Entz =
0.9993 0.9885 0.8277 -0.2124
1.0000 1.0000 1.0000 1.0000
>> 'comentario'
ans =
comentario
>> 'agregue BIAS a Z transpuesta'
ans =
agregue BIAS a Z transpuesta
>> Y = Entz'*Wo;
>> Y
Y =
-1.7404
-1.7263
-1.5160
-0.1558
>> 'Red con 1 capa oculta no entrenada'
ans =
Red con 1 capa oculta no entrenada
>> plot(x,y, 'r', x , entradas(1;:), 'g' , x, entradas(2;:), 'y', objetivos, 'b'
);
??? plot(x,y, 'r', x , entradas(1;:), 'g' , x, entradas(2;:), 'y', objetivos, 'b
');
|
Error: Unbalanced or unexpected parenthesis or bracket.
>> plot(x,y, 'r', x , entradas(1,:), 'g' , x, entradas(2,:), 'y', objetivos, 'b'
);
??? Undefined function or variable 'x'.
>> x = [-2 : 1]
x =
-2 -1 0 1
>> plot(x,y, 'r', x , entradas(1,:), 'g' , x, entradas(2,:), 'y', objetivos, 'b'
);
??? Error using ==> plot
Vectors must be the same lengths.
>> x = [-2 : 2]
x =
-2 -1 0 1 2
>> plot(x,y, 'r', x , entradas(1,:), 'g' , x, entradas(2,:), 'y', objetivos, 'b'
);
??? Error using ==> plot
Vectors must be the same lengths.
>> y
y =
1 1 0 1 0
>> plot(x,Y, 'r', x , entradas(1,:), 'g' , x, entradas(2,:), 'y', objetivos, 'b'
);
??? Error using ==> plot
Vectors must be the same lengths.
>> Y
Y =
-1.7404
-1.7263
-1.5160
-0.1558
>> plot(x,Y, 'r', x , entradas(1,:), 'g' , x, entradas(2,:), 'Y', objetivos, 'b'
);
??? Error using ==> plot
Vectors must be the same lengths.
>> plot(x,Y, 'r', x , entradas(1,:), 'g' , x, entradas(2,:), 'Y', objetivos, 'b'
);
??? Error using ==> plot
Vectors must be the same lengths.

>> y = Y
y =
-1.7404
-1.7263
-1.5160
-0.1558
>> plot(x,y, 'r', x , entradas(1,:), 'g' , x, entradas(2,:), 'y', x , objetivos,
'b');
??? Error using ==> plot
Vectors must be the same lengths.
>> x
x =
-2 -1 0 1 2
>> y
y =
-1.7404
-1.7263
-1.5160
-0.1558
>> x = [-2:1]
x =
-2 -1 0 1
>> plot(x,y, 'r', x , entradas(1,:), 'g' , x, entradas(2,:), 'y', x , objetivos,
'b');
>>

Potrebbero piacerti anche