亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nnd14lv1.m

?? 神經網絡設計書籍配套源碼(matlab平臺)
?? M
字號:
function nnd14lv1(cmd,arg1,arg2,arg3)
%NND4LV1 LVQ1 demonstration.
%
%	This demonstration requires the Neural Network Toolbox.

% First Version, 8-31-95.

%==================================================================

% CONSTANTS
me = 'nnd14lv1';
p_max = 3;
max_epoch = 5;
W2 = [1 1 0 0;
      0 0 1 1];
box_x = [-1 1 1 -1 -1]*0.1;
box_y = [-1 -1 1 1 -1]*0.1;
cross_x = [-1 1 NaN 0 0]*0.15;
cross_y = [0 0 NaN -1 1]*0.15;
lr = 0.6;
center_colors = [nnblack;nnltblue];

% FLAGS
change_func = 0;

% DEFAULTS
if nargin == 0, cmd = ''; else cmd = lower(cmd); end

% FIND WINDOW IF IT EXISTS
fig = nnfgflag(me);
if length(get(fig,'children')) == 0, fig = 0; end
  
% GET WINDOW DATA IF IT EXISTS
if fig
  H = get(fig,'userdata');
  fig_axis = H(1);            % window axis
  desc_text = H(2);           % handle to first line of text sequence
  v_axis = H(3);              % training and weight vector axis
  t1_axis = H(4);             % black target marker axis
  t2_axis = H(5);             % white target marker axis
  W1_ptr = H(6);
  P_ptr = H(7);
  T_ptr = H(8);
  PV_ptr = H(9);
  t_ptr = H(10);
  WV_ptr = H(11);
  blip_ptr = H(12);
  bloop_ptr = H(13);
end

%==================================================================
% Activate the window.
%
% ME() or ME('')
%==================================================================

if strcmp(cmd,'')
  if fig
    figure(fig)
    set(fig,'visible','on')
  else
    feval(me,'init')
  end

%==================================================================
% Close the window.
%
% ME() or ME('')
%==================================================================

elseif strcmp(cmd,'close') & (fig)
  delete(fig)

%==================================================================
% Initialize the window.
%
% ME('init')
%==================================================================

