论文翻译

更新时间:2024-04-01 23:14:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

hintonwb

function hintonwb(w,b,max_m,min_m)

% HINTONWB Hinton graph of weight matrix and bias vector. % Syntax

% hintonwb(W,b,maxw,minw) % Description

% HINTONWB(W,B,M1,M2) % W - SxR weight matrix % B - Sx1 bias vector.

% MAXW - Maximum weight, default = max(max(abs(W))). % MINW - Minimum weight, default = M1/100.

%and displays a weight matrix and a bias vector represented as a grid of squares.

% Each square's AREA represents a weight's magnitude. % Each square's COLOR represents a weight's sign. % RED for negative weights, GREEN for positive. % Examples

% W = rands(4,5); % b = rands(4,1); % hintonwb(W,b) % See also HINTONW.

% DEFINE BOX EDGES(code is omited) % DEFINE POSITIVE BOX % DEFINE POSITIVE BOX

hintonw

function hintonw(w,max_m,min_m)

% HINTONW Hinton graph of weight matrix. % Syntax

% hintonw(W,maxw,minw) % Description

% HINTONW(W,MAXW,MINW) takes these inputs, % W - SxR weight matrix

% MAXW - Maximum weight, default = max(max(abs(W))). % MINW - Minimum weight, default = M1/100.

1

% and displays a weight matrix represented as a grid of squares. % Each square's AREA represents a weight's magnitude. % Each square's COLOR represents a weight's sign. % RED for negative weights, GREEN for positive. % Examples

% W = rands(4,5); % hintonw(W)

% See also HINTONWB.

if nargin < 1,error('NNET:Arguments','Not enough input arguments.');end if nargin < 2, max_m = max(max(abs(w))); end if nargin < 3, min_m = max_m / 100; end

if max_m == min_m, max_m = 1; min_m = 0; end TFINE BOX EDGES xn1 = [-1 -1 +1]*0.5; xn2 = [+1 +1 -1]*0.5; yn1 = [+1 -1 -1]*0.5; yn2 = [-1 +1 +1]*0.5;

% DEFINE POSITIVE BOX xn = [-1 -1 +1 +1 -1]*0.5; yn = [-1 +1 +1 -1 -1]*0.5; % DEFINE POSITIVE BOX

plotep

function hh = plotep(w,b,e,h)

%PLOTEP Plot a weight-bias position on an error surface. % Syntax

% h = plotep(w,b,e) % h = plotep(w,b,e,h) % Description

% PLOTEP is used to show network learning on a plot % already created by PLOTES.

% PLOTEP(W,B,E) takes these arguments % W - Current weight value. % B - Current bias value. % E - Current error.

% and returns a vector H containing information for % continuing the plot.

2

% PLOTEP(W,B,E,H) continues plotting using the vector H, % returned by the last call to PLOTEP.

% H contains handles to dots plotted on the error surface, so they can be deleted next time, as well as points on the error contour, so they can be connected.

% See also ERRSURF, PLOTES.

% GET LAST POSITION(code is omited) % MOVE MARKERS

% CONNECT NEW POSITION

plotes

function plotes(wv,bv,es,v)

%PLOTES Plot the error surface of a single input neuron. % Syntax

% plotes(wv,bv,es,v) % Description

% PLOTES(WV,BV,ES,V) takes these arguments, % WV - 1xN row vector of values of W. % BV - 1xM row vector of values of B. % ES - MxN matrix of error vectors. % V - View, default = [-37.5, 30].

% and plots the error surface with a contour underneath. % Calculate the error surface ES with ERRSURF. % Examples % p = [3 2]; % t = [0.4 0.8];

% wv = -4:0.4:4; bv = wv;

% ES = errsurf(p,t,wv,bv,'logsig'); % plotes(wv,bv,ES,[60 30]) % See also ERRSURF. % SURFACE

sh = surf(wv,bv,es,scolor); hold on

sh = surf(wv,bv,zeros(length(wv),length(bv))+surfpos,scolor); set(sh,'edgecolor',[0.5 0.5 0.5]) % ERROR GOAL % TITLES

