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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? neuralnode.java

?? MacroWeka擴(kuò)展了著名數(shù)據(jù)挖掘工具weka
?? JAVA
字號(hào):
/*
 *    This program is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 2 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program; if not, write to the Free Software
 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/*
 *    NeuralNode.java
 *    Copyright (C) 2000 Malcolm Ware
 */

package weka.classifiers.functions.neural;


import java.util.Random;

/**
 * This class is used to represent a node in the neuralnet.
 * @author Malcolm Ware (mfw4@cs.waikato.ac.nz)
 * @version $Revision: 1.1 $
 */
public class NeuralNode extends NeuralConnection {
    
  /** The weights for each of the input connections, and the threshold. */
  private double[] m_weights;
  
  /** The change in the weights. */
  private double[] m_changeInWeights;
  
  private Random m_random;

  /** Performs the operations for this node. Currently this
   * defines that the node is either a sigmoid or a linear unit. */
  private NeuralMethod m_methods;

  /** 
   * @param id The string name for this node (used to id this node).
   * @param r A random number generator used to generate initial weights.
   * @param m The methods this node should use to update.
   */
  public NeuralNode(String id, Random r, NeuralMethod m) {
    super(id);
    m_weights = new double[1];
    m_changeInWeights = new double[1];
    
    m_random = r;
    
    m_weights[0] = m_random.nextDouble() * .1 - .05;
    m_changeInWeights[0] = 0;

    m_methods = m;
  }
  
  /**
   * Set how this node should operate (note that the neural method has no
   * internal state, so the same object can be used by any number of nodes.
   * @param m The new method.
   */
  public void setMethod(NeuralMethod m) {
    m_methods = m;
  } 

  public NeuralMethod getMethod() {
    return m_methods;
  }

  /**
   * Call this to get the output value of this unit. 
   * @param calculate True if the value should be calculated if it hasn't been
   * already.
   * @return The output value, or NaN, if the value has not been calculated.
   */
  public double outputValue(boolean calculate) {
    
    if (Double.isNaN(m_unitValue) && calculate) {
      //then calculate the output value;
      m_unitValue = m_methods.outputValue(this);
    }
    
    return m_unitValue;
  }

  
  /**
   * Call this to get the error value of this unit.
   * @param calculate True if the value should be calculated if it hasn't been
   * already.
   * @return The error value, or NaN, if the value has not been calculated.
   */
  public double errorValue(boolean calculate) {

    if (!Double.isNaN(m_unitValue) && Double.isNaN(m_unitError) && calculate) {
      //then calculate the error.
      m_unitError = m_methods.errorValue(this);
    }
    return m_unitError;
  }

  /**
   * Call this to reset the value and error for this unit, ready for the next
   * run. This will also call the reset function of all units that are 
   * connected as inputs to this one.
   * This is also the time that the update for the listeners will be performed.
   */
  public void reset() {
    
    if (!Double.isNaN(m_unitValue) || !Double.isNaN(m_unitError)) {
      m_unitValue = Double.NaN;
      m_unitError = Double.NaN;
      m_weightsUpdated = false;
      for (int noa = 0; noa < m_numInputs; noa++) {
	m_inputList[noa].reset();
      }
    }
  }

  /**
   * Call this to get the weight value on a particular connection.
   * @param n The connection number to get the weight for, -1 if The threshold
   * weight should be returned.
   * @return The value for the specified connection or if -1 then it should 
   * return the threshold value. If no value exists for the specified 
   * connection, NaN will be returned.
   */
  public double weightValue(int n) {
    if (n >= m_numInputs || n < -1) {
      return Double.NaN;
    }
    return m_weights[n + 1];
  }

  /**
   * call this function to get the weights array.
   * This will also allow the weights to be updated.
   * @return The weights array.
   */
  public double[] getWeights() {
    return m_weights;
  }

  /**
   * call this function to get the chnage in weights array.
   * This will also allow the change in weights to be updated.
   * @return The change in weights array.
   */
  public double[] getChangeInWeights() {
    return m_changeInWeights;
  }

  /**
   * Call this function to update the weight values at this unit.
   * After the weights have been updated at this unit, All the
   * input connections will then be called from this to have their
   * weights updated.
   * @param l The learning rate to use.
   * @param m The momentum to use.
   */
  public void updateWeights(double l, double m) {
    
    if (!m_weightsUpdated && !Double.isNaN(m_unitError)) {
      m_methods.updateWeights(this, l, m);
     
      //note that the super call to update the inputs is done here and
      //not in the m_method updateWeights, because it is not deemed to be
      //required to update the weights at this node (while the error and output
      //value ao need to be recursively calculated)
      super.updateWeights(l, m); //to call all of the inputs.
    }
    
  }