elseif strcmp(cmd,'init') & (~fig)

  % CHECK FOR NNT
  if ~nntexist(me), return, end

  % CONSTANTS
  W1 = rands(4,2);
  P = [-1.5  -2.0 2.0  1.5  2.0  2.0 -2.0 -1.5;
        2.0   1.5 2.0  2.0 -2.0 -1.5 -2.0 -2.0];
  T = [  1    1    0    0    1    1    0    0;
         0    0    1    1    0    0    1    1];
  A1 = compet(-dist(W1,P));
  A2 = W2*A1;
  E = T-A2;
  blip = nndsnd(6);
  bloop = nndsnd(7);

  % NEW DEMO FIGURE
  fig = nndemof2(me,'DESIGN','LVQ1','','Chapter 14');
  set(fig, ...
    'windowbuttondownfcn',nncallbk(me,'down'), ...
    'BackingStore','off',...
    'nextplot','add');
  H = get(fig,'userdata');
  fig_axis = H(1);
  desc_text = H(2);

  % ICON
  nndicon(14,458,363,'shadow')

  % VECTOR DIAGRAM
  v_axis = nnsfo('a2','','','');
  set(v_axis,...
    'position',[50 60 270*1.05 270*1.05],...
    'xlim',[-p_max p_max]*1.05,...
    'xtick',[],...
    'ylim',[-p_max p_max]*1.05,...
    'ytick',[])

  % INPUT VECTOR MARKERS
  cross = plot([-p_max p_max NaN 0 0],[0 0 NaN -p_max p_max],':',...
    'color',nndkblue,...
    'erasemode','none');
  Q = size(P,2);
  PV = zeros(1,Q);
  for q=1:Q
    if E(1,q)
      edge_color = nnred;
    else
      edge_color = nndkgray;
    end
    PV(q) = fill(box_x+P(1,q),box_y+P(2,q),center_colors(1+T(1,q),:),...
      'edgecolor',edge_color,...
      'erasemode','none',...
      'linewidth',2);
  end

  % WEIGHT MARKERS
  S1 = size(W1,1);
  for i=S1:-1:1
    WV(i) = plot(cross_x+W1(i,1),cross_y+W1(i,2),...
      'color',center_colors(1+W2(1,i),:),...
      'linewidth',3,...
      'erasemode','none');
  end

  % NEW INPUT MARKERS
  t1_axis = nnsfo('a2','','','');
  set(t1_axis,...
    'position',[50 20 20*1.05 20*1.05],...
    'xlim',[-.16 .16],...
    'ylim',[-.16 .16])
  axis('off')
  fill(box_x,box_y,nnltblue,...
    'edgecolor',nndkgray,...
      'linewidth',2)
  t2_axis = nnsfo('a2','','','');
  set(t2_axis,...
    'position',[70 20 20*1.05 20*1.05],...
    'xlim',[-.16 .16],...
    'ylim',[-.16 .16])
  axis('off')
  fill(box_x,box_y,[0 0 0],...
    'edgecolor',nndkgray,...
    'linewidth',2)

  % BUTTONS
  uicontrol(...
    'units','points',...
    'position',[110 20 60 20],...
    'string','Learn',...
    'callback',[me '(''learn'')'])
  uicontrol(...
    'units','points',...
    'position',[190 20 60 20],...
    'string','Train',...
    'callback',[me '(''train'')'])
  uicontrol(...
    'units','points',...
    'position',[270 20 60 20],...
    'string','Random',...
    'callback',[me '(''random'')'])

  uicontrol(...
    'units','points',...
    'position',[400 110 60 20],...
    'string','Contents',...
    'callback','nndtoc')
  uicontrol(...
    'units','points',...
    'position',[400 75 60 20],...
    'string','Close',...
    'callback',[me '(''close'')'])

  % DATA POINTERS
  W1_ptr = uicontrol('visible','off','userdata',W1);
  P_ptr = uicontrol('visible','off','userdata',P);
  T_ptr = uicontrol('visible','off','userdata',T);
  PV_ptr = uicontrol('visible','off','userdata',PV);
  t_ptr = uicontrol('visible','off','userdata',[0;0]);
  WV_ptr = uicontrol('visible','off','userdata',WV);
  blip_ptr = uicontrol('visible','off','userdata',blip);
  bloop_ptr = uicontrol('visible','off','userdata',bloop);

  % SAVE WINDOW DATA AND LOCK
  H = [fig_axis desc_text v_axis t1_axis t2_axis,...
       W1_ptr P_ptr T_ptr PV_ptr t_ptr WV_ptr blip_ptr bloop_ptr];
  set(fig,'userdata',H,'nextplot','new')

  % INSTRUCTION TEXT
  feval(me,'instr');

  % LOCK WINDOW
  set(fig,...
   'nextplot','new',...
   'color',nnltgray);

  nnchkfs;

%==================================================================
% Display the instructions.
%
% ME('instr')
%==================================================================

elseif strcmp(cmd,'instr') & (fig)
  nnsettxt(desc_text,...
    'Click [Learn] to apply',...
    'the LVQ1 rule once.',...
    'Click [Train] to apply',...
    'the rule 5 times.',...
    'Click [Random] to get',...
    'random weights.',...
    '',...
    'Drag the blue and',...
    'black squares to define',...
    'different problems.',...
    '',...
    'Colors of crosses (wts)',...
    'and inside squares',...
    'indicate class. Red',...
    'edge indicates a',...
    'misclassified vector.')
    
%==================================================================
% Respond to mouse down.
%
% ME('down')
%==================================================================

