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

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

?? csvneuraldataset.java

?? VHDL制作的ann的code
?? JAVA
字號:
/*
 * Encog Neural Network and Bot Library for Java v1.x
 * http://www.heatonresearch.com/encog/
 * http://code.google.com/p/encog-java/
 * 
 * Copyright 2008, Heaton Research Inc., and individual contributors.
 * See the copyright.txt in the distribution for a full listing of 
 * individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.encog.neural.data.csv;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.encog.neural.NeuralNetworkError;
import org.encog.neural.data.NeuralData;
import org.encog.neural.data.NeuralDataError;
import org.encog.neural.data.NeuralDataPair;
import org.encog.neural.data.NeuralDataSet;
import org.encog.neural.data.basic.BasicNeuralData;
import org.encog.neural.data.basic.BasicNeuralDataPair;
import org.encog.util.ReadCSV;

/**
 * An implementation of the NeuralDataSet interface designed to provide a CSV
 * file to the neural network. This implementation uses the BasicNeuralData to
 * hold the data being read. This class has no ability to write CSV files.
 * The columns of the CSV file will specify both the input and ideal 
 * columns.  
 * 
 * This class is not memory based, so very long files can be used, 
 * without running out of memory.
 * @author jheaton
 */
public class CSVNeuralDataSet implements NeuralDataSet {

	/**
	 * An iterator designed to read from CSV files.
	 * @author jheaton
	 */
	public class CSVNeuralIterator implements Iterator<NeuralDataPair> {
		
		/**
		 * A ReadCSV object used to parse the CSV file.
		 */
		private ReadCSV reader;
		
		/**
		 * Is there data that has been read and is ready?
		 */
		private boolean dataReady;

		/**
		 * Default constructor.  Create a new iterator from the parent class.
		 */
		public CSVNeuralIterator() {
			try {
				this.reader = null;
				this.reader = new ReadCSV(CSVNeuralDataSet.this.filename,
						CSVNeuralDataSet.this.headers,
						CSVNeuralDataSet.this.delimiter);
				this.dataReady = false;
			} catch (final IOException e) {
				throw new NeuralNetworkError(e);
			}
		}

		/**
		 * Close the iterator, and the underlying CSV file.
		 */
		public void close() {
			try {
				this.reader.close();
			} catch (final IOException e) {
				throw new NeuralDataError("Can't close CSV file.");
			}
		}

		/**
		 * Determine if there is more data to be read.
		 * @return True if there is more data to be read.
		 */
		public boolean hasNext() {
			if (this.reader == null) {
				return false;
			}

			if (this.dataReady) {
				return true;
			}

			try {
				if (this.reader.next()) {
					this.dataReady = true;
					return true;
				}
				this.dataReady = false;
				return false;
			} catch (final IOException e) {
				throw new NeuralNetworkError(e);
			}

		}

		/**
		 * Read the next record from the CSV file.
		 * @return The next data pair read.
		 */
		public NeuralDataPair next() {

			final NeuralData input = new BasicNeuralData(
					CSVNeuralDataSet.this.inputSize);
			NeuralData ideal = null;

			for (int i = 0; i < CSVNeuralDataSet.this.inputSize; i++) {
				input.setData(i, this.reader.getDouble(i));
			}

			if (CSVNeuralDataSet.this.idealSize > 0) {
				ideal = new BasicNeuralData(CSVNeuralDataSet.this.idealSize);
				for (int i = 0; i < CSVNeuralDataSet.this.idealSize; i++) {
					ideal.setData(i, this.reader.getDouble(i
							+ CSVNeuralDataSet.this.inputSize));
				}
			}

			this.dataReady = false;
			return new BasicNeuralDataPair(input, ideal);
		}

		/**
		 * Removes are not supported.
		 */
		public void remove() {

			throw new UnsupportedOperationException();
		}
	}

	/**
	 * Error message indicating that adds are not supported.
	 */
	public static final String ADD_NOT_SUPPORTED = 
		"Adds are not supported with this dataset, it is read only.";
	
	/**
	 * The CSV filename to read from.
	 */
	private final String filename;
	
	/**
	 * The number of columns of input data.
	 */
	private final int inputSize;
	
	/**
	 * The number of columns of ideal data.
	 */	
	private final int idealSize;
	
	/**
	 * The delimiter that separates the columns, defaults to a comma.
	 */
	private final char delimiter;
	
	/**
	 * Specifies if headers are present on the first row.
	 */
	private final boolean headers;