3

xlabel('Weight W'); ylabel('Bias B');

zlabel('Sum Squared Error') title('Error Surface') % WEIGHT & BIAS

set(gca,'xlim',[min(wv),max(wv)]) set(gca,'ylim',[min(bv),max(bv)]) zlim = get(gca,'zlim'); % VIEW

if nargin == 4, view(v), end set(gca,'zlim',[surfpos maxe]); % RIGHT 2-D PLOT subplot(1,2,2); % SURFACE

sh = surf(wv,bv,es*0,scolor); hold on

set(sh,'edgecolor',[0.5 0.5 0.5]) % CONTOUR

[cc,ch] = contour(wv,bv,es,12); hold off

set(ch,'edgecolor',[1 1 1]) % TITLES

xlabel('Weight W'); ylabel('Bias B'); title('Error Contour') % VIEW view([0 90])

set(gca,'xlim',[min(wv) max(wv)]) set(gca,'ylim',[min(bv) max(bv)]) % COLOR colormap(cool);

plotpc

function h = plotpc(w,b,hh)

%PLOTPC Plot a classification line on a perceptron vector plot. % Syntax

% plotpc(W,b)

4

% plotpc(W,b,h) % Description

% PLOTPC(W,B) takes these inputs,

% W - SxR weight matrix (R must be 3 or less). % B - Sx1 bias vector.

% and returns a handle to a plotted classification line. % PLOTPC(W,B,H) takes these inputs, % H - Handle to last plotted line.

% and deletes the last line before plotting the new one. This function does

not change the current axis and is intended to be called after PLOTPV. % Example

% 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}) % See also PLOTPV. %ERROR CHECKING % PLOTTING % 2-D PLOT % 3-D PLOT

plotperform

function result = plotperform(varargin)

%PLOTPERFORM Plot network performance. % Syntax

% plotperform(tr) % Description

% PLOTPERFORM(TR) plots the training, validation and test

performances given the training record TR returned by the function

5

TRAIN. % Example

% load simplefit_dataset

% net = newff(simplefitInputs,simplefitTargets,20); % [net,tr] = train(net,simplefitInputs,simplefitTargets); % plotperform(tr); % See also plottrainstate % Plot

% New Figure

plotpv

function plotpv(p,t,v)

%PLOTPV Plot perceptron input/target vectors. % Syntax

% plotpv(p,t) % plotpv(p,t,v) % Description

% PLOTPV(P,T) take these inputs,

% P - RxQ matrix of input vectors (R must be 3 or less).

% T - SxQ 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. % Example

% 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})

6

% See also PLOTPC. % ERROR CHECKING % DEFAULTS % MARKERS % PLOT SET UP

plotsomhits

function result = plotsomhits(varargin)

%PLOTSOMHITS Plot self-organizing map sample hits. % Syntax

% plotsomhits(net,inputs)

% plotsomhits(net,inputs,targets) % Description

% PLOTSOMHITS(NET,INPUTS) plots a SOM layer, with each neuron

showing the number of input vectors that it classifies. The relative number of vectors for each neuron is shown via the size of a colored patch. % Example

% load iris_dataset

% net = newsom(irisInputs,[5 5]); % [net,tr] = train(net,irisInputs); % plotsomhits(net,irisInputs); % See also plotsomplanes

if nargin < 1, error('NNET:Arguments','Not enough input arguments.'); end % Info % Plot

v1 = varargin{1};

if isa(v1,'network') && (nargin == 2) % User arguments - New plot [net,inputs] = deal(varargin{:}); fig = new_figure('');

elseif (isa(v1,'network') && (nargin == 3))

% Standard Plotting Function Arguments - Recycle plot % New Figure

% Standardize inputs % Clear Figure

7

plotsompos

function result = plotsompos(varargin)

%PLOTSOMPOS Plot self-organizing map weight positions. % Syntax

% plotsomtop(net)

% plotsomtop(net,inputs) % Description