elseif strcmp(cmd,'down') & (fig) & (nargin == 1)

  pt = get(v_axis,'currentpoint');
  x = pt(1);
  y = pt(3);

  % EDIT VECTOR AXIS
  if (x >= -p_max) & (x <= p_max) & (y >= -p_max) & (y <= p_max)

    % EDIT INPUT/TARGET DOT
    P = get(P_ptr,'userdata');
    T = get(T_ptr,'userdata');
    PV = get(PV_ptr,'userdata');
    WV = get(WV_ptr,'userdata');

    Q = size(P,2);
    for q=1:Q

      if sqrt(sum((P(:,q)-[x; y]).^2)) < 0.15
        t = T(:,q);        
        set(PV(q),...
          'facecolor',nnltyell,...
          'edgecolor',nnltyell);
        delete(PV(q));
        P(:,q) = [];
        T(:,q) = [];
        PV(:,q) = [];

        set(fig,...
         'pointer','cross',...
         'WindowButtonUpFcn',[me '(''setdot'')'])

        set(P_ptr,'userdata',P);
        set(T_ptr,'userdata',T);
        set(PV_ptr,'userdata',PV);
        set(t_ptr,'userdata',t);

        set(WV,'visible','off')
        for i=length(WV):-1:1
          set(WV(i),'visible','on')
        end
        break;
      end
    end
  
  % NEW SQUARE
  else
    pt = get(t1_axis,'currentpoint');
    x = pt(1);
    y = pt(3);

    % BLACK SQUARE
    if (x >= -.15) & (x <= .15) & (y >= -.15) & (y <= .15)
       set(fig,...
       'pointer','circle',...
       'WindowButtonUpFcn',[me '(''setdot'')'])
      set(t_ptr,'userdata',[1;0]);
    
    else
      pt = get(t2_axis,'currentpoint');
      x = pt(1);
      y = pt(3);

      % WHITE SQUARE
      if (x >= -.15) & (x <= .15) & (y >= -.15) & (y <= .15)
         set(fig,...
         'pointer','circle',...
         'WindowButtonUpFcn',[me '(''setdot'')'])
        set(t_ptr,'userdata',[0;1]);
      end
    end
  end

%==================================================================
% Set decision dot.
%
% ME('setdot')
%==================================================================

elseif strcmp(cmd,'setdot') & (fig) & (nargin == 1)

  pt = get(v_axis,'currentpoint');
  x = pt(1);
  x = round(x*2)/2;
  y = pt(3);
  y = round(y*2)/2;

  if (x >= -p_max) & (x <= p_max) & (y >= -p_max) & (y <= p_max)
    P = get(P_ptr,'userdata');
    T = get(T_ptr,'userdata');
    W1 = get(W1_ptr,'userdata');
    PV = get(PV_ptr,'userdata');
    t = get(t_ptr,'userdata');
    WV = get(WV_ptr,'userdata');
    
    q = size(PV,2)+1;
    set(fig,'nextplot','add');
    axes(v_axis);

    P = [P [x;y]];
    T = [T t];

    A1 = compet(-dist(W1,P));
    A2 = W2*A1;
    E = T-A2;

    if E(1,q)
      edge_color = nnred;
    else
      edge_color = nndkgray;
    end
    PV(q) = fill(box_x+x,box_y+y,center_colors(1+T(1,q),:),...
      'edgecolor',edge_color,...
      'erasemode','none',...
      'linewidth',2);
    set(fig,'nextplot','new');
  
    set(P_ptr,'userdata',P);
    set(T_ptr,'userdata',T);
    set(PV_ptr,'userdata',PV);

    set(WV,'visible','off')
    for i=length(WV):-1:1
      set(WV(i),'visible','on')
    end
  end

  set(fig,...
    'pointer','arrow',...
    'WindowButtonUpFcn','')
    
%==================================================================
% Learn.
%
% ME('learn')
%==================================================================