	/**
	 * A collection of iterators that have been created.
	 */
	private final List<CSVNeuralIterator> iterators = 
		new ArrayList<CSVNeuralIterator>();

	
	/**
	 * Construct this data set using a comma as a delimiter.
	 * @param filename The CSV filename to read.
	 * @param inputSize The number of columns that make up the input set.	 * 
	 * @param idealSize The number of columns that make up the ideal set.
	 * @param headers True if headers are present on the first line.
	 */
	public CSVNeuralDataSet(final String filename, final int inputSize,
			final int idealSize, final boolean headers) {
		this(filename, inputSize, idealSize, headers, ',');
	}

	/**
	 * Construct this data set using a comma as a delimiter.
	 * @param filename The CSV filename to read.
	 * @param inputSize The number of columns that make up the input set.	 * 
	 * @param idealSize The number of columns that make up the ideal set.
	 * @param headers True if headers are present on the first line.
	 * @param delimiter The delimiter to use.
	 */
	public CSVNeuralDataSet(final String filename, final int inputSize,
			final int idealSize, final boolean headers, final char delimiter) {
		this.filename = filename;
		this.inputSize = inputSize;
		this.idealSize = idealSize;
		this.delimiter = delimiter;
		this.headers = headers;
	}

	/**
	 * Adds are not supported.
	 * @param data1 Not used.
	 */
	public void add(final NeuralData data1) {
		throw new NeuralDataError(CSVNeuralDataSet.ADD_NOT_SUPPORTED);
	}

	/**
	 * Adds are not supported.
	 * @param inputData Not used.
	 * @param idealData Not used.
	 */
	public void add(final NeuralData inputData, final NeuralData idealData) {
		throw new NeuralDataError(CSVNeuralDataSet.ADD_NOT_SUPPORTED);

	}

	/**
	 * Adds are not supported.
	 * @param inputData Not used.
	 */
	public void add(final NeuralDataPair inputData) {
		throw new NeuralDataError(CSVNeuralDataSet.ADD_NOT_SUPPORTED);
	}

	/**
	 * Close any iterators from this dataset.
	 */
	public void close() {
		for (final CSVNeuralIterator iterator : this.iterators) {
			iterator.close();
		}
	}

	/**
	 * @return the delimiter
	 */
	public char getDelimiter() {
		return this.delimiter;
	}

	/**
	 * @return the filename
	 */
	public String getFilename() {
		return this.filename;
	}

	/**
	 * @return The size of the ideal data.
	 */
	public int getIdealSize() {
		return this.idealSize;
	}

	/**
	 * @return The size of the input data.
	 */
	public int getInputSize() {
		return this.inputSize;
	}