% PLOTSOMPOS(NET) plots the input vectors as green dots, and shows %how the SOM classifies the input space by showing blue-gray dots for each

% neuron's weight vector and connecting neighboring neurons with red lines. % Example

% load simplecluster_dataset

% net = newsom(simpleclusterInputs,[10 10]); % net = train(net,simpleclusterInputs); % plotsompos(net,simpleclusterInputs);

% See also plotsomnd, plotsomplanes, plotsomhits

if nargin < 1, error('NNET:Arguments','Not enough input arguments.'); end % Info % Plot

v1 = varargin{1};

if (nargin < 3) || (~ isa(varargin{2},'struct')) % User arguments - New plot

% Standard Plotting Function Arguments - Recycle plot %Update Figure % Plot Figure

function plot_figure(fig,net,inputs) % Standardize inputs % Setup neurons %Inputs

if ~isempty(inputs) % Weights %Clear Figure

plotsomtop

8

function result = plotsomtop(varargin)

%PLOTSOMTOP Plot self-organizing map topology. % Syntax

% plotsomtop(net) % Description

% PLOTSOMTOP(NET) plots the topology of a SOM layer. % Example

% load iris_dataset

% net = newsom(irisInputs,[8 8]); % plotsomtop(net);

% See also plotsomnd, plotsomplanes, plotsomhits % Plot

% Standard Plotting Function Arguments - Recycle plot % New Figure % Update Figure % Plot Figure

function plot_figure(fig,net,inputs) % Standardize inputs % Clear Figure

plotsom

function plotsom(w,d,nd)

%PLOTSOM Plot self-organizing map. % Syntax

% plotsom(pos) % plotsom(W,d,nd) % Description

% PLOTSOM(POS) takes one argument,

% POS - NxS matrix of S N-dimension neural positions.

% and plots the neuron positions with red dots, linking the neurons within

a Euclidean distance of 1.

% PLOTSOM(W,D,ND) takes three arguments, % W - SxR weight matrix. % D - SxS distance matrix.

% ND - Neighborhood distance, default = 1.

% and plots the neuron's weight vectors with connections between weight

vectors whose neurons are within a distance of 1.

9

% Examples

% Here are some neat plots of various layer topologies: % pos = hextop(5,6); plotsom(pos) % pos = gridtop(4,5); plotsom(pos) % pos = randtop(18,12); plotsom(pos) % pos = gridtop(4,5,2); plotsom(pos) % pos = hextop(4,4,3); plotsom(pos)

% See NEWSOM for an example of plotting a layer's weight vectors with the input vectors they map.

% See also NEWSOM, LEARNSOM, INITSOM. % Arguments

% Check Dimensions % Line coordinates % Plot

plottrainstate

function result = plottrainstate(varargin)

%PLOTTRAINSTATE Plot training state values. % Syntax

% plottrainstate(tr) % Description

% PLOTTRAINSTATE(TR) plots the training state from a training record

TR returned by TRAIN. % Example

% load housing

% net = newff(p,t,20); % [net,tr] = train(net,p,t); % plottrainstate(tr); % See also plottrainstate

if nargin < 1, error('NNET:Arguments','Not enough input arguments.'); end % Info % Plot

if nargin == 1

% User arguments - New plot tr = varargin{1}; fig = new_figure(''); else

10

% Standard Plotting Function Arguments - Recycle plot % New Figure % Update Figure % Update Figure

function clear_figure(fig) drawnow

plotvec

function hh = plotvec(x,c,m)

%PLOTVEC Plot vectors with different colors. % Syntax

% plotvec(x,c,m) % Description

% PLOTVEC(X,C,M) takes these inputs, % X - Matrix of (column) vectors. % C - Row vector of color coordinate. % M - Marker, default = '+'.

% and plots each ith vector in X with a marker M, using the ith value in C

as the color coordinate.

% PLOTVEC(X) only takes a matrix X and plots each ith vector in X

with marker '+' using the index i as the color coordinate. % Examples

% x = [0 1 0.5 0.7; -1 2 0.5 0.1]; % c = [1 2 3 4]; % plotvec(x,c)

