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

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

?? jsomtraining.java

?? Kohonen網絡的學習過程可描述為:對于每一個網絡的輸入
?? JAVA
字號:
package fi.javasom.jsom;
/**
 * This is JSomTraining class that does the actual ordering of a dataset into a map.
 *
 *  Copyright (C) 2001  Tomi Suuronen
 *
 *  @version 1.0
 *
 *  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

import fi.javasom.jsom.*;
import java.util.Random;
import java.io.*; //this line for debugging

public class JSomTraining
{
	private double length; //caching
	private double lcache; //caching
	private int index; //caching
	private JSomMath math;
	private WeightVectors wVector;
	private InputVectors iVector;
	private String neigh; //the neighborhood function type used :: step(bubble) | gaussian
	private int steps; //running length (number of steps) in training
	private double lrate; //initial learning rate parameter value
	private String lrateType; //learning rate parameter type :: exponential | linear | inverse
	private double width; //initial "width" of training area
	private int xDim; //number of units in the x-direction
	private int yDim; //number of units in the y-direction
	private Random generator;
	private int wVectorSize; //the number of weight vectors
	private int iVectorSize; //the number of input vectors

	/**
	 * Constructor.
	 *
	 * @param WeightVectors wVector - weight vectors.
	 * @param InputVectors iVector - input vectors.
	*/
	public JSomTraining(WeightVectors wVector,InputVectors iVector)
	{
		this.wVector = wVector;
		this.iVector = iVector;
		math = new JSomMath(wVector.getDimensionalityOfNodes());
		xDim = wVector.getXDimension();
		yDim = wVector.getYDimension();
		generator = new Random();
	}

	/**
	 * Sets the ordering instructions for the ordering process.
	 *
	 * @param int steps - number of steps in this ordering phase.
	 * @param double lrate - initial value for learning rate (usually near 0.1).
	 * @param int radius - initial radius of neighbors.
	 * @param String lrateType - states which learning-rate parameter function is used :: exponential | linear | inverse
	 * @param String neigh - the neighborhood function type used :: step(bubble) | gaussian
	*/
	public void setTrainingInstructions(int steps,double lrate,int radius,String lrateType,String neigh)
	{
		this.steps = steps;
		this.lrate = lrate;
		this.lrateType = lrateType;
		this.neigh = neigh;
		width = radius;
	}

	/**
	 * Does the training phase.
	 *
	 * @return WeightVectors - Returns the trained weight vectors.
	*/
	public WeightVectors doTraining()
	{
		iVectorSize = iVector.getCount();
		wVectorSize = wVector.getCount();
		if(lrateType.equals("exponential") && neigh.equals("step"))
		{
			doBubbleExpAdaptation();
		}
		else if(lrateType.equals("linear") && neigh.equals("step"))
		{
			doBubbleLinAdaptation();
		}
		else if(lrateType.equals("inverse") && neigh.equals("step"))
		{
			doBubbleInvAdaptation();
		}
		else if(lrateType.equals("exponential") && neigh.equals("gaussian"))
		{
			doGaussianExpAdaptation();
		}

		else if(lrateType.equals("linear") && neigh.equals("gaussian"))
		{
			doGaussianLinAdaptation();
		}
		else
		{
			//inverse and gaussian
			doGaussianInvAdaptation();
		}
		return wVector;
	}

	/*
	 * Does the Bubble Exponential Adaptation to the Weight Vectors.
	*/
	private void doBubbleExpAdaptation()
	{
		double[] input;
		double[] wLocation; //location of a winner node
		double s = (double)steps;
		double wCache; // width cache
		double exp;
		for(int n=0;n<steps;n++)
		{
			wCache = Math.ceil(width * (1 - (n / s))); //adapts the width function as it is a function of time.
			exp = math.expLRP(n,lrate,steps);
			input = iVector.getNodeValuesAt(generator.nextInt(iVectorSize));
			index = resolveIndexOfWinningNeuron(input);
			wLocation = wVector.getNodeLocationAt(index);
			for(int h=0;h<wVectorSize;h++)
			{
				wVector.setNodeValuesAt(h,math.bubbleAdaptation(input,wVector.getNodeValuesAt(h),wLocation,wVector.getNodeLocationAt(h),wCache,exp));
			}
		}
	}

	/*
	 * Does the Bubble Linear Adaptation to the Weight Vectors.
	*/
	private void doBubbleLinAdaptation()
	{
		double[] input;
		double[] wLocation; //location of a winner node
		double s = (double)steps;
		double wCache; // width cache
		double lin;
		for(int n=0;n<steps;n++)
		{
			wCache = Math.ceil(width * (1 - (n / s))); //adapts the width function as it is a function of time.
			lin = math.linLRP(n,lrate,steps);
			input = iVector.getNodeValuesAt(generator.nextInt(iVectorSize));
			index = resolveIndexOfWinningNeuron(input);
			wLocation = wVector.getNodeLocationAt(index);
			for(int h=0;h<wVectorSize;h++)
			{
				wVector.setNodeValuesAt(h,math.bubbleAdaptation(input,wVector.getNodeValuesAt(h),wLocation,wVector.getNodeLocationAt(h),wCache,lin));
			}
		}
	}

	/*
	 * Does the Bubble Inverse-time Adaptation to the Weight Vectors.
	*/
	private void doBubbleInvAdaptation()
	{
		double[] input;
		double[] wLocation; //location of a winner node
		double A; //constants A and B which are considered equal
		double s = (double)steps;
		double wCache; // width cache
		double inv;
		A = steps / 100.0;
		for(int n=0;n<steps;n++)
		{
			wCache = Math.ceil(width * (1 - (n / s))); //adapts the width function as it is a function of time.
			inv = math.invLRP(n,lrate,A,A);
			input = iVector.getNodeValuesAt(generator.nextInt(iVectorSize));
			index = resolveIndexOfWinningNeuron(input);
			wLocation = wVector.getNodeLocationAt(index);
			for(int h=0;h<wVectorSize;h++)
			{
				wVector.setNodeValuesAt(h,math.bubbleAdaptation(input,wVector.getNodeValuesAt(h),wLocation,wVector.getNodeLocationAt(h),wCache,inv));
			}
		}
	}

	/*
	 * Does the Gaussian Exponential Adaptation to the Weight Vectors.
	*/
	private void doGaussianExpAdaptation()
	{
		double[] input;
		double[] wLocation; //location of a winner node
		double wCache; // width cache
		double exp;
		for(int n=0;n<steps;n++)
		{
			wCache = math.gaussianWidth(width,n,steps);
			exp = math.expLRP(n,lrate,steps);
			input = iVector.getNodeValuesAt(generator.nextInt(iVectorSize));
			index = resolveIndexOfWinningNeuron(input);
			wLocation = wVector.getNodeLocationAt(index);
			for(int h=0;h<wVectorSize;h++)
			{
				wVector.setNodeValuesAt(h,math.gaussianAdaptation(input,wVector.getNodeValuesAt(h),wLocation,wVector.getNodeLocationAt(h),wCache,exp));
			}
		}
	}

	/*
	 * Does the Gaussian Linear Adaptation to the Weight Vectors.
	*/
	private void doGaussianLinAdaptation()
	{
		double[] input;
		double[] wLocation; //location of a winner node
		double wCache; // width cache
		double lin;
		for(int n=0;n<steps;n++)
		{
			wCache = math.gaussianWidth(width,n,steps);
			lin = math.linLRP(n,lrate,steps);
			input = iVector.getNodeValuesAt(generator.nextInt(iVectorSize));
			index = resolveIndexOfWinningNeuron(input);
			wLocation = wVector.getNodeLocationAt(index);
			for(int h=0;h<wVectorSize;h++)
			{
				wVector.setNodeValuesAt(h,math.gaussianAdaptation(input,wVector.getNodeValuesAt(h),wLocation,wVector.getNodeLocationAt(h),wCache,lin));
			}
		}
	}

	/*
	 * Does the Gaussian Inverse-time Adaptation to the Weight Vectors.
	*/
	private void doGaussianInvAdaptation()
	{
		double[] input;
		double[] wLocation; //location of a winner node
		double A; //constants A and B which are considered equal
		double wCache; // width cache
		double inv;
		A = steps / 100.0;
		for(int n=0;n<steps;n++)
		{
			wCache = math.gaussianWidth(width,n,steps);
			inv = math.invLRP(n,lrate,A,A);
			input = iVector.getNodeValuesAt(generator.nextInt(iVectorSize));
			index = resolveIndexOfWinningNeuron(input);
			wLocation = wVector.getNodeLocationAt(index);
			for(int h=0;h<wVectorSize;h++)
			{
				wVector.setNodeValuesAt(h,math.gaussianAdaptation(input,wVector.getNodeValuesAt(h),wLocation,wVector.getNodeLocationAt(h),wCache,inv));
			}
		}
	}

	/*
	 * Finds the winning neuron for this input vector.
	 *
	 * @param double[] values - values of an input vector.
	 * @return int - index of the winning neuron.
	*/
	private int resolveIndexOfWinningNeuron(double[] values)
	{
		length = math.getDistance(values,wVector.getNodeValuesAt(0));
		index = 0;
		for(int i=1;i<wVectorSize;i++)
		{
			lcache = math.getDistance(values,wVector.getNodeValuesAt(i));
			if(lcache<length)
			{
				index = i;
				length = lcache;
			}
		}
		return index;
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线中文字幕不卡| 91在线视频网址| 日韩av在线播放中文字幕| 亚洲美女免费在线| 亚洲综合成人在线视频| 亚洲三级在线播放| 亚洲激情五月婷婷| 亚洲第一二三四区| 热久久国产精品| 国产综合色视频| 粉嫩久久99精品久久久久久夜| 国产精品一区二区三区乱码| 国产精品影视在线| 91啪亚洲精品| 在线不卡的av| 久久一区二区三区四区| 国产精品美女视频| 亚洲大尺度视频在线观看| 免费精品视频在线| 国产成人夜色高潮福利影视| 91农村精品一区二区在线| 欧美色综合影院| 亚洲精品在线观看网站| 一色屋精品亚洲香蕉网站| 五月天婷婷综合| 国产91在线看| 欧洲视频一区二区| 精品国产不卡一区二区三区| 国产精品久久一卡二卡| 午夜成人免费视频| 成人免费视频网站在线观看| 欧美综合亚洲图片综合区| 欧美成人欧美edvon| 亚洲女厕所小便bbb| 日本一不卡视频| 99精品黄色片免费大全| 日韩欧美视频一区| 一区二区成人在线| 国产一本一道久久香蕉| 欧美日韩一区在线| 亚洲精品综合在线| 免费人成黄页网站在线一区二区 | 国产精品久久毛片a| 91欧美一区二区| 欧美精品成人一区二区三区四区| 久久久亚洲精品石原莉奈 | 日本高清不卡在线观看| 精品三级在线看| 亚洲第一综合色| av成人免费在线| 精品国产免费视频| 日韩中文字幕麻豆| 欧洲精品中文字幕| 亚洲欧美日韩在线不卡| 国产福利一区在线| 欧美成人伊人久久综合网| 亚洲成人黄色影院| 日本精品免费观看高清观看| 国产欧美一区二区在线观看| 日本午夜精品一区二区三区电影| 97久久久精品综合88久久| 中文字幕不卡三区| 国产精品一区二区三区乱码| 欧美成人精品3d动漫h| 日韩成人精品在线| 欧美日韩1区2区| 亚洲大片一区二区三区| 欧美在线观看一区| 亚洲成人av在线电影| 一本大道久久a久久综合| 亚洲图片另类小说| 色中色一区二区| 亚洲精品国产成人久久av盗摄 | 在线观看欧美黄色| 亚洲欧美偷拍卡通变态| 99久久亚洲一区二区三区青草 | 中文字幕一区二区三区乱码在线| 福利一区福利二区| 亚洲欧洲av色图| 91亚洲精品一区二区乱码| 亚洲乱码国产乱码精品精的特点 | 亚洲女同一区二区| 欧美日韩你懂的| 蜜桃视频免费观看一区| 精品蜜桃在线看| 国产成a人无v码亚洲福利| 亚洲国产高清不卡| 日本久久电影网| 亚洲不卡av一区二区三区| 91精品久久久久久蜜臀| 国产在线观看一区二区| 国产日韩欧美综合一区| 99久久er热在这里只有精品15| 自拍偷拍亚洲综合| 欧美另类videos死尸| 激情综合亚洲精品| 亚洲欧洲国产日本综合| 欧美日韩国产高清一区| 九九九久久久精品| 中文字幕一区免费在线观看| 欧美日韩国产综合一区二区三区| 日本欧美韩国一区三区| 中文久久乱码一区二区| 欧美视频一区二区三区| 国产精品一二一区| 亚洲与欧洲av电影| 久久久久国产精品厨房| 欧美最新大片在线看| 国产一区啦啦啦在线观看| 亚洲精品乱码久久久久久黑人| 欧美久久一区二区| www.日本不卡| 日韩av一级电影| 亚洲日本va在线观看| 欧美tk丨vk视频| 欧美性大战久久| 国产成人啪午夜精品网站男同| 亚洲一区二区三区在线看| 久久久天堂av| 欧美日韩国产小视频在线观看| 国产精品一二三区| 琪琪一区二区三区| 亚洲综合色丁香婷婷六月图片| 2024国产精品视频| 在线成人午夜影院| 日本韩国欧美国产| 成人a免费在线看| 精久久久久久久久久久| 调教+趴+乳夹+国产+精品| 亚洲视频一区二区免费在线观看| 欧美成人猛片aaaaaaa| 欧美午夜影院一区| 99久久亚洲一区二区三区青草| 久久99精品久久久久| 丝袜美腿一区二区三区| 一区二区三区产品免费精品久久75| 精品国产青草久久久久福利| 欧美日韩亚洲另类| 色呦呦一区二区三区| 99精品欧美一区| 高清av一区二区| 国产成人午夜精品影院观看视频| 日本免费在线视频不卡一不卡二| 亚洲一区二区三区四区在线免费观看| 中文字幕乱码日本亚洲一区二区| 精品国产一区二区三区忘忧草| 欧美一区二区三区在线看| 欧美日韩aaaaa| 9191精品国产综合久久久久久 | 日韩写真欧美这视频| 欧美剧情电影在线观看完整版免费励志电影 | 欧美精品第1页| 欧美精品在欧美一区二区少妇| 色欧美片视频在线观看| 日本精品一区二区三区四区的功能| 95精品视频在线| 在线观看亚洲成人| 7777精品伊人久久久大香线蕉的| 欧美日韩一本到| 日韩欧美一二区| 久久夜色精品国产噜噜av| 久久久久久久免费视频了| 国产亚洲精品超碰| 《视频一区视频二区| 亚洲免费观看高清完整版在线| 亚洲一区二区精品3399| 日韩影院精彩在线| 极品美女销魂一区二区三区免费| 国产成人亚洲精品狼色在线 | 在线观看av一区二区| 欧美日韩亚洲综合在线| 欧美成人激情免费网| 久久精品亚洲乱码伦伦中文| 欧美国产禁国产网站cc| 亚洲综合久久久| 久久精品国产精品亚洲精品| 国产成人免费网站| 欧美在线观看视频一区二区三区| 欧美一区二区三区视频在线| 国产蜜臀97一区二区三区| 亚洲一区二区三区自拍| 久热成人在线视频| 91色视频在线| 欧美电视剧免费全集观看| 综合自拍亚洲综合图不卡区| 日本在线不卡视频一二三区| 成人一区二区在线观看| 在线不卡免费欧美| 亚洲色图欧洲色图婷婷| 久久 天天综合| 91免费看`日韩一区二区| 欧美一激情一区二区三区| 日韩久久一区二区| 激情深爱一区二区| 欧美亚洲国产一区在线观看网站| 精品国产污污免费网站入口| 亚洲精品日日夜夜| 从欧美一区二区三区| 日韩欧美成人激情| 亚洲mv大片欧洲mv大片精品|