	/**
	 * Get an iterator to use with the CSV data.
	 * @return An iterator.
	 */
	public Iterator<NeuralDataPair> iterator() {
		return new CSVNeuralIterator();
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一二三四区在线| 一本色道久久综合亚洲aⅴ蜜桃| 亚洲欧美激情在线| 久久综合国产精品| 精品国产乱码久久| 久久九九影视网| 欧美电视剧免费全集观看| 欧美大片日本大片免费观看| 91麻豆精品国产91久久久更新时间| 欧洲一区二区三区在线| 欧美视频在线播放| 欧美日韩黄视频| 精品国精品自拍自在线| 久久久蜜桃精品| 国产精品久久国产精麻豆99网站| 国产精品污网站| 亚洲免费在线观看| 天堂在线一区二区| 韩国精品主播一区二区在线观看 | 一区二区视频在线| 一区av在线播放| 日韩精品五月天| 国产最新精品精品你懂的| aa级大片欧美| 欧美精品第1页| 久久先锋影音av鲁色资源| 国产精品三级av在线播放| 亚洲乱码精品一二三四区日韩在线| 亚洲一区影音先锋| 蓝色福利精品导航| 91视频一区二区三区| 欧美福利视频一区| 国产精品美女久久久久aⅴ| 亚洲最大成人综合| 国产精品白丝jk白祙喷水网站| 91啪在线观看| 日韩视频一区二区三区| 国产精品不卡在线观看| 男女激情视频一区| 日本高清不卡aⅴ免费网站| 精品国产露脸精彩对白| 亚洲精品少妇30p| 国产在线视频一区二区三区| 欧洲生活片亚洲生活在线观看| 日韩亚洲国产中文字幕欧美| **网站欧美大片在线观看| 午夜精品福利一区二区三区av| 国产一区二区免费在线| 91高清视频免费看| 国产欧美日韩亚州综合| 婷婷成人激情在线网| 色综合久久久网| 欧美激情在线一区二区| 老司机免费视频一区二区| 在线观看av一区| 国产精品二区一区二区aⅴ污介绍| 久久se这里有精品| 欧美亚洲动漫另类| 亚洲欧美日韩人成在线播放| 国产成人精品免费一区二区| 日韩亚洲欧美中文三级| 亚洲一二三区在线观看| 91视频你懂的| 国产日韩欧美一区二区三区综合| 蜜桃视频一区二区三区| 欧美欧美欧美欧美首页| 亚洲午夜免费视频| 色婷婷一区二区三区四区| 国产清纯美女被跳蛋高潮一区二区久久w| 青青草视频一区| 欧美精品aⅴ在线视频| 亚洲韩国一区二区三区| 欧美三级在线看| 亚洲国产美国国产综合一区二区| 97国产一区二区| 亚洲人成网站在线| 91啪九色porn原创视频在线观看| 亚洲国产精品t66y| 成人高清在线视频| 亚洲视频综合在线| 色综合久久综合网97色综合| 亚洲欧美日韩小说| 欧美在线免费观看亚洲| 亚洲夂夂婷婷色拍ww47| 欧美日韩成人综合天天影院| 肉丝袜脚交视频一区二区| 4438x亚洲最大成人网| 日韩中文字幕麻豆| 欧美一个色资源| 国产一区二区三区不卡在线观看 | 欧美色视频在线观看| 午夜电影一区二区三区| 日韩精品一区二区三区视频在线观看 | 欧美国产成人在线| 粉嫩aⅴ一区二区三区四区 | 4438x亚洲最大成人网| 蜜桃在线一区二区三区| 精品国产一区二区三区不卡| 国产一区二区三区四| 成人欧美一区二区三区在线播放| 97久久超碰国产精品| 午夜精品在线看| 337p日本欧洲亚洲大胆精品 | 亚洲黄色av一区| 欧美日韩国产免费一区二区| 久久69国产一区二区蜜臀| 国产日韩在线不卡| 欧美影院午夜播放| 国产剧情一区在线| 亚洲一区二区综合| 久久一区二区三区四区| 色婷婷久久久亚洲一区二区三区| 日韩中文字幕麻豆| 中文字幕一区二区三区在线不卡| 欧美日韩久久不卡| 日韩在线观看一区二区| 欧美极品少妇xxxxⅹ高跟鞋| 欧美日韩视频一区二区| 国产成人精品亚洲777人妖| 亚洲国产精品一区二区久久恐怖片 | 欧美一级电影网站| 91网站最新网址| 精品中文av资源站在线观看| 亚洲猫色日本管| 久久五月婷婷丁香社区| 欧美亚洲国产一区在线观看网站| 国产一区二区三区视频在线播放| 亚洲国产精品一区二区www在线| 久久久久久麻豆| 欧美久久一二三四区| jlzzjlzz欧美大全| 国产馆精品极品| 另类专区欧美蜜桃臀第一页| 亚洲精品久久嫩草网站秘色| 中文字幕精品一区二区精品绿巨人 | 麻豆视频一区二区| 亚洲成人自拍一区| 亚洲欧美日韩系列| 亚洲国产精华液网站w | 国产精品家庭影院| 久久综合九色综合97_久久久| 欧美日本视频在线| 欧美日韩精品一区二区| 99精品国产99久久久久久白柏| 国产成人自拍网| 国产一区二区不卡| 国产在线观看免费一区| 九九九精品视频| 狠狠久久亚洲欧美| 国产综合久久久久影院| 激情综合色综合久久| 麻豆国产欧美一区二区三区| 三级欧美在线一区| 亚洲高清视频中文字幕| 午夜精品久久久久久| 午夜精品久久一牛影视| 午夜精品一区二区三区免费视频 | 不卡的av在线| 国产91在线看| 9i在线看片成人免费| 91精品福利视频| 欧美午夜视频网站| 欧美日韩久久不卡| 51午夜精品国产| 欧美大尺度电影在线| 久久久噜噜噜久噜久久综合| 国产欧美视频一区二区| 一区在线中文字幕| 亚洲国产精品久久久久婷婷884 | 9191国产精品| 精品福利一区二区三区免费视频| 久久综合久久久久88| 最新中文字幕一区二区三区| 亚洲色图另类专区| 午夜欧美在线一二页| 精品综合久久久久久8888| 成人一区二区在线观看| 欧美亚洲国产一区二区三区| 日韩免费观看高清完整版在线观看| 精品精品欲导航| 国产精品免费视频观看| 丝袜亚洲精品中文字幕一区| 久久狠狠亚洲综合| 91美女在线看| 欧美成人一区二区| 亚洲欧洲日韩综合一区二区| 婷婷亚洲久悠悠色悠在线播放| 国产一区激情在线| 欧美午夜片在线看| 日本一区二区综合亚洲| 亚洲福利视频导航| 国产91精品精华液一区二区三区| 色视频欧美一区二区三区| 日韩免费视频一区| 亚洲精选视频免费看| 久久99九九99精品| 欧美三级日韩三级国产三级| 欧美高清一级片在线观看| 亚洲午夜在线视频| 成人av在线观|