%if nargin < 1,error('NNET:Arguments','Not enough input arguments.'); end % VECTORS [xr,xc] = size(x); if xr < 2

x = [x; zeros(2-xr,xc)]; xr = 2; end

% COLORS % MARKER

% 2-D PLOTTING % 3-D PLOTTING

11

plotv

function plotv(m,t)

%PLOTV Plot vectors as lines from the origin. % Syntax

% plotv(m,t) % Description

% PLOTV(M,T) takes two inputs,

% M - RxQ matrix of Q column vectors with R elements. % T - (optional) the line plotting type, default = '-'. % and plots the column vectors of M.

% R must be 2 or greater. If R is greater than two, % only the first two rows of M are used for the plot. % Examples

% plotv([-.4 0.7 .2; -0.5 .1 0.5],'-')

%if nargin < 1,error('NNET:Arguments','Wrong number of arguments.');end

12

Hintonwb翻译

function hintonwb(w,b,max_m,min_m) %hinton曲线表示权矩阵和的偏移矢量 %语法

% hintonwb(W,b,maxw,minw) % 描述

% HINTONWB(W,B,M1,M2) % W - SxR 权矩阵 % B - Sx1 偏移矢量

%MAXW -最大权重, 定义 = max(max(abs(W)))。MINW -最小权重, 定%义 = M1/100.显示一个权矩阵和一个偏移矢量代替. 作为一个矩形方 %块.每个矩形方块的面积是权重的大小.每个矩形方块的颜色是权重的标%志.红色代表负权重,绿色代表正权重. %如例

% W = 区间为(4,5); % b = 区间为(4,1); % hintonwb(W,b)

% 也可以参考HINTONW函数 %定义格子的边界(代码略去) %定义在格子里的 %定义在格子里的

hintonw翻译

function hintonw(w,max_m,min_m) %hinton权矩阵函数图形. %语法

% hintonw(W,maxw,minw) % 描述

% HINTONW(W,MAXW,MINW) 将这些函数输入 % W - SxR weight matrix

% MAXW - 最大权重, 默认值= max(max(abs(W))). % MINW -最小权重 默认值= M1/100.

% 显示一个方形的矩阵函数图形。每个矩形的面积代表权重的大小。每 %个矩形的颜色代表权重信号。红色代表负权重,绿色代表正权重。 %例如

13

% W = 区间为(4,5); % hintonw(W)

%也可参考HINTONWB函数.

if nargin < 1,error('NNET:Arguments','Not enough input arguments.');end if nargin < 2, max_m = max(max(abs(w))); end if nargin < 3, min_m = max_m / 100; end

if max_m == min_m, max_m = 1; min_m = 0; end %定义格子的边界 xn1 = [-1 -1 +1]*0.5; xn2 = [+1 +1 -1]*0.5; yn1 = [+1 -1 -1]*0.5; yn2 = [-1 +1 +1]*0.5; %定义在格子里的

xn = [-1 -1 +1 +1 -1]*0.5; yn = [-1 +1 +1 -1 -1]*0.5; %定义在格子里的

plotep翻译

function hh = plotep(w,b,e,h)

%在一个误差的平面绘制PLOTEP函数的权偏移变量的位置. %语法

% h = plotep(w,b,e) % h = plotep(w,b,e,h) % 描述

% 在网络学习显示之前绘制PLOTEP函数 % PLOTEP(W,B,E) 以这些论点 % W -通常的权值 % B -通常的偏离值 % E -通常的错误

% 返回矢量H包含的信息是持续的绘图. % PLOTEP(W,B,E,H) 持续用矢量H绘图,最后返回PLOTEP函数.矢

量H包换点的绘制在误差的平面,所以他们可以下次删除,同样也可以点出误差的轮廓,银次他们可以被连接. % 也可以参考ERRSURF,PLOTES函数.

if nargin < 3, error('NNET:Arguments','Not enough input arguments'),end % 得到最后的位置 if nargin == 4

14

w2 = h(1); b2 = h(2);

