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

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

?? ocr.java

?? VHDL制作的ann的code
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
				.showInputDialog("Please enter a letter you would like to assign this sample to.");
		if (letter == null) {
			return;
		}

		if (letter.length() > 1) {
			JOptionPane.showMessageDialog(this,
					"Please enter only a single letter.", "Error",
					JOptionPane.ERROR_MESSAGE);
			return;
		}

		this.entry.downSample();
		final SampleData sampleData = (SampleData) this.sample.getData()
				.clone();
		sampleData.setLetter(letter.charAt(0));

		for (i = 0; i < this.letterListModel.size(); i++) {
			final Comparable str = (Comparable) this.letterListModel
					.getElementAt(i);
			if (str.equals(letter)) {
				JOptionPane.showMessageDialog(this,
						"That letter is already defined, delete it first!",
						"Error", JOptionPane.ERROR_MESSAGE);
				return;
			}

			if (str.compareTo(sampleData) > 0) {
				this.letterListModel.add(i, sampleData);
				return;
			}
		}
		this.letterListModel.add(this.letterListModel.size(), sampleData);
		this.letters.setSelectedIndex(i);
		this.entry.clear();
		this.sample.repaint();

	}

	/**
	 * Called to clear the image.
	 * 
	 * @param event
	 *            The event
	 */
	void clear_actionPerformed(final java.awt.event.ActionEvent event) {
		this.entry.clear();
		this.sample.getData().clear();
		this.sample.repaint();

	}

	/**
	 * Called when the del button is pressed.
	 * 
	 * @param event
	 *            The event.
	 */
	void del_actionPerformed(final java.awt.event.ActionEvent event) {
		final int i = this.letters.getSelectedIndex();

		if (i == -1) {
			JOptionPane.showMessageDialog(this,
					"Please select a letter to delete.", "Error",
					JOptionPane.ERROR_MESSAGE);
			return;
		}

		this.letterListModel.remove(i);
	}

	/**
	 * Called to downsample the image.
	 * 
	 * @param event
	 *            The event
	 */
	void downSample_actionPerformed(final java.awt.event.ActionEvent event) {
		this.entry.downSample();

	}

	/**
	 * Called when a letter is selected from the list box.
	 * 
	 * @param event
	 *            The event
	 */
	void letters_valueChanged(final javax.swing.event.ListSelectionEvent event) {
		if (this.letters.getSelectedIndex() == -1) {
			return;
		}
		final SampleData selected = (SampleData) this.letterListModel
				.getElementAt(this.letters.getSelectedIndex());
		this.sample.setData((SampleData) selected.clone());
		this.sample.repaint();
		this.entry.clear();

	}

	/**
	 * Called when the load button is pressed.
	 * 
	 * @param event
	 *            The event
	 */
	void load_actionPerformed(final java.awt.event.ActionEvent event) {
		try {
			FileReader f;// the actual file stream
			BufferedReader r;// used to read the file line by line

			f = new FileReader(new File("./sample.dat"));
			r = new BufferedReader(f);
			String line;
			int i = 0;

			this.letterListModel.clear();

			while ((line = r.readLine()) != null) {
				final SampleData ds = new SampleData(line.charAt(0),
						OCR.DOWNSAMPLE_WIDTH, OCR.DOWNSAMPLE_HEIGHT);
				this.letterListModel.add(i++, ds);
				int idx = 2;
				for (int y = 0; y < ds.getHeight(); y++) {
					for (int x = 0; x < ds.getWidth(); x++) {
						ds.setData(x, y, line.charAt(idx++) == '1');
					}
				}
			}

			r.close();
			f.close();
			clear_actionPerformed(null);
			JOptionPane.showMessageDialog(this, "Loaded from 'sample.dat'.",
					"Training", JOptionPane.PLAIN_MESSAGE);

		} catch (final Exception e) {
			e.printStackTrace();
			JOptionPane.showMessageDialog(this, "Error: " + e, "Training",
					JOptionPane.ERROR_MESSAGE);
		}

	}

	/**
	 * Used to map neurons to actual letters.
	 * 
	 * @return The current mapping between neurons and letters as an array.
	 */
	char[] mapNeurons() {
		final char map[] = new char[this.letterListModel.size()];

		for (int i = 0; i < map.length; i++) {
			map[i] = '?';
		}
		for (int i = 0; i < this.letterListModel.size(); i++) {
			final NeuralData input = new BasicNeuralData(5 * 7);
			int idx = 0;
			final SampleData ds = (SampleData) this.letterListModel
					.getElementAt(i);
			for (int y = 0; y < ds.getHeight(); y++) {
				for (int x = 0; x < ds.getWidth(); x++) {
					input.setData(idx++, ds.getData(x, y) ? .5 : -.5);
				}
			}
			
			final int best = this.net.winner(input);
			map[best] = ds.getLetter();
		}
		return map;
	}

	/**
	 * Called when the recognize button is pressed.
	 * 
	 * @param event
	 *            The event.
	 */
	void recognize_actionPerformed(final java.awt.event.ActionEvent event) {
		if (this.net == null) {
			JOptionPane.showMessageDialog(this, "I need to be trained first!",
					"Error", JOptionPane.ERROR_MESSAGE);
			return;
		}
		this.entry.downSample();

		final NeuralData input = new BasicNeuralData(5 * 7);
		int idx = 0;
		final SampleData ds = this.sample.getData();
		for (int y = 0; y < ds.getHeight(); y++) {
			for (int x = 0; x < ds.getWidth(); x++) {
				input.setData(idx++, ds.getData(x, y) ? .5 : -.5);
			}
		}

		final int best = this.net.winner(input);
		final char map[] = mapNeurons();
		JOptionPane
				.showMessageDialog(this, "  " + map[best] + "   (Neuron #"
						+ best + " fired)", "That Letter Is",
						JOptionPane.PLAIN_MESSAGE);
		clear_actionPerformed(null);

	}

	/**
	 * Run method for the background training thread.
	 */
	public void run() {
		try {
			final int inputNeuron = OCR.DOWNSAMPLE_HEIGHT
					* OCR.DOWNSAMPLE_WIDTH;
			final int outputNeuron = this.letterListModel.size();			

			NeuralDataSet trainingSet = new BasicNeuralDataSet();
			for (int t = 0; t < this.letterListModel.size(); t++) {
				NeuralData item = new BasicNeuralData(inputNeuron);
				int idx = 0;
				final SampleData ds = (SampleData) this.letterListModel
						.getElementAt(t);
				for (int y = 0; y < ds.getHeight(); y++) {
					for (int x = 0; x < ds.getWidth(); x++) {
						item.setData(idx++,ds.getData(x, y) ? .5 : -.5);
					}
				}
				
				trainingSet.add(new BasicNeuralDataPair(item,null));
			}
			
			this.net = new BasicNetwork();
			this.net.addLayer(new SOMLayer(inputNeuron,NormalizationType.MULTIPLICATIVE));
			this.net.addLayer(new BasicLayer(outputNeuron));	
			this.net.reset();

			final TrainSelfOrganizingMap train = new TrainSelfOrganizingMap(
					this.net, trainingSet,LearningMethod.SUBTRACTIVE,0.5);
			int tries = 1;

			do {
				train.iteration();
				update(tries++, train.getTotalError(), train.getBestError());
			} while ((train.getTotalError() > MAX_ERROR) && !this.halt);

			this.halt = true;
			update(tries, train.getTotalError(), train.getBestError());

		} catch (final Exception e) {
			e.printStackTrace();
			JOptionPane.showMessageDialog(this, "Error: " + e, "Training",
					JOptionPane.ERROR_MESSAGE);
		}

	}

	/**
	 * Called when the save button is clicked.
	 * 
	 * @param event
	 *            The event
	 */
	void save_actionPerformed(final java.awt.event.ActionEvent event) {
		try {
			OutputStream os;// the actual file stream
			PrintStream ps;// used to read the file line by line

			os = new FileOutputStream("./sample.dat", false);
			ps = new PrintStream(os);

			for (int i = 0; i < this.letterListModel.size(); i++) {
				final SampleData ds = (SampleData) this.letterListModel
						.elementAt(i);
				ps.print(ds.getLetter() + ":");
				for (int y = 0; y < ds.getHeight(); y++) {
					for (int x = 0; x < ds.getWidth(); x++) {
						ps.print(ds.getData(x, y) ? "1" : "0");
					}
				}
				ps.println("");
			}

			ps.close();
			os.close();
			clear_actionPerformed(null);
			JOptionPane.showMessageDialog(this, "Saved to 'sample.dat'.",
					"Training", JOptionPane.PLAIN_MESSAGE);

		} catch (final Exception e) {
			e.printStackTrace();
			JOptionPane.showMessageDialog(this, "Error: " + e, "Training",
					JOptionPane.ERROR_MESSAGE);
		}

	}

	/**
	 * Called when the train button is pressed.
	 * 
	 * @param event
	 *            The event.
	 */
	void train_actionPerformed(final java.awt.event.ActionEvent event) {
		if (this.trainThread == null) {
			this.train.setText("Stop Training");
			this.train.repaint();
			this.trainThread = new Thread(this);
			this.trainThread.start();
		} else {
			this.halt = true;
		}
	}

	/**
	 * Called to update the stats, from the neural network.
	 * 
	 * @param trial
	 *            How many tries.
	 * @param error
	 *            The current error.
	 * @param best
	 *            The best error.
	 */
	public void update(final int retry, final double totalError,
			final double bestError) {

		if (this.halt) {
			this.trainThread = null;
			this.train.setText("Begin Training");
			JOptionPane.showMessageDialog(this, "Training has completed.",
					"Training", JOptionPane.PLAIN_MESSAGE);
		}
		final UpdateStats stats = new UpdateStats();
		stats._tries = retry;
		stats._lastError = totalError;
		stats._bestError = bestError;
		try {
			SwingUtilities.invokeAndWait(stats);
		} catch (final Exception e) {
			JOptionPane.showMessageDialog(this, "Error: " + e, "Training",
					JOptionPane.ERROR_MESSAGE);
		}
	}

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品久久久久久久99蜜桃| 精品福利一区二区三区| 夜夜揉揉日日人人青青一国产精品| 色婷婷久久久亚洲一区二区三区| 一区二区三区欧美亚洲| 91 com成人网| 高清免费成人av| 亚洲成人精品影院| 久久久不卡网国产精品一区| 91传媒视频在线播放| 久久不见久久见免费视频7 | 亚洲男同性视频| 欧美一区二区久久久| 久久不见久久见免费视频1| 国产精品每日更新| 日韩午夜激情av| 成人性生交大合| 免费不卡在线视频| 中文字幕五月欧美| 欧美videos中文字幕| 色av成人天堂桃色av| 国产精品亚洲成人| 偷拍一区二区三区| 亚洲人快播电影网| 久久蜜桃av一区二区天堂| 日韩欧美一区中文| 69精品人人人人| 欧美人牲a欧美精品| 91国偷自产一区二区使用方法| 99在线精品一区二区三区| 成人污视频在线观看| 国产91对白在线观看九色| 国内精品视频666| 国内精品嫩模私拍在线| 国产一区二区三区蝌蚪| 国产老女人精品毛片久久| 久久精品久久精品| 国内精品视频一区二区三区八戒| 久久99精品视频| 久久99久久精品欧美| 九九精品一区二区| 国产一区二区女| 风间由美一区二区三区在线观看| 国产精品2024| 成人h动漫精品一区二区| 菠萝蜜视频在线观看一区| 99久久99精品久久久久久| 99久久精品99国产精品| 色狠狠一区二区| 欧美在线视频你懂得| 欧美日韩日本视频| 正在播放一区二区| 欧美成人综合网站| 久久久www免费人成精品| 亚洲国产成人一区二区三区| 亚洲日本一区二区三区| 亚洲大片精品永久免费| 麻豆精品国产91久久久久久| 国产一区二区三区四区五区入口| 成人国产精品视频| 欧美性色aⅴ视频一区日韩精品| 欧美人成免费网站| 精品成a人在线观看| 欧美国产激情二区三区| 亚洲一区二区视频| 久久99九九99精品| 99久久精品国产一区| 欧美剧在线免费观看网站| 欧美成人性战久久| 综合久久国产九一剧情麻豆| 视频一区欧美精品| 国产福利91精品| 在线中文字幕一区| 欧美精品一区二区高清在线观看| 中文字幕av资源一区| 亚洲va天堂va国产va久| 国产一区二区三区免费看| 色先锋久久av资源部| 欧美xxxx在线观看| 亚洲精品大片www| 精品一区二区三区欧美| 色婷婷久久久综合中文字幕| 精品国产一区二区三区忘忧草 | 欧美一区二区视频在线观看2020 | 26uuu精品一区二区三区四区在线| 欧美激情综合五月色丁香小说| 亚洲一二三区在线观看| 国产精品一级在线| 欧美乱妇23p| 中文在线免费一区三区高中清不卡| 亚洲成人av在线电影| 成人在线一区二区三区| 欧美一区二区在线看| 中文字幕一区二区三区不卡在线| 日本欧美一区二区在线观看| 99久久99精品久久久久久| 337p日本欧洲亚洲大胆色噜噜| 一区二区高清免费观看影视大全| 国产综合久久久久久久久久久久| 在线观看一区不卡| 国产精品女主播av| 狠狠网亚洲精品| 欧美日免费三级在线| 国产精品乱码人人做人人爱 | 色噜噜偷拍精品综合在线| 91麻豆精品91久久久久久清纯 | 国产精品天干天干在观线| 日韩福利电影在线| 欧美亚洲尤物久久| 中文字幕亚洲一区二区va在线| 九九精品一区二区| 337p亚洲精品色噜噜噜| 亚洲综合视频在线观看| 成人av综合一区| 国产欧美精品一区二区三区四区| 日本不卡在线视频| 欧美视频在线不卡| 最近日韩中文字幕| 成人高清免费观看| 国产情人综合久久777777| 精品一区二区三区久久久| 欧美一区二区在线播放| 午夜不卡av在线| 欧美高清视频一二三区| 亚洲成人免费看| 欧美日韩一区二区三区不卡| 亚洲综合色丁香婷婷六月图片| 色综合天天性综合| 亚洲啪啪综合av一区二区三区| 9l国产精品久久久久麻豆| 亚洲欧洲精品一区二区三区| 成人午夜电影网站| 亚洲欧洲av色图| 日韩精品一区二区三区视频播放 | 久久精品一区二区三区四区| 久久草av在线| 久久九九影视网| 成人午夜av在线| 欧美aaa在线| 老司机精品视频在线| 欧美在线视频日韩| 偷窥少妇高潮呻吟av久久免费| 欧美伊人久久大香线蕉综合69| 亚洲电影视频在线| 欧美精品视频www在线观看| 天天综合天天综合色| 日韩午夜激情视频| 国产精品白丝av| 中文字幕一区在线| 亚洲一二三四在线观看| 久久精品国产第一区二区三区| 精品久久久久久久久久久久久久久| 久久av资源站| 国产亚洲短视频| 91在线观看免费视频| 亚洲品质自拍视频| 欧美日韩午夜在线视频| 免费成人你懂的| 国产清纯美女被跳蛋高潮一区二区久久w | 欧美一个色资源| 精品亚洲成a人在线观看| 亚洲国产精品成人久久综合一区| 色综合久久综合网| 欧美96一区二区免费视频| 26uuu色噜噜精品一区| 99综合影院在线| 亚洲国产精品久久久久婷婷884| 91精品国产综合久久久久久久| 国产在线精品一区二区不卡了| 亚洲欧洲美洲综合色网| 欧美精品视频www在线观看| 国产精品一区二区在线看| 亚洲男人天堂一区| 日韩一区二区精品葵司在线| 国产91精品免费| 天堂精品中文字幕在线| 久久精品一区八戒影视| 欧美亚洲图片小说| 精品一二三四区| 国产一区二区h| 亚洲男人电影天堂| 欧美成人激情免费网| 91蜜桃免费观看视频| 激情文学综合插| 亚洲精品国产高清久久伦理二区| 日韩无一区二区| 在线免费观看视频一区| 国内一区二区视频| 亚洲国产精品一区二区www在线 | 日本一区二区免费在线观看视频| 欧美无人高清视频在线观看| 国产酒店精品激情| 天天影视网天天综合色在线播放| 国产精品乱码人人做人人爱| 日韩欧美一级二级三级| 欧美在线观看一二区| 成人黄色大片在线观看| 国产一区视频在线看| 婷婷中文字幕一区三区| 亚洲天堂网中文字|