elseif strcmp(cmd,'learn')
  
  max_epoch = 1;
  cmd = 'train';

%==================================================================
% Random weights.
%
% ME('random')
%==================================================================

elseif strcmp(cmd,'random')
  
  % GET DATA
  W1 = get(W1_ptr,'userdata');
  WV = get(WV_ptr,'userdata');
  P = get(P_ptr,'userdata');
  T = get(T_ptr,'userdata');
  PV = get(PV_ptr,'userdata');
  blip = get(blip_ptr,'userdata');
  bloop = get(bloop_ptr,'userdata');
  Q = size(P,2);

  % MOVE WEIGHTS
  set(WV,'color',nngreen);
  nnsound(blip);
  nnpause(0.5)
 
  W1 = (rand(4,2)*2-1)*1.25;
  set(WV,'color',nnltyell);
  set(WV,'visible','off');
  for i=length(WV):-1:1
    set(WV(i),...
      'xdata',cross_x + W1(i,1),...
      'ydata',cross_y + W1(i,2),...
      'color',center_colors(1+W2(1,i),:));
    set(WV(i),'visible','on')
    nnsound(bloop);
  end

  % REDRAW INPUT VECTORS
  A1 = compet(-dist(W1,P));
  A2 = W2*A1;
  E = T-A2;
  for q=1:Q
    if E(1,q)
     edge_color = nnred;
    else
      edge_color = nndkgray;
    end
    set(PV(q),...
      'facecolor',center_colors(1+T(1,q),:),...
      'edgecolor',edge_color);
  end

  % REFRESH WEIGHT VECTORS
  set(WV,'visible','off')
  for i=length(WV):-1:1
    set(WV(i),'visible','on')
  end

  % SAVE DATA
  set(W1_ptr,'userdata',W1);

%==================================================================
end

%==================================================================
% Train.
%
% ME('train')
%==================================================================

if strcmp(cmd,'train')
  
  % GET DATA
  W1 = get(W1_ptr,'userdata');
  WV = get(WV_ptr,'userdata');
  P = get(P_ptr,'userdata');
  T = get(T_ptr,'userdata');
  PV = get(PV_ptr,'userdata');
  Q = length(PV);
  if (q == 0)
    return
  end
  blip = get(blip_ptr,'userdata');
  bloop = get(bloop_ptr,'userdata');
  axes(v_axis)
  set(fig,'nextplot','add')

  for i=1:max_epoch
    
    % GENERATE SOME RANDOM NUMBERS
    rand(1,ceil(rand*5));

    % CHECK ERROR
    A1 = compet(-dist(W1,P));
    A2 = W2*A1;
    E = T-A2;
    if ~any(any(E)) & (max_epoch > 1) & 0, break, end
    
    % PRESENT VECTOR
    q = floor(rand*Q)+1;
    p = P(:,q);
    t = T(:,q);
    a1 = compet(-dist(W1,p));
    a2 = W2*a1;
    e = t-a2;
    set(PV(q),'facecolor',nngreen);
    nnsound(blip);
    nnpause(0.5)

    % MOVE WEIGHT
    i = find(a1);
    if any(e)
      face_color = nnred;
    else
      face_color = nngreen;
    end
    set(WV(i),'color',face_color);
    nnsound(blip);
    nnpause(0.5)
 
    e = W2'*t;
    i = find(a1);
    newW1 = W1;
    newW1(i,:) = W1(i,:) + (e(i)*2-1)*feval('learnis',W1(i,:),p,a1(i),lr);

    temp = nndrwvec([W1(i,1) newW1(i,1)],[W1(i,2) newW1(i,2)],...
      1,0.2,face_color,'','none');
    nnsound(blip);
    nnpause(1)
    set(temp,'color',nnltyell)
    delete(temp);
    W1 = newW1;

    plotW1 = W1(i,:);
    set(WV(i),'color',nnltyell);
    set(WV(i),'visible','off');
    set(WV(i),...
      'xdata',cross_x + plotW1(1),...
      'ydata',cross_y + plotW1(2),...
      'color',center_colors(1+W2(1,i),:));
    set(WV(i),'visible','on')
    nnsound(bloop);

    % REDRAW INPUT VECTORS
    A1 = compet(-dist(W1,P));
    A2 = W2*A1;
    E = T-A2;
    for q=1:Q
      if E(1,q)
       edge_color = nnred;
      else
        edge_color = nndkgray;
      end
      set(PV(q),...
        'facecolor',center_colors(1+T(1,q),:),...
        'edgecolor',edge_color);
    end
  
    % REFRESH WEIGHT VECTORS
    set(WV,'visible','off')
    for i=length(WV):-1:1
      set(WV(i),'visible','on')
    end
  end
 
  set(W1_ptr,'userdata',W1);
  set(fig,'nextplot','new')