delete(h(3:length(h))); end

%移动标记 %连接新的位置

plotes翻译

function plotes(wv,bv,es,v)

%绘制PLOTES函数单独的神经元输入在一个误差平面式. % 语法

% plotes(wv,bv,es,v) % 描述

% PLOTES(WV,BV,ES,V) 以这些论点, % WV - 1xN 行向量的价值是 W. % BV - 1xM 行向量的价值是B. % ES - MxN 误差向量的矩阵. % V -查看, 定义 = [-37.5, 30].

% 划分这个误差的平面以下平面的轮廓.计算这个误差平面ES用ERRSURF函数. % 例如

% p = [3 2]; % t = [0.4 0.8];

% wv = -4:0.4:4; bv = wv;

% ES = errsurf(p,t,wv,bv,'logsig'); % plotes(wv,bv,ES,[60 30]) % 参考ERRSURF函数. % 左边的3D绘制 subplot(1,2,1);

[px,py] = gradient(es,wv,bv); scolor = sqrt(px.^2+py.^2); %表面

sh = surf(wv,bv,es,scolor); hold on

sh = surf(wv,bv,zeros(length(wv),length(bv))+surfpos,scolor); set(sh,'edgecolor',[0.5 0.5 0.5]) %误差的目标

15

%主题

xlabel('Weight W'); ylabel('Bias B');

zlabel('Sum Squared Error') title('Error Surface') %权重&偏移

set(gca,'xlim',[min(wv),max(wv)]) set(gca,'ylim',[min(bv),max(bv)]) zlim = get(gca,'zlim'); %查看

if nargin == 4, view(v), end set(gca,'zlim',[surfpos maxe]); %正确的2D绘图 subplot(1,2,2); %表面

sh = surf(wv,bv,es*0,scolor); hold on

set(sh,'edgecolor',[0.5 0.5 0.5]) %轮廓

[cc,ch] = contour(wv,bv,es,12); hold off

set(ch,'edgecolor',[1 1 1]) %主题

xlabel('Weight W'); ylabel('Bias B'); title('Error Contour') %观点 view([0 90])

set(gca,'xlim',[min(wv) max(wv)]) set(gca,'ylim',[min(bv) max(bv)]) %颜色

colormap(cool);

plotpc翻译

function h = plotpc(w,b,hh)

%PLOTPC Plot a classification line on a perceptron vector plot. % 绘制PLOTPC函数模块的划分线和感知向量

16

% Syntax %语法

% plotpc(W,b) % plotpc(W,b,h) %描述

% PLOTPC(W,B) 将这些变量输入,

% W - SxR权重矩阵(R的值必须是3或更小). % B - Sx1偏移向量. % 然后返回处理绘制分类线

% PLOTPC(W,B,H) 将这些变量输入, % H -处理最后的绘制线.

% 在绘制新线之前删掉最后的线。这个函数不能改变当前的当前的轴,其目的是在PLOTPV之后访问 % 例如

%感知器的目标是输入下面的代码定义和绘制 % p = [0 0 1 1; 0 1 0 1]; % t = [0 0 0 1]; % plotpv(p,t)

% 以下的代码运用排列测量值P创造一个感知器,指定值的偏重和偏差,绘制结果产生的分类。 % 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}) %参考函数PLOTPV %检查误差 %默认值 %绘制中 -绘制 =绘制

plotperform翻译

function plotpv(p,t,v)

%绘制PLOTPV函数感知器输入或目标向量 % 语法

% plotpv(p,t) % plotpv(p,t,v)

17

% 描述

% PLOTPV(P,T) 将这些变量输入,

% P - RxQ 输入函数的矩阵(R的值必须是3或比3小).

% T - SxQ二进制目标向量的矩阵(S的值必须是3或比3小). % 根据T向量在P函数里绘制列向量, % PLOTPV(P,T,V) 将一个变量额外的输入, % V -图的限制= [x_min x_max y_min y_max] % 用nd绘制圆向量的被V函数限制 %例如