  /**
   * This will connect the specified unit to be an input to this unit.
   * @param i The unit.
   * @param n It's connection number for this connection.
   * @return True if the connection was made, false otherwise.
   */
  protected boolean connectInput(NeuralConnection i, int n) {
    
    //the function that this overrides can do most of the work.
    if (!super.connectInput(i, n)) {
      return false;
    }
    
    //note that the weights are shifted 1 forward in the array so
    //it leaves the numinputs aligned on the space the weight needs to go.
    m_weights[m_numInputs] = m_random.nextDouble() * .1 - .05;
    m_changeInWeights[m_numInputs] = 0;
    
    return true;
  }

  /**
   * This will allocate more space for input connection information
   * if the arrays for this have been filled up.
   */
  protected void allocateInputs() {
    
    NeuralConnection[] temp1 = new NeuralConnection[m_inputList.length + 15];
    int[] temp2 = new int[m_inputNums.length + 15];
    double[] temp4 = new double[m_weights.length + 15];
    double[] temp5 = new double[m_changeInWeights.length + 15];

    temp4[0] = m_weights[0];
    temp5[0] = m_changeInWeights[0];
    for (int noa = 0; noa < m_numInputs; noa++) {
      temp1[noa] = m_inputList[noa];
      temp2[noa] = m_inputNums[noa];
      temp4[noa+1] = m_weights[noa+1];
      temp5[noa+1] = m_changeInWeights[noa+1];
    }
    
    m_inputList = temp1;
    m_inputNums = temp2;
    m_weights = temp4;
    m_changeInWeights = temp5;
  }

  
  

  /**
   * This will disconnect the input with the specific connection number
   * From this node (only on this end however).
   * @param i The unit to disconnect.
   * @param n The connection number at the other end, -1 if all the connections
   * to this unit should be severed (not the same as removeAllInputs).
   * @return True if the connection was removed, false if the connection was 
   * not found.
   */
  protected boolean disconnectInput(NeuralConnection i, int n) {
    
    int loc = -1;
    boolean removed = false;
    do {
      loc = -1;
      for (int noa = 0; noa < m_numInputs; noa++) {
	if (i == m_inputList[noa] && (n == -1 || n == m_inputNums[noa])) {
	  loc = noa;
	  break;
	}
      }
      
      if (loc >= 0) {
	for (int noa = loc+1; noa < m_numInputs; noa++) {
	  m_inputList[noa-1] = m_inputList[noa];
	  m_inputNums[noa-1] = m_inputNums[noa];
	  
	  m_weights[noa] = m_weights[noa+1];
	  m_changeInWeights[noa] = m_changeInWeights[noa+1];
	  
	  m_inputList[noa-1].changeOutputNum(m_inputNums[noa-1], noa-1);
	}
	m_numInputs--;
	removed = true;
      }      
    } while (n == -1 && loc != -1);
    return removed;
  }
  
  /**
   * This function will remove all the inputs to this unit.
   * In doing so it will also terminate the connections at the other end.
   */
  public void removeAllInputs() {
    super.removeAllInputs();
    
    double temp1 = m_weights[0];
    double temp2 = m_changeInWeights[0];

    m_weights = new double[1];
    m_changeInWeights = new double[1];

    m_weights[0] = temp1;
    m_changeInWeights[0] = temp2;
    
  }  

  
}













