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

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

?? testnn.java

?? 模式識別中神經網絡方法的實現
?? JAVA
字號:
/*	Copyright 2006, 2007 Brian Greer	This file is part of the Java NN Trainer.	Java NN Trainer 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.	Java NN Trainer 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 Java NN Trainer; if not, write to the Free Software	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA*/import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.util.HashMap;import problems.Problem;import problems.XOR;import problems.RealNumbers;import algorithms.*;public class TestNN extends JFrame implements ActionListener, Runnable, TrainerListener{	int width = 1000;	int height = 500;	int numHidden = 4;	double minError = 0.05;	int maxTrainers = 0;	int numRunning = 0;	Problem problem = null;	BackProp backProp = null;	QuickProp quickProp = null;	GA ga = null;	Pso pso = null;	JButton runButton = new JButton("Run");	JButton stopButton = new JButton("Stop");	JTextField numHiddenText = new JTextField();	JTextField minErrorText = new JTextField();	JCheckBox backPropRun = new JCheckBox("Run", true);	JTextField learningRateText = new JTextField();	JTextField momentumText = new JTextField();	JCheckBox quickPropRun = new JCheckBox("Run", true);	JTextField qpMomentumText = new JTextField();	JCheckBox gaRun = new JCheckBox("Run", true);	JTextField gaPopSize = new JTextField();	JTextField gaMutationRate = new JTextField();	JTextField gaCrossoverRate = new JTextField();	JCheckBox psoRun = new JCheckBox("Run", true);	JTextField psoNumAgents = new JTextField();	JTextField psoWeight = new JTextField();	JTextField psoMomentum = new JTextField();	JTextField psoMaxVelocity = new JTextField();	DefaultListModel bpListModel = new DefaultListModel();	JList bpOutputList = new JList(bpListModel);	DefaultListModel qpListModel = new DefaultListModel();	JList qpOutputList = new JList(qpListModel);	DefaultListModel gaListModel = new DefaultListModel();	JList gaOutputList = new JList(gaListModel);	DefaultListModel psoListModel = new DefaultListModel();	JList psoOutputList = new JList(psoListModel);	HashMap labelMap = new HashMap();	void init(){		numHiddenText.setText(Integer.toString(numHidden));		minErrorText.setText(Double.toString(minError));		learningRateText.setText(Double.toString(BackProp.DEFAULT_LEARNING_RATE));		momentumText.setText(Double.toString(BackProp.DEFAULT_MOMENTUM));		qpMomentumText.setText(Double.toString(QuickProp.DEFAULT_MOMENTUM));		gaPopSize.setText(Integer.toString(GA.MAX_POP));		gaMutationRate.setText(Double.toString(GA.MUTATION_RATE));		gaCrossoverRate.setText(Double.toString(GA.CROSSOVER_RATE));		psoNumAgents.setText(Integer.toString(Pso.MAX_AGENTS));		psoWeight.setText(Double.toString(Pso.DEFAULT_WEIGHT));		psoMomentum.setText(Double.toString(Pso.DEFAULT_MOMENTUM));		psoMaxVelocity.setText(Double.toString(Pso.DEFAULT_MAXVELOCITY));	}	public TestNN(){		setTitle("NN Training Test");		setSize(new Dimension(width, height));		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);		JPanel panel = new JPanel();		runButton.addActionListener(this);		panel.add(runButton);		stopButton.addActionListener(this);		stopButton.setEnabled(false);		panel.add(stopButton);		getContentPane().add(panel, BorderLayout.SOUTH);		int textWidth = 100;		int textHeight = 21;		numHiddenText.setPreferredSize(new Dimension(textWidth, textHeight));		minErrorText.setPreferredSize(new Dimension(textWidth, textHeight));		learningRateText.setPreferredSize(new Dimension(textWidth, textHeight));		momentumText.setPreferredSize(new Dimension(textWidth, textHeight));		qpMomentumText.setPreferredSize(new Dimension(textWidth, textHeight));		gaPopSize.setPreferredSize(new Dimension(textWidth, textHeight));		gaMutationRate.setPreferredSize(new Dimension(textWidth, textHeight));		gaCrossoverRate.setPreferredSize(new Dimension(textWidth, textHeight));		psoNumAgents.setPreferredSize(new Dimension(textWidth, textHeight));		psoWeight.setPreferredSize(new Dimension(textWidth, textHeight));		psoMomentum.setPreferredSize(new Dimension(textWidth, textHeight));		psoMaxVelocity.setPreferredSize(new Dimension(textWidth, textHeight));		panel = new JPanel();		JPanel subPanel = new JPanel();		subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));		subPanel.add(new JLabel("Hidden Layer Size:"));		subPanel.add(numHiddenText);		panel.add(subPanel);		subPanel = new JPanel();		subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));		subPanel.add(new JLabel("Min Error:"));		subPanel.add(minErrorText);		panel.add(subPanel);		getContentPane().add(panel, BorderLayout.NORTH);		JPanel centerPanel = new JPanel();		centerPanel.setLayout(new GridLayout(1, 4));		panel = new JPanel();		panel.setBorder(BorderFactory.createTitledBorder("BackProp"));		GridBagLayout gridBag = new GridBagLayout();		panel.setLayout(gridBag);		GridBagConstraints constraints = new GridBagConstraints();		constraints.weightx = 1.0;		constraints.fill = GridBagConstraints.BOTH;		constraints.gridwidth = GridBagConstraints.REMAINDER;		gridBag.setConstraints(backPropRun, constraints);		panel.add(backPropRun);		subPanel = new JPanel();		subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));		subPanel.add(new JLabel("Learning Rate:"));		subPanel.add(learningRateText);		gridBag.setConstraints(subPanel, constraints);		panel.add(subPanel);		subPanel = new JPanel();		subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));		subPanel.add(new JLabel("Momentum:"));		subPanel.add(momentumText);		gridBag.setConstraints(subPanel, constraints);		panel.add(subPanel);		JScrollPane scrollPane = new JScrollPane();		scrollPane.getViewport().add(bpOutputList);		constraints.gridheight = GridBagConstraints.REMAINDER;		constraints.weighty = 1.0;		gridBag.setConstraints(scrollPane, constraints);		panel.add(scrollPane);		labelMap.put(new Integer(Trainer.BACKPROP), bpListModel);		centerPanel.add(panel);		panel = new JPanel();		panel.setBorder(BorderFactory.createTitledBorder("QuickProp"));		gridBag = new GridBagLayout();		panel.setLayout(gridBag);		constraints.gridheight = 1;		constraints.weighty = 0.0;		gridBag.setConstraints(quickPropRun, constraints);		panel.add(quickPropRun);		subPanel = new JPanel();		subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));		subPanel.add(new JLabel("Momentum:"));		subPanel.add(qpMomentumText);		gridBag.setConstraints(subPanel, constraints);		panel.add(subPanel);		scrollPane = new JScrollPane();		scrollPane.getViewport().add(qpOutputList);		constraints.gridheight = GridBagConstraints.REMAINDER;		constraints.weighty = 1.0;		gridBag.setConstraints(scrollPane, constraints);		panel.add(scrollPane);		labelMap.put(new Integer(Trainer.QUICKPROP), qpListModel);		centerPanel.add(panel);		panel = new JPanel();		panel.setBorder(BorderFactory.createTitledBorder("GA"));		gridBag = new GridBagLayout();		panel.setLayout(gridBag);		constraints.gridheight = 1;		constraints.weighty = 0.0;		gridBag.setConstraints(gaRun, constraints);		panel.add(gaRun);		subPanel = new JPanel();		subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));		subPanel.add(new JLabel("Population Size:"));		subPanel.add(gaPopSize);		gridBag.setConstraints(subPanel, constraints);		panel.add(subPanel);		subPanel = new JPanel();		subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));		subPanel.add(new JLabel("Mutation Rate:"));		subPanel.add(gaMutationRate);		gridBag.setConstraints(subPanel, constraints);		panel.add(subPanel);		subPanel = new JPanel();		subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));		subPanel.add(new JLabel("Crossover Rate:"));		subPanel.add(gaCrossoverRate);		gridBag.setConstraints(subPanel, constraints);		panel.add(subPanel);		scrollPane = new JScrollPane();		scrollPane.getViewport().add(gaOutputList);		constraints.gridheight = GridBagConstraints.REMAINDER;		constraints.weighty = 1.0;		gridBag.setConstraints(scrollPane, constraints);		panel.add(scrollPane);		labelMap.put(new Integer(Trainer.GA), gaListModel);		centerPanel.add(panel);		panel = new JPanel();		panel.setBorder(BorderFactory.createTitledBorder("PSO"));		gridBag = new GridBagLayout();		panel.setLayout(gridBag);		constraints.gridheight = 1;		constraints.weighty = 0.0;		gridBag.setConstraints(psoRun, constraints);		panel.add(psoRun);		subPanel = new JPanel();		subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));		subPanel.add(new JLabel("Num Agents:"));		subPanel.add(psoNumAgents);		gridBag.setConstraints(subPanel, constraints);		panel.add(subPanel);		subPanel = new JPanel();		subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));		subPanel.add(new JLabel("Weight:"));		subPanel.add(psoWeight);		gridBag.setConstraints(subPanel, constraints);		panel.add(subPanel);		subPanel = new JPanel();		subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));		subPanel.add(new JLabel("Momentum:"));		subPanel.add(psoMomentum);		gridBag.setConstraints(subPanel, constraints);		panel.add(subPanel);		subPanel = new JPanel();		subPanel.setLayout(new FlowLayout(FlowLayout.LEFT));		subPanel.add(new JLabel("Max Velocity:"));		subPanel.add(psoMaxVelocity);		gridBag.setConstraints(subPanel, constraints);		panel.add(subPanel);		scrollPane = new JScrollPane();		scrollPane.getViewport().add(psoOutputList);		constraints.gridheight = GridBagConstraints.REMAINDER;		constraints.weighty = 1.0;		gridBag.setConstraints(scrollPane, constraints);		panel.add(scrollPane);		labelMap.put(new Integer(Trainer.PSO), psoListModel);		centerPanel.add(panel);		getContentPane().add(centerPanel, BorderLayout.CENTER);		init();	}	public void actionPerformed(ActionEvent e){		Object source = e.getSource();		if(source == runButton)			(new Thread(this)).start();		else if(source == stopButton){			if(backProp != null){				backProp.kill();				backProp = null;			}			if(quickProp != null){				quickProp.kill();				quickProp = null;			}			if(ga != null){				ga.kill();				ga = null;			}			if(pso != null){				pso.kill();				pso = null;			}		}	}	public void trainingGenerationComplete(NeuralNetwork nn, Trainer trainer){		//problem class takes care of updating output lists	}	public void trainingBegin(Trainer trainer){		if(numRunning == 0){			runButton.setEnabled(false);			stopButton.setEnabled(true);		}		numRunning++;	}	public void trainingEnd(Trainer trainer){		numRunning--;		if(numRunning == 0){			runButton.setEnabled(true);			stopButton.setEnabled(false);		}	}	public void run(){		numRunning = 0;		numHidden = Integer.parseInt(numHiddenText.getText());		minError = Double.parseDouble(minErrorText.getText());		problem = new XOR(numHidden, minError, labelMap);		//problem = new RealNumbers(numHidden, minError, labelMap);		if(backPropRun.isSelected()){			backProp = new BackProp(numHidden, problem.getInputs(), problem.getOutputs(), minError);			backProp.setLearningRate(Double.parseDouble(learningRateText.getText()));			backProp.setMomentum(Double.parseDouble(momentumText.getText()));			backProp.addTrainerListener(this);			backProp.addTrainerListener(problem);			backProp.start();		}		if(quickPropRun.isSelected()){			quickProp = new QuickProp(numHidden, problem.getInputs(), problem.getOutputs(), minError);			quickProp.setMomentum(Double.parseDouble(momentumText.getText()));			quickProp.addTrainerListener(this);			quickProp.addTrainerListener(problem);			quickProp.start();		}		if(gaRun.isSelected()){			ga = new GA(numHidden, problem.getInputs(), problem.getOutputs(), minError);			ga.setPopSize(Integer.parseInt(gaPopSize.getText()));			ga.setMutationRate(Double.parseDouble(gaMutationRate.getText()));			ga.setCrossoverRate(Double.parseDouble(gaCrossoverRate.getText()));			ga.addTrainerListener(this);			ga.addTrainerListener(problem);			ga.start();		}		if(psoRun.isSelected()){			pso = new Pso(numHidden, problem.getInputs(), problem.getOutputs(), minError);			pso.setNumAgents(Integer.parseInt(psoNumAgents.getText()));			pso.setWeight(Double.parseDouble(psoWeight.getText()));			pso.setMomentum(Double.parseDouble(psoMomentum.getText()));			pso.setMaxVelocity(Double.parseDouble(psoMaxVelocity.getText()));			pso.addTrainerListener(this);			pso.addTrainerListener(problem);			pso.start();		}	}	public static void main(String [] args){		TestNN t = new TestNN();		t.show();	}}// vim:ts=3:sw=3:noet

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费视频成人| 亚洲国产一区视频| 日韩欧美在线网站| 欧美色网站导航| av网站免费线看精品| 日本不卡一区二区三区高清视频| 亚洲免费观看在线视频| 国产精品麻豆网站| 欧美精品一区二区三区视频| 欧美日本免费一区二区三区| 欧洲国产伦久久久久久久| 91蜜桃在线免费视频| 成人一区在线看| 国产精品一区二区三区99| 激情综合网激情| 麻豆91精品91久久久的内涵| 蜜桃精品视频在线| 韩国成人在线视频| 蜜臀av性久久久久av蜜臀妖精| 日韩中文欧美在线| 蜜桃视频第一区免费观看| 亚洲成a天堂v人片| 亚洲成人激情av| 日韩成人免费看| 日本网站在线观看一区二区三区| 午夜久久电影网| 日本怡春院一区二区| 免费看日韩精品| 国产真实乱子伦精品视频| 精品伊人久久久久7777人| 韩国v欧美v日本v亚洲v| 国产v日产∨综合v精品视频| 国产白丝精品91爽爽久久| 成人av资源在线观看| 91蜜桃网址入口| 91久久一区二区| 7777女厕盗摄久久久| 91久久线看在观草草青青 | 视频在线在亚洲| 美女久久久精品| 成人午夜短视频| 337p亚洲精品色噜噜狠狠| 国产日韩欧美高清在线| 亚洲香蕉伊在人在线观| 国产一区啦啦啦在线观看| 色综合久久久久网| 精品成人a区在线观看| 亚洲免费观看在线视频| 久久精品国产77777蜜臀| av电影一区二区| 国产区在线观看成人精品| 亚洲成av人片在www色猫咪| 国产91在线观看| 7878成人国产在线观看| 国产精品短视频| 九一九一国产精品| 欧美性受xxxx| 中文字幕va一区二区三区| 视频在线在亚洲| 91亚洲永久精品| 久久精品一区二区三区四区| 午夜成人在线视频| 99re免费视频精品全部| 久久理论电影网| 日日摸夜夜添夜夜添国产精品| 成人高清视频在线观看| 337p粉嫩大胆色噜噜噜噜亚洲| 亚洲一级片在线观看| 高清国产一区二区| 日韩精品一区国产麻豆| 一区二区三区波多野结衣在线观看| 国产精品亚洲综合一区在线观看| 67194成人在线观看| 亚洲伦理在线精品| 国产成人免费xxxxxxxx| 欧美mv日韩mv| 日韩中文字幕亚洲一区二区va在线| 91免费小视频| 国产精品久久久久久久久搜平片| 另类的小说在线视频另类成人小视频在线 | 日韩一级二级三级精品视频| 一区二区三区成人| 色综合久久88色综合天天免费| 国产拍揄自揄精品视频麻豆| 午夜欧美在线一二页| 色婷婷亚洲精品| 亚洲人123区| 99精品视频免费在线观看| 国产欧美日韩不卡| 国产精品一二三四区| 久久亚洲精品国产精品紫薇| 理论电影国产精品| 日韩一区二区在线观看视频| 日韩在线一区二区三区| 欧美日韩国产成人在线免费| 亚洲国产日韩a在线播放性色| 在线免费观看不卡av| 自拍偷拍国产精品| 91在线你懂得| 亚洲黄色片在线观看| 色综合天天综合色综合av| 亚洲欧洲国产日本综合| 99精品黄色片免费大全| 国产精品福利一区二区| 91原创在线视频| 一区二区三区四区蜜桃| 欧美无砖砖区免费| 午夜视频在线观看一区二区| 欧美日韩免费电影| 天天综合日日夜夜精品| 日韩午夜精品视频| 精品一区二区三区在线视频| 久久久久久久久久久久久夜| 成人综合在线网站| 亚洲欧洲美洲综合色网| 在线观看三级视频欧美| 天天色天天爱天天射综合| 7777精品伊人久久久大香线蕉| 青青青伊人色综合久久| 久久这里只精品最新地址| 丁香一区二区三区| 亚洲免费色视频| 777午夜精品视频在线播放| 精品亚洲国内自在自线福利| 国产欧美综合色| 91精彩视频在线| 免费成人在线观看| 国产欧美1区2区3区| 97se亚洲国产综合自在线观| 亚洲一卡二卡三卡四卡无卡久久| 欧美精品电影在线播放| 国产在线精品一区二区夜色| 国产精品乱码一区二三区小蝌蚪| 色视频一区二区| 麻豆精品一区二区三区| 中文字幕av不卡| 欧美性感一区二区三区| 精品在线视频一区| 椎名由奈av一区二区三区| 欧美日韩精品系列| 国产东北露脸精品视频| 一区二区三区四区不卡在线 | 91精品一区二区三区久久久久久| 久久不见久久见中文字幕免费| 中文字幕成人在线观看| 欧美日韩一区高清| 国产成人在线影院| 亚洲国产日韩精品| 国产亚洲精品aa| 欧美日韩大陆一区二区| 国产91丝袜在线播放九色| 亚洲不卡一区二区三区| 欧美激情一区二区三区不卡| 欧美麻豆精品久久久久久| 国产成人午夜片在线观看高清观看| 亚洲综合视频在线| 久久久久久久久一| 在线播放中文一区| 91亚洲精品久久久蜜桃网站| 久久爱另类一区二区小说| 亚洲美女视频一区| 久久久亚洲精品一区二区三区| 91高清在线观看| 成人午夜视频网站| 免费欧美高清视频| 亚洲综合色婷婷| 国产精品每日更新在线播放网址| 欧美人体做爰大胆视频| eeuss鲁一区二区三区| 久久国内精品自在自线400部| 亚洲男同1069视频| 亚洲国产精品黑人久久久| 欧美成人官网二区| 欧美私人免费视频| 99r国产精品| 国产精品一级片在线观看| 日本成人中文字幕在线视频| 一级女性全黄久久生活片免费| 久久久久久电影| 日韩欧美综合在线| 欧美日韩一区小说| 色婷婷狠狠综合| av电影一区二区| 国产999精品久久久久久| 精品一区二区三区日韩| 免费在线观看一区| 婷婷久久综合九色国产成人| 亚洲精品日韩专区silk| 日韩毛片一二三区| 中文字幕电影一区| 久久精品一级爱片| 久久久av毛片精品| 精品三级在线观看| 日韩欧美国产电影| 91精品国产一区二区三区蜜臀| 欧美自拍偷拍一区| 在线观看亚洲a| 在线视频国产一区| 欧美色综合网站| 欧美日韩电影一区|