end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品欧美福利在线观看| 欧美高清dvd| 精品少妇一区二区三区在线播放| 青青草原综合久久大伊人精品 | 欧美日韩不卡一区| 夜夜精品浪潮av一区二区三区| 色婷婷久久综合| 亚洲国产裸拍裸体视频在线观看乱了| 欧洲一区二区三区在线| 亚洲国产三级在线| 在线播放一区二区三区| 精彩视频一区二区| 中文一区一区三区高中清不卡| 色综合久久天天| 调教+趴+乳夹+国产+精品| 欧美精品一区二区三区蜜臀| 欧美日韩免费观看一区二区三区| 亚洲欧美综合在线精品| 欧美在线视频不卡| 麻豆91精品91久久久的内涵| 久久精品人人做人人爽人人| 日本高清成人免费播放| 麻豆精品一区二区综合av| 欧美国产国产综合| 欧美久久一二区| 丁香六月综合激情| 婷婷国产在线综合| 国产精品欧美久久久久一区二区| 欧美亚洲日本国产| 国产一区 二区 三区一级| 亚洲另类在线一区| 久久夜色精品国产噜噜av| 91极品视觉盛宴| 国产在线一区观看| 亚洲高清不卡在线观看| 国产午夜精品久久久久久久 | 国产精品福利一区| 9191久久久久久久久久久| 99久久久精品| 精品无人码麻豆乱码1区2区| 91蝌蚪porny九色| 亚洲午夜精品在线| 欧美激情一区二区在线| 欧美日韩精品二区第二页| 国产精华液一区二区三区| 日韩国产高清在线| 国产精品久久一卡二卡| 日韩精品一区二区三区视频播放 | 91麻豆自制传媒国产之光| 久久99久久99小草精品免视看| 中文字幕中文字幕一区| 欧美精品一区二区精品网| 在线免费不卡视频| 成人av资源网站| 国产乱人伦偷精品视频免下载| 五月婷婷激情综合网| 亚洲视频精选在线| 欧美激情中文不卡| 久久久久久免费| 日韩视频一区在线观看| 精品日韩99亚洲| 在线播放日韩导航| 欧美丝袜丝交足nylons| 99视频精品在线| 国产不卡视频在线观看| 国内精品在线播放| 美脚の诱脚舐め脚责91| 琪琪一区二区三区| 偷偷要91色婷婷| 午夜精品免费在线观看| 亚洲电影一区二区三区| 亚洲欧美偷拍另类a∨色屁股| 欧美国产一区在线| 国产精品性做久久久久久| 精品亚洲porn| 欧美aⅴ一区二区三区视频| 亚洲午夜精品在线| 一区二区三区在线播| 中文字幕视频一区| 国产精品久久久久影院亚瑟 | 精品在线免费视频| 蜜桃视频在线观看一区| 蜜臀av性久久久久蜜臀aⅴ四虎| 视频一区中文字幕国产| 视频在线在亚洲| 免费看欧美女人艹b| 久久成人麻豆午夜电影| 国产一区二区日韩精品| 成人妖精视频yjsp地址| av在线不卡网| 欧美日韩一区二区三区四区五区 | 在线免费精品视频| 日韩一级成人av| 3d动漫精品啪啪| 欧美一区二区在线免费播放| 欧美成人艳星乳罩| 久久综合狠狠综合久久激情| 国产欧美一区二区在线观看| 《视频一区视频二区| 樱桃视频在线观看一区| 青青草视频一区| 国产成人综合亚洲91猫咪| 波多野结衣视频一区| 在线日韩av片| 欧美xxxxx牲另类人与| 国产精品天干天干在线综合| 亚洲日韩欧美一区二区在线| 天堂久久一区二区三区| 久久9热精品视频| 99久久国产综合精品麻豆| 欧美日韩一区二区三区不卡| 日韩欧美黄色影院| 自拍偷拍欧美激情| 秋霞影院一区二区| 成人永久免费视频| 欧美日韩一区二区三区不卡| 久久九九久精品国产免费直播| 色老头久久综合| 成人看片黄a免费看在线| av不卡免费电影| 日韩免费在线观看| 亚洲三级久久久| 黄色小说综合网站| 欧美日韩国产免费一区二区| 国产欧美一区二区三区在线老狼| 一区二区高清免费观看影视大全 | 午夜欧美视频在线观看| 狠狠色丁香久久婷婷综合丁香| 91麻豆国产香蕉久久精品| 日韩欧美自拍偷拍| 亚洲男人电影天堂| 高清shemale亚洲人妖| 日韩三级高清在线| 一区二区三区美女| 国产69精品久久久久毛片| 欧美精品亚洲二区| 亚洲人午夜精品天堂一二香蕉| 麻豆成人综合网| 欧美曰成人黄网| 国产精品系列在线| 国产精品伊人色| 日韩免费视频一区二区| 一区二区三区欧美在线观看| 懂色av一区二区三区免费观看| 日韩一级精品视频在线观看| 亚洲一区电影777| 欧美高清在线一区二区| 爽爽淫人综合网网站| 972aa.com艺术欧美| 日本一区二区视频在线| 国模冰冰炮一区二区| 日韩一区二区三区电影在线观看| 亚洲成av人在线观看| 色综合久久88色综合天天| 国产精品不卡在线| av午夜一区麻豆| 国产精品热久久久久夜色精品三区| 极品少妇一区二区| 日韩美一区二区三区| 美脚の诱脚舐め脚责91| 日韩欧美一区二区免费| 欧美a级一区二区| 欧美一区二区日韩| 日韩av中文在线观看| 91精品在线免费观看| 图片区小说区区亚洲影院| 欧美日韩黄视频| 五月天激情小说综合| 欧美精品一级二级三级| 日韩精品电影一区亚洲| 欧美肥大bbwbbw高潮| 国内精品久久久久影院色| 精品久久久久久久久久久久久久久 | 国产精品美女久久久久久2018| 麻豆成人免费电影| 日韩欧美一二三四区| 极品销魂美女一区二区三区| 欧美精品一区二区三区高清aⅴ | 日韩电影在线看| 日韩免费性生活视频播放| 国内成+人亚洲+欧美+综合在线| 精品三级av在线| 成人精品亚洲人成在线| 成人欧美一区二区三区1314| 色天使色偷偷av一区二区| 亚洲伊人伊色伊影伊综合网| 欧美日韩久久久一区| 日韩成人一级片| 欧美sm美女调教| 国产一区免费电影| 中文字幕在线不卡国产视频| 色8久久精品久久久久久蜜| 亚洲国产wwwccc36天堂| 日韩欧美成人一区二区| 国产精品18久久久久久vr| ●精品国产综合乱码久久久久| 26uuu另类欧美亚洲曰本| 欧美一区二区三区视频在线| 日韩电影在线观看网站| 欧美成人在线直播|