?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品全国免费观看高清| 欧美成人国产一区二区| 视频在线观看一区二区三区| 久久蜜桃av一区二区天堂| 91蝌蚪porny| 久久99国产精品麻豆| 亚洲欧美偷拍三级| 久久久亚洲精品石原莉奈| 欧美伊人久久久久久久久影院| 国产另类ts人妖一区二区| 日韩国产欧美在线播放| 亚洲麻豆国产自偷在线| 亚洲欧洲美洲综合色网| 欧美精品一区二区蜜臀亚洲| 欧美熟乱第一页| 色综合av在线| 99精品视频在线观看免费| 国产麻豆精品一区二区| 麻豆成人免费电影| 午夜视频在线观看一区二区三区| 亚洲精品ww久久久久久p站| 亚洲国产激情av| 国产无人区一区二区三区| 欧美成人一区二区三区片免费| 欧美伦理电影网| 欧美综合欧美视频| 欧美精品在欧美一区二区少妇| 91丨porny丨在线| 波多野结衣中文字幕一区二区三区| 国产乱理伦片在线观看夜一区| 久久99精品久久久久| 免费久久99精品国产| 日本在线不卡视频一二三区| 天堂午夜影视日韩欧美一区二区| 亚洲一区二区不卡免费| 亚洲激情av在线| 一区二区三区精密机械公司| 一区二区三区在线免费视频| 一区二区三区在线视频观看58 | 久久精品欧美一区二区三区不卡| 日韩欧美二区三区| 欧美变态凌虐bdsm| 精品少妇一区二区三区日产乱码 | 91小宝寻花一区二区三区| a级精品国产片在线观看| 99精品热视频| 色哟哟精品一区| 欧美三片在线视频观看| 欧美一区在线视频| 欧美va亚洲va| 国产日本一区二区| 亚洲欧美日韩久久| 亚洲h在线观看| 美女脱光内衣内裤视频久久网站| 国内成人精品2018免费看| 国产精品亚洲а∨天堂免在线| 成人深夜在线观看| 91极品视觉盛宴| 欧美一区二区私人影院日本| 精品对白一区国产伦| 亚洲国产成人自拍| 亚洲国产欧美在线人成| 蜜桃视频在线观看一区| 成人伦理片在线| 欧美系列在线观看| 精品久久久久久久久久久院品网 | 国产福利一区二区| 99久久夜色精品国产网站| 欧美在线观看视频在线| 日韩精品一区二区三区中文精品| 久久久精品欧美丰满| 亚洲人吸女人奶水| 日本欧美久久久久免费播放网| 国产成人无遮挡在线视频| 欧洲色大大久久| 亚洲精品一线二线三线| 日韩理论片网站| 美美哒免费高清在线观看视频一区二区 | 在线观看视频一区二区欧美日韩| 欧美mv日韩mv| 日韩电影免费一区| 久久国产精品色婷婷| 成人国产亚洲欧美成人综合网| 欧美日韩亚洲丝袜制服| 国产三级精品在线| 亚洲一区自拍偷拍| 精品午夜一区二区三区在线观看| 成人禁用看黄a在线| 欧美日本韩国一区| 中文字幕一区二区三区四区 | 青椒成人免费视频| 亚洲手机成人高清视频| 美女免费视频一区二区| 91麻豆.com| 精品国产乱码久久久久久久| 亚洲另类在线一区| 狠狠v欧美v日韩v亚洲ⅴ| 欧美午夜视频网站| 久久精品夜色噜噜亚洲aⅴ| 亚洲成人高清在线| av亚洲精华国产精华精| 欧美成人艳星乳罩| 亚洲午夜久久久久久久久久久| 国产成人一区在线| 精品美女一区二区| 午夜欧美视频在线观看 | 99视频在线精品| 欧美精品一区二区三区视频| 亚洲成人动漫av| 91在线视频官网| 国产日韩欧美a| 精品一区二区精品| 欧美一级专区免费大片| 亚洲福利视频导航| 色综合天天做天天爱| 中文字幕 久热精品 视频在线| 久久精品国产**网站演员| 欧美性受xxxx黑人xyx| 亚洲色欲色欲www| 成人免费观看男女羞羞视频| 久久久久国产免费免费| 久久成人久久爱| 日韩一卡二卡三卡国产欧美| 日韩av在线播放中文字幕| 欧美精品三级日韩久久| 亚洲综合自拍偷拍| 日本精品裸体写真集在线观看| 亚洲视频精选在线| av网站一区二区三区| 国产精品嫩草影院com| 国产精品中文字幕一区二区三区| 精品国产91乱码一区二区三区| 久久se精品一区二区| 日韩一级片在线观看| 日本三级韩国三级欧美三级| 日韩一区国产二区欧美三区| 蜜芽一区二区三区| 日韩欧美国产三级| 精品中文av资源站在线观看| 欧美大黄免费观看| 狠狠色综合色综合网络| 久久一夜天堂av一区二区三区| 免费欧美高清视频| 亚洲欧洲精品成人久久奇米网| 成人18视频日本| 国产精品美女www爽爽爽| 成人三级在线视频| 一区免费观看视频| 日本精品一区二区三区高清| 亚洲国产一区二区三区青草影视| 欧美亚洲自拍偷拍| 日韩影视精彩在线| 精品国产sm最大网站免费看| 国产精品一二一区| 亚洲欧美在线aaa| 欧美亚洲一区三区| 另类专区欧美蜜桃臀第一页| 久久九九国产精品| 91视频免费看| 午夜久久电影网| 久久综合九色综合欧美就去吻 | 东方aⅴ免费观看久久av| 国产精品初高中害羞小美女文 | 中文成人av在线| 日本高清视频一区二区| 日韩电影在线一区| 欧美激情综合五月色丁香| 在线观看一区二区视频| 蜜桃精品视频在线| 欧美激情一区二区三区| 欧美日韩精品一二三区| 国产成人夜色高潮福利影视| 亚洲国产成人高清精品| 久久伊99综合婷婷久久伊| 日本黄色一区二区| 国产在线视频一区二区三区| 伊人性伊人情综合网| 精品播放一区二区| 91亚洲午夜精品久久久久久| 蜜臀久久99精品久久久画质超高清| 国产精品拍天天在线| 这里只有精品免费| 91麻豆123| 国产在线国偷精品产拍免费yy| 伊人开心综合网| 久久精品人人做人人爽人人| 欧美麻豆精品久久久久久| 成人性生交大片免费看中文| 三级在线观看一区二区| 中文字幕一区不卡| 欧美变态tickle挠乳网站| 一本一道久久a久久精品| 国产综合一区二区| 午夜视黄欧洲亚洲| 亚洲欧洲在线观看av| 日韩一区二区三免费高清| 在线这里只有精品| av成人动漫在线观看| 国产一区二区三区久久悠悠色av| 亚洲成av人片一区二区|