% 在代码下面输入定义和绘制目标作为感知器 % p = [0 0 1 1; 0 1 0 1]; % t = [0 0 0 1]; % plotpv(p,t)

% 以下的代码运用排列测量值P创造一个感知器,指定值的偏重和偏差,绘制结果所产生的分类。 % 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}) %参考PLOTPC函数 %输入错误

if nargin < 2, error('NNET:Arguments','Not enough arguments.'),end [pr,pc] = size(p); [tr,tc] = size(t);

if (pr > 3), error('NNET:Arguments','P must 1, 2, or 3 rows.'), end if tr > 3, error('NNET:Arguments','T must have 1, 2, or 3 rows.'), end %默认值 %标记

marker = ['ob';'or';'*b';'*r';'+b';'+r';'xb';'xr']; %绘制中 for i=1:pc

m = marker([4 2 1]*t(:,i)+1,:); plot3(p(1,i),p(2,i),p(3,i),m) hold on end

%绘制装载

18

plotsomhits翻译

function result = plotsomhits(varargin)

%绘制PLOTSOMHITS函数的自我组织映射的样品命中 %语法

% plotsomhits(net,inputs)

% plotsomhits(net,inputs,targets) % 描述

% PLOTSOMHITS(NET,INPUTS) 绘制一个SOM函数的层次,用每个神经元数目的输入向量表示分类,相对数目的向量引导每个神经元是通过一个色彩的补丁 % 例如

% load iris_dataset

% net = newsom(irisInputs,[5 5]); % [net,tr] = train(net,irisInputs); % plotsomhits(net,irisInputs); %参考函数plotsomplanes

if nargin < 1, error('NNET:Arguments','Not enough input arguments.'); end %信息 %绘制

v1 = varargin{1};

if isa(v1,'network') && (nargin == 2) % 用户参数-新的绘制

[net,inputs] = deal(varargin{:}); fig = new_figure('');

elseif (isa(v1,'network') && (nargin == 3)) % 标准的绘制运行参数-循环绘制 %新图形 %修正图形 %绘制图形

function plot_figure(fig,net,inputs) %标准化验证 %清理图形

plotsompos翻译

function result = plotsompos(varargin).

19

% 绘制PLOTSOMPOS函数自组织映射权函数位置 %语法

% plotsomtop(net)

% plotsomtop(net,inputs) %描述

% PLOTSOMPOS(NET) 绘制输入向量用绿色的点,显示怎么分类SOM函数输入空格是蓝灰色点,每个神经元的权重矢量和链接边上神经元用红线划分 % 例如

% load simplecluster_dataset

% net = newsom(simpleclusterInputs,[10 10]); % net = train(net,simpleclusterInputs); % plotsompos(net,simpleclusterInputs);

%参考plotsomnd函数, plotsomplanes函数, plotsomhits函数

if nargin < 1, error('NNET:Arguments','Not enough input arguments.'); end %信息 %绘制

v1 = varargin{1};

if (nargin < 3) || (~ isa(varargin{2},'struct')) % 用户参数-新的绘制

varargin = fill_defaults(varargin,[]); [net,inputs] = deal(varargin{:}); fig = new_figure('');

elseif (isa(v1,'network') && (nargin == 3)) % 开始绘制函数参数 –循环绘制 [net,tr,signals] = deal(varargin{:}); %新图像 %修正图像 %绘制图像

function plot_figure(fig,net,inputs) %标准化输入 %安装神经元 %输入 %连接 %权重 %轴线

if numDimensions == 2 set(ud.axis,'view',[0 90])

20

end

%清理图形

plotsomtop翻译

function result = plotsomtop(varargin)

%绘制PLOTSOMTOP函数自组织映射的拓扑结构 %语法

% plotsomtop(net) %描述

% PLOTSOMTOP(NET) 绘制SOM层的拓扑结构. %例如

% load iris_dataset

% net = newsom(irisInputs,[8 8]); % plotsomtop(net);

%参考plotsomnd函数, plotsomplanes函数, plotsomhits函数

