线性网络分析

线性网络分析

% 线性网络分析 clc; clear; p=[1.0 1.5 3.0 -1.2]; t=[0.5 1.1 3.0 -1.0]; net = newlind(p,t); %设计网络 % Design a linear layer w=net.iw{1,1}; %求网路训练结束后的网络权值和偏差 b=net.b{1}; %使用网络 y=sim(net,p) %输出结果 sse=SSE(t-y) %求误差的平方和 % Sum squared error performance function % sse is a network performance function. % It measures performance according to the sum of squared errors. % sse(E,X,PP) takes from one to three arguments, % E -- Matrix or cell array of error vector(s) % X -- Vector of all weight and bias values (ignored) % PP -- Performance parameters (ignored) % and returns the sum squared error. % sse(E,net,PP) can take an alternate argument to X, % net -- Neural network from which X can be obtained (ignored) % sse(code) returns useful information for each code string: % 'deriv' -- Name of derivative function % 'name' -- Full name % 'pnames' -- Names of training parameters % 'pdefaults' -- Default training parameters %作网络训练结果图 a=[t;y]; c=[1,1,1,1]; plotpv(a,c); % Plot perceptron input/target vectors % plotpv(P,T) take these inputs, % P -- R x Q matrix of input vectors (R must be 3 or less) % T -- S x Q matrix of binary target vectors (S must be 3 or less) % and plots column vectors in P with markers based on T % plotpv(P,T,V) takes an additional input, % V -- Graph limits = [x_min x_max y_min y_max] % and plots the column vectors with limits set by V % Examples % % The code below defines and plots the inputs and targets for a perceptron: % p = [0 0 1 1; 0 1 0 1]; % t = [0 0 0 1]; % plotpv(p,t) % % The following code creates a perceptron with inputs ranging over the values in P, % assigns values to its weights and biases, % and plots the resulting classification line. net = newp(minmax(p),1); % net.iw{1,1} = [-1.2 -0.5]; % net.b{1} = 1; % plotpc(net.iw{1,1},net.b{1}) w=[-w,[1]]; %将W变为两维 plotpc(w,-b); % Plot a classification line on a perceptron vector plot

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值