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

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

?? multilayerperceptron.java

?? Weka
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/* *    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. *//* *    MultilayerPerceptron.java *    Copyright (C) 2000 University of Waikato, Hamilton, New Zealand */package weka.classifiers.functions;import weka.classifiers.Classifier;import weka.classifiers.functions.neural.LinearUnit;import weka.classifiers.functions.neural.NeuralConnection;import weka.classifiers.functions.neural.NeuralNode;import weka.classifiers.functions.neural.SigmoidUnit;import weka.core.Capabilities;import weka.core.FastVector;import weka.core.Instance;import weka.core.Instances;import weka.core.Option;import weka.core.OptionHandler;import weka.core.Utils;import weka.core.WeightedInstancesHandler;import weka.core.Capabilities.Capability;import weka.filters.Filter;import weka.filters.unsupervised.attribute.NominalToBinary;import java.awt.BorderLayout;import java.awt.Color;import java.awt.Component;import java.awt.Dimension;import java.awt.FontMetrics;import java.awt.Graphics;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.event.MouseAdapter;import java.awt.event.MouseEvent;import java.awt.event.WindowAdapter;import java.awt.event.WindowEvent;import java.util.Enumeration;import java.util.Random;import java.util.StringTokenizer;import java.util.Vector;import javax.swing.BorderFactory;import javax.swing.Box;import javax.swing.BoxLayout;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JScrollPane;import javax.swing.JTextField;/**  <!-- globalinfo-start --> * A Classifier that uses backpropagation to classify instances.<br/> * This network can be built by hand, created by an algorithm or both. The network can also be monitored and modified during training time. The nodes in this network are all sigmoid (except for when the class is numeric in which case the the output nodes become unthresholded linear units). * <p/> <!-- globalinfo-end --> * <!-- options-start --> * Valid options are: <p/> *  * <pre> -L &lt;learning rate&gt; *  Learning Rate for the backpropagation algorithm. *  (Value should be between 0 - 1, Default = 0.3).</pre> *  * <pre> -M &lt;momentum&gt; *  Momentum Rate for the backpropagation algorithm. *  (Value should be between 0 - 1, Default = 0.2).</pre> *  * <pre> -N &lt;number of epochs&gt; *  Number of epochs to train through. *  (Default = 500).</pre> *  * <pre> -V &lt;percentage size of validation set&gt; *  Percentage size of validation set to use to terminate *  training (if this is non zero it can pre-empt num of epochs. *  (Value should be between 0 - 100, Default = 0).</pre> *  * <pre> -S &lt;seed&gt; *  The value used to seed the random number generator *  (Value should be &gt;= 0 and and a long, Default = 0).</pre> *  * <pre> -E &lt;threshold for number of consequetive errors&gt; *  The consequetive number of errors allowed for validation *  testing before the netwrok terminates. *  (Value should be &gt; 0, Default = 20).</pre> *  * <pre> -G *  GUI will be opened. *  (Use this to bring up a GUI).</pre> *  * <pre> -A *  Autocreation of the network connections will NOT be done. *  (This will be ignored if -G is NOT set)</pre> *  * <pre> -B *  A NominalToBinary filter will NOT automatically be used. *  (Set this to not use a NominalToBinary filter).</pre> *  * <pre> -H &lt;comma seperated numbers for nodes on each layer&gt; *  The hidden layers to be created for the network. *  (Value should be a list of comma separated Natural  *  numbers or the letters 'a' = (attribs + classes) / 2,  *  'i' = attribs, 'o' = classes, 't' = attribs .+ classes) *  for wildcard values, Default = a).</pre> *  * <pre> -C *  Normalizing a numeric class will NOT be done. *  (Set this to not normalize the class if it's numeric).</pre> *  * <pre> -I *  Normalizing the attributes will NOT be done. *  (Set this to not normalize the attributes).</pre> *  * <pre> -R *  Reseting the network will NOT be allowed. *  (Set this to not allow the network to reset).</pre> *  * <pre> -D *  Learning rate decay will occur. *  (Set this to cause the learning rate to decay).</pre> *  <!-- options-end --> * * @author Malcolm Ware (mfw4@cs.waikato.ac.nz) * @version $Revision: 1.11 $ */public class MultilayerPerceptron   extends Classifier   implements OptionHandler, WeightedInstancesHandler {    /** for serialization */  static final long serialVersionUID = 572250905027665169L;    /**   * Main method for testing this class.   *   * @param argv should contain command line options (see setOptions)   */  public static void main(String [] argv) {    runClassifier(new MultilayerPerceptron(), argv);  }    /**    * This inner class is used to connect the nodes in the network up to   * the data that they are classifying, Note that objects of this class are   * only suitable to go on the attribute side or class side of the network   * and not both.   */  protected class NeuralEnd     extends NeuralConnection {        /** for serialization */    static final long serialVersionUID = 7305185603191183338L;      /**      * the value that represents the instance value this node represents.      * For an input it is the attribute number, for an output, if nominal     * it is the class value.      */    private int m_link;        /** True if node is an input, False if it's an output. */    private boolean m_input;    /**     * Constructor     */    public NeuralEnd(String id) {      super(id);      m_link = 0;      m_input = true;          }      /**     * Call this function to determine if the point at x,y is on the unit.     * @param g The graphics context for font size info.     * @param x The x coord.     * @param y The y coord.     * @param w The width of the display.     * @param h The height of the display.     * @return True if the point is on the unit, false otherwise.     */    public boolean onUnit(Graphics g, int x, int y, int w, int h) {            FontMetrics fm = g.getFontMetrics();      int l = (int)(m_x * w) - fm.stringWidth(m_id) / 2;      int t = (int)(m_y * h) - fm.getHeight() / 2;      if (x < l || x > l + fm.stringWidth(m_id) + 4 	  || y < t || y > t + fm.getHeight() + fm.getDescent() + 4) {	return false;      }      return true;          }       /**     * This will draw the node id to the graphics context.     * @param g The graphics context.     * @param w The width of the drawing area.     * @param h The height of the drawing area.     */    public void drawNode(Graphics g, int w, int h) {            if ((m_type & PURE_INPUT) == PURE_INPUT) {	g.setColor(Color.green);      }      else {	g.setColor(Color.orange);      }            FontMetrics fm = g.getFontMetrics();      int l = (int)(m_x * w) - fm.stringWidth(m_id) / 2;      int t = (int)(m_y * h) - fm.getHeight() / 2;      g.fill3DRect(l, t, fm.stringWidth(m_id) + 4		   , fm.getHeight() + fm.getDescent() + 4		   , true);      g.setColor(Color.black);            g.drawString(m_id, l + 2, t + fm.getHeight() + 2);    }    /**     * Call this function to draw the node highlighted.     * @param g The graphics context.     * @param w The width of the drawing area.     * @param h The height of the drawing area.     */    public void drawHighlight(Graphics g, int w, int h) {            g.setColor(Color.black);      FontMetrics fm = g.getFontMetrics();      int l = (int)(m_x * w) - fm.stringWidth(m_id) / 2;      int t = (int)(m_y * h) - fm.getHeight() / 2;      g.fillRect(l - 2, t - 2, fm.stringWidth(m_id) + 8		 , fm.getHeight() + fm.getDescent() + 8);       drawNode(g, w, h);    }        /**     * 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) {	if (m_input) {	  if (m_currentInstance.isMissing(m_link)) {	    m_unitValue = 0;	  }	  else {	    	    m_unitValue = m_currentInstance.value(m_link);	  }	}	else {	  //node is an output.	  m_unitValue = 0;	  for (int noa = 0; noa < m_numInputs; noa++) {	    m_unitValue += m_inputList[noa].outputValue(true);	   	  }	  if (m_numeric && m_normalizeClass) {	    //then scale the value;	    //this scales linearly from between -1 and 1	    m_unitValue = m_unitValue * 	      m_attributeRanges[m_instances.classIndex()] + 	      m_attributeBases[m_instances.classIndex()];	  }	}      }      return m_unitValue;                }        /**     * Call this to get the error value of this unit, which in this case is     * the difference between the predicted class, and the actual class.     * @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) {		if (m_input) {	  m_unitError = 0;	  for (int noa = 0; noa < m_numOutputs; noa++) {	    m_unitError += m_outputList[noa].errorValue(true);	  }	}	else {	  if (m_currentInstance.classIsMissing()) {	    m_unitError = .1;  	  }	  else if (m_instances.classAttribute().isNominal()) {	    if (m_currentInstance.classValue() == m_link) {	      m_unitError = 1 - m_unitValue;	    }	    else {	      m_unitError = 0 - m_unitValue;	    }	  }	  else if (m_numeric) {	    	    if (m_normalizeClass) {	      if (m_attributeRanges[m_instances.classIndex()] == 0) {		m_unitError = 0;	      }	      else {		m_unitError = (m_currentInstance.classValue() - m_unitValue ) /		  m_attributeRanges[m_instances.classIndex()];		//m_numericRange;			      }	    }	    else {	      m_unitError = m_currentInstance.classValue() - m_unitValue;	    }	  }	}      }      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 function to set What this end unit represents.     * @param input True if this unit is used for entering an attribute,     * False if it's used for determining a class value.     * @param val The attribute number or class type that this unit represents.     * (for nominal attributes).     */    public void setLink(boolean input, int val) throws Exception {      m_input = input;            if (input) {	m_type = PURE_INPUT;      }      else {	m_type = PURE_OUTPUT;      }      if (val < 0 || (input && val > m_instances.numAttributes()) 	  || (!input && m_instances.classAttribute().isNominal() 	      && val > m_instances.classAttribute().numValues())) {	m_link = 0;      }      else {	m_link = val;      }    }        /**     * @return link for this node.     */    public int getLink() {      return m_link;    }      }     /** Inner class used to draw the nodes onto.(uses the node lists!!)    * This will also handle the user input. */  private class NodePanel     extends JPanel {        /** for serialization */    static final long serialVersionUID = -3067621833388149984L;    /**     * The constructor.     */    public NodePanel() {            addMouseListener(new MouseAdapter() {	  	  public void mousePressed(MouseEvent e) {	    	    if (!m_stopped) {	      return;	    }	    if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == MouseEvent.BUTTON1_MASK && 		!e.isAltDown()) {	      Graphics g = NodePanel.this.getGraphics();	      int x = e.getX();	      int y = e.getY();	      int w = NodePanel.this.getWidth();	      int h = NodePanel.this.getHeight();	      FastVector tmp = new FastVector(4);	      for (int noa = 0; noa < m_numAttributes; noa++) {		if (m_inputs[noa].onUnit(g, x, y, w, h)) {		  tmp.addElement(m_inputs[noa]);		  selection(tmp, 			    (e.getModifiers() & MouseEvent.CTRL_MASK) == MouseEvent.CTRL_MASK

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色先锋aa成人| jizzjizzjizz欧美| 亚洲摸摸操操av| 美国av一区二区| 日韩欧美亚洲一区二区| 国产精品传媒入口麻豆| 欧美一区二区成人| 国产黄色91视频| 免费成人深夜小野草| 亚洲视频在线观看三级| 久久久夜色精品亚洲| 日韩一区二区三区视频在线观看| 色综合天天综合色综合av| 国产精品一区二区视频| 日本视频免费一区| 亚洲成人资源网| 91精品国产色综合久久久蜜香臀| 91国产丝袜在线播放| 亚洲欧美日韩国产一区二区三区| 久久久99精品免费观看不卡| 精品国产污网站| 日韩亚洲国产中文字幕欧美| 欧美色图免费看| 欧美日韩一区在线观看| 欧美综合色免费| 欧美一区二区三区在线观看| 成人午夜免费av| 国产激情偷乱视频一区二区三区| 国产一区 二区 三区一级| 国产原创一区二区| 国产成人亚洲精品青草天美| 成人毛片视频在线观看| 99免费精品在线| 欧美日韩午夜精品| 欧美一区二区免费视频| 欧美精品一区二区三区在线播放| 精品国产网站在线观看| 99精品视频在线观看| 亚洲成av人影院| 麻豆国产精品一区二区三区 | 亚洲三级在线免费| 国产精品色噜噜| 国产精品一区二区你懂的| 午夜激情一区二区三区| 毛片不卡一区二区| 国产盗摄一区二区三区| 99久久婷婷国产综合精品电影| 欧美三级中文字幕| 精品国产自在久精品国产| 国产精品视频你懂的| 一区二区三区资源| 奇米精品一区二区三区四区| 亚洲老司机在线| av综合在线播放| 午夜欧美电影在线观看| 久久国产精品99久久久久久老狼 | 色94色欧美sute亚洲线路一ni| 欧美精品成人一区二区三区四区| 日韩精品在线一区二区| 亚洲精品少妇30p| 91蜜桃网址入口| 国产精品网站在线观看| 一区二区三区中文字幕| 国产综合一区二区| 欧美色老头old∨ideo| 中文字幕国产一区| 久久国产精品99精品国产| 欧美在线制服丝袜| 中国色在线观看另类| 日韩免费电影网站| 欧美激情一区二区三区不卡| 日韩av成人高清| 欧美日韩国产电影| 欧美午夜理伦三级在线观看| 欧美亚洲综合另类| 日韩一区欧美一区| 成人激情免费网站| 久久久不卡网国产精品一区| 日韩国产精品91| 欧美午夜不卡视频| 亚洲免费观看高清完整版在线| 成人性生交大片免费看中文| 国产亚洲美州欧州综合国| 精品一区二区三区免费| 欧美成人精品1314www| 老汉av免费一区二区三区| 国产精品女主播av| 亚洲精品免费在线| 91麻豆国产在线观看| 亚洲色图欧洲色图| 在线观看不卡一区| 亚洲高清视频在线| 欧美顶级少妇做爰| 日本欧美加勒比视频| 日韩精品自拍偷拍| 另类小说视频一区二区| 久久影院午夜片一区| 国产宾馆实践打屁股91| 中文字幕一区二区三区色视频| 色综合网站在线| 午夜欧美电影在线观看| 精品国产免费一区二区三区香蕉| 国产在线精品一区二区三区不卡| 欧美激情一区二区三区| 一本色道久久综合亚洲aⅴ蜜桃| 亚洲高清免费一级二级三级| 日韩午夜电影av| 国产69精品久久99不卡| 亚洲午夜影视影院在线观看| 欧美xfplay| 91欧美一区二区| 欧美在线短视频| 亚洲在线视频一区| 成人精品国产一区二区4080| 夜夜操天天操亚洲| www国产亚洲精品久久麻豆| 91影院在线观看| 精品无人区卡一卡二卡三乱码免费卡| 欧美激情一区在线| 欧美日韩国产123区| 国产一区二区三区免费| 亚洲国产乱码最新视频| 91精品国产综合久久精品app| 国产一区日韩二区欧美三区| 亚洲精品videosex极品| 国产无一区二区| 成人黄色在线看| 日本成人在线网站| 一区二区免费视频| 国产网站一区二区| 制服丝袜一区二区三区| 色婷婷综合久色| 不卡视频免费播放| 国产一区二区三区四区五区入口| 五月天久久比比资源色| 欧美日韩大陆在线| 成人夜色视频网站在线观看| 欧美一级免费观看| 麻豆精品在线看| 日本在线观看不卡视频| 一区二区三区精品| 亚洲人亚洲人成电影网站色| 精品久久久网站| 欧美电视剧在线看免费| 51精品国自产在线| 欧美亚洲丝袜传媒另类| 91碰在线视频| 91久久奴性调教| 99国产精品久久久| 99久久国产综合色|国产精品| 国产黄色精品网站| 夜夜嗨av一区二区三区四季av| 国产亚洲婷婷免费| 99这里只有久久精品视频| 国产中文字幕一区| 国产夫妻精品视频| av不卡在线播放| 色香色香欲天天天影视综合网| 91浏览器在线视频| 欧美丝袜自拍制服另类| 91精品国产欧美一区二区成人| 欧美日韩精品三区| 日韩精品最新网址| 91高清在线观看| 欧美一级夜夜爽| 国产亚洲精品免费| 1区2区3区欧美| 亚洲h精品动漫在线观看| 日韩电影在线一区| 久99久精品视频免费观看| 国产a视频精品免费观看| 91老师国产黑色丝袜在线| 欧美日韩小视频| 26uuu国产一区二区三区| 国产精品久久久久影院色老大| 亚洲国产日日夜夜| 精品亚洲成a人| 日本高清不卡aⅴ免费网站| 日韩一本二本av| 亚洲欧美韩国综合色| 亚洲综合免费观看高清在线观看| 七七婷婷婷婷精品国产| 成人午夜私人影院| 国产专区综合网| 91丨porny丨最新| 2欧美一区二区三区在线观看视频| 亚洲欧美综合色| 国内国产精品久久| 色八戒一区二区三区| 欧美国产日韩一二三区| 日本不卡视频一二三区| 色网综合在线观看| 国产日韩在线不卡| 日本不卡视频一二三区| 在线一区二区三区| 亚洲手机成人高清视频| 91精品国产综合久久久久久久| 精品电影一区二区三区| 亚洲6080在线| 欧美在线影院一区二区|