if nargin < 1, error('NNET:Arguments','Not enough input arguments.'); end %信息 %绘制

v1 = varargin{1};

if (isa(v1,'network') && (nargin == 1)) % User arguments - New plot [net,inputs] = deal(varargin{:}); fig = new_figure('');

elseif (isa(v1,'network') && (nargin == 3)) % 标准的绘制运行参数-循环绘制 %新图形 %修正图形 %绘制图形

function plot_figure(fig,net,inputs) %标准化验证 % 安装神经元 %清理图像

plotsom翻译

21

function plotsom(w,d,nd)

%绘制PLOTSOM函数自组织映射图网路 %语法

% plotsom(pos) % plotsom(W,d,nd) %描述

% PLOTSOM(POS) 拿出一个变量,

% POS - NxS matrix of S N-矩阵的神经元位置. % S N-dimension

%用红色的点绘制神经元的位置,连接神经元的欧式距离为1 % PLOTSOM(W,D,ND) 取出三个变量, % W - SxR 权矩阵. % D - SxS 距离矩阵. % ND – 接近的距离, default = 1.

%绘制神经元权向量,并且连接权重向量的神经元距离在1之内 % 例如

% 这里绘制了各种拓扑结构

% pos = hextop(5,6); plotsom(pos) % pos = gridtop(4,5); plotsom(pos) % pos = randtop(18,12); plotsom(pos) % pos = gridtop(4,5,2); plotsom(pos) % pos = hextop(4,4,3); plotsom(pos) %参考NEWSOM函数,例如绘制一个分成的权重向量依靠输入向量的图纸

%回去参考NEWSOM函数, LEARNSOM函数, INITSOM函数 %参数

%检测大小 %坐标排成一排 %绘制

plottrainstate翻译

function result = plottrainstate(varargin)

%绘制PLOTTRAINSTATE函数的训练状态值 % 语法

% plottrainstate(tr) % 描述

22

%PLOTTRAINSTATE(TR) 从TR函数中记录和绘制训练状态然后返回训练

% 例如

% load housing

% net = newff(p,t,20); % [net,tr] = train(net,p,t); % plottrainstate(tr); %参考函数plottrainstate

if nargin < 1, error('NNET:Arguments','Not enough input arguments.'); end % 信息 %绘制

if nargin == 1

% 用户参数-新的绘制 tr = varargin{1};

fig = new_figure(''); else

%标准的绘制运行参数-循环绘制 %新图形 %修正图形 %修正图形

function clear_figure(fig) drawnow

plotvec翻译

function hh = plotvec(x,c,m)

%用不同颜色绘制PLOTVEC函数向量 %语法

% plotvec(x,c,m) %描述

% PLOTVEC(X,C,M) 将这些变量输入, % X -矩阵向量.

% C -行向量的颜色协调. % M –标记, default = '+'.

% 绘制每一个向量标记一个M,用C的值作为颜色的来协调

% PLOTVEC(X) 只需要一个矩阵X,绘制每一个矩阵X都需要标

23

记’+’,并指出i作为颜色协调 % 例如

% x = [0 1 0.5 0.7; -1 2 0.5 0.1]; % c = [1 2 3 4]; % plotvec(x,c)

if nargin < 1,error('NNET:Arguments','Not enough input arguments.'); end %向量

[xr,xc] = size(x); if xr < 2

x = [x; zeros(2-xr,xc)]; xr = 2; end %颜色 %标志 -绘制 =绘制

plotv翻译

function plotv(m,t)

%绘制PLOTV函数载体线的起源 % 语法

% plotv(m,t) % 描述

% PLOTV(M,T) 将这两个变量输入, % M - RxQ矩阵和列向量R的原理

% T - (optional)线绘制的种类和原理, 默认值 = '-'. % 绘制列向量M

% R的值是2或比2大。如果R比2大只有第一个的前两排是用M来绘制的 % 例如

% plotv([-.4 0.7 .2; -0.5 .1 0.5],'-')

24

本文来源:https://www.bwwdw.com/article/n5ir.html

Top