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

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

?? controller.java

?? Boosting算法軟件包
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package jboost.controller;import java.io.BufferedWriter;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.FileWriter;import java.io.ObjectInputStream;import java.io.ObjectOutputStream;import java.io.PrintWriter;import java.util.Iterator;import java.util.Vector;import jboost.CandidateSplit;import jboost.NotSupportedException;import jboost.Predictor;import jboost.WritablePredictor;import jboost.atree.AlternatingTree;import jboost.atree.InstrumentException;import jboost.atree.InstrumentedAlternatingTree;import jboost.booster.AbstractBooster;import jboost.booster.BrownBoost;import jboost.booster.Booster;import jboost.booster.Prediction;import jboost.examples.BadLabelException;import jboost.examples.Example;import jboost.examples.ExampleDescription;import jboost.examples.ExampleSet;import jboost.examples.Instance;import jboost.examples.Label;import jboost.examples.LabelDescription;import jboost.examples.WordTable;import jboost.learner.IncompAttException;import jboost.learner.SplitterBuilder;import jboost.learner.SplitterBuilderFamily;import jboost.monitor.Monitor;import jboost.tokenizer.DataStream;import jboost.tokenizer.ExampleStream;import jboost.tokenizer.ParseException;import jboost.tokenizer.jboost_DataStream;import jboost.util.ExecutorSinglet;import EDU.oswego.cs.dl.util.concurrent.CountDown;import EDU.oswego.cs.dl.util.concurrent.Executor;import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;/** * The Controller class is the primary source of execution for jboost code. * This class is designed to be used in an executable jar file. The main() * method will use configuration data to build a learner and read in the train * and test examples. *   */public class Controller {    // main objects    private Booster m_booster;    private InstrumentedAlternatingTree m_learningTree;    private Vector m_splitterBuilderVector;    // configuration object    private ControllerConfiguration m_config;    // m_monitor    private Monitor m_monitor;    private ExampleStream m_trainStream;    private ExampleStream m_testStream;    private ExampleDescription m_exampleDescription;    private int[] m_trainSetIndices;    private AlternatingTree m_serializedTree;      private static final String DEFAULT_MANPAGE = "manpage";    private static final int DEFAULT_NUMROUNDS = 150;      public static void main(String[] argv) {	ControllerConfiguration configuration= null;	Controller controller= null;    	try {	    // read the command line	    configuration= new ControllerConfiguration(DEFAULT_MANPAGE, argv);	    Monitor.init_log(configuration);	    configuration.checkCommandValues();	    controller = new Controller(configuration);	    	    	    // the rest of the code can be called from an external main	    controller.startLearning();	    controller.outputLearningResults();	    shutdown();	} catch (BadCommandException e) {	    configuration.printUsage();	    System.err.println("JBoost Exception: " + e.getMessage());	} catch (Exception e) {	    System.err.println(e.getMessage());	    configuration.printUsage();	    e.printStackTrace();	    e.getMessage();	} finally {	    Monitor.closeLog();	}    }      /**     * Build a default controller     */    public Controller(ControllerConfiguration configuration) throws Exception {	m_config= configuration;	init();    }      /**     * Initialize the controller      * Read in data from the configuration and perform operations that might generate     * exceptions     */    public void init() throws Exception {	try {	    startTokenizer();	} catch (Exception e) {	    // TODO Auto-generated catch block	    e.printStackTrace();	}    	// initialize thread pool, if required	String nthreads_str=m_config.getNThreads();	if(nthreads_str!=null) { // something was specified	    int nthreads=Integer.parseInt(nthreads_str);	    if(nthreads>0) {		if (Monitor.logLevel > 1) {		    Monitor.log("Initializing thread pool of size "+nthreads);		}		PooledExecutor pe=new PooledExecutor(new LinkedQueue(),nthreads);		pe.setMinimumPoolSize(nthreads);		pe.waitWhenBlocked();		ExecutorSinglet.setExecutor(pe);	    }	}        	m_exampleDescription= m_trainStream.getExampleDescription();	// initialize the m_booster	LabelDescription labelDescription= m_exampleDescription.getLabelDescription();	int noOfLabels= labelDescription.getNoOfValues();	boolean multiLabel= labelDescription.isMultiLabel();	m_booster= AbstractBooster.getInstance(m_config, noOfLabels, multiLabel);	if (m_config.getPrintPotential()) {	    BrownBoost b = (BrownBoost) m_booster;	    System.out.println("\tPotential loss of m_booster: " + b.getInitialPotential());	    System.exit(0);	}   	Monitor.log("The m_booster is: " + m_booster);	if (Monitor.logLevel > 1) {	    Monitor.log("The m_booster is: " + m_booster);	}	// build the splitterBuilder array	buildSplitterBuilderArray();    	// load serialized tree, if necessary	String serializedFile= m_config.getString(ControllerConfiguration.SERIALIZED_INPUT, null);	if (serializedFile != null) {	    m_serializedTree= loadTree(serializedFile);	}    	try {	    // read data	    readTrainData();	    System.out.println("Monitor log level: " + Monitor.logLevel);	    if (Monitor.logLevel > 0) {		// XXX: why is this dependent on the logLevel?		System.out.println("Reading test data");		readTestData();	    }	} catch (Exception e) {	    // XXX: what to do?	    throw new InstantiationException(e.getMessage());	}    	// initialize m_monitor	m_monitor= new Monitor(m_booster, m_config);    }      /**     * Necessary shutdown procedures     */    public static void shutdown() {	// shutdown pooled executor	Executor e=ExecutorSinglet.getExecutor();	if(e instanceof PooledExecutor) {	    ((PooledExecutor)e).shutdownNow();	}    }      /**     * Create the InstrumentedAlternatingTree or load it from a file.     * Then run the learn method     * @throws Exception     */    public void startLearning() throws Exception {	long start, stop;	// build Alternating Tree	if (m_serializedTree != null) {	    m_learningTree= new InstrumentedAlternatingTree(m_serializedTree, 							    m_splitterBuilderVector,							    m_booster, m_trainSetIndices,							    m_config);	} else {	    // initialize alternating tree	    m_learningTree= new InstrumentedAlternatingTree(m_splitterBuilderVector, m_booster, 							    m_trainSetIndices,m_config);	    System.out.println("Finished creating root (iteration -1)");	}    	// main loop	start= System.currentTimeMillis();	learn(m_config.getInt("numRounds", DEFAULT_NUMROUNDS));	stop= System.currentTimeMillis();    	if (Monitor.logLevel > 1) {	    Monitor.log("It took " + (stop - start) / 1000.0 + " seconds to learn.");	}    }        /**     * generate output files      * @throws Exception     */    public void outputLearningResults() throws Exception {	// output final result	reportResults();    	WritablePredictor res= m_learningTree.getCombinedPredictor();    	if (Monitor.logLevel > 5) {	    Monitor.log(WordTable.globalTable);	}	//  output a serialization of the alternating tree	//String serializedFile= m_config.getSerializationOutputFileName();	String serializedFile= m_config.getString("serialTreeOutput", null);	if (serializedFile != null) {	    saveTree(res, serializedFile);	}    	// output C code	String cFile= m_config.getCoutputFileName();	if (cFile != null) {	    generateCode(res, "C", cFile,m_config.getString("cOutputProc", "predict"));	}    	// output Matlab code	String matlab= m_config.getMatlabOutputFileName();	if (matlab != null) {	    generateCode(res,"MatLab", matlab, m_config.getString("matlabOutputFunction", "predict"));	}    	// output java code	String java= m_config.getJavaOutputFileName();	if (java != null) {	    generateCode(res, "java", java, m_config.getString("javaOutputClass", "predict"));	}    	if (Monitor.logLevel > 1) {	    test(res);	}    	m_monitor.close();    }        /**     * Serialize the tree and the associated WordTable.      * No information about the booster is stored. This tree can be reloaded     * and used with a completely different booster.     *      * @param atree     * @param serializedTree     * @throws Exception     */    public void saveTree(WritablePredictor atree, String serializedFile) throws Exception{	if (serializedFile != null) {	    ObjectOutputStream oos=new ObjectOutputStream(new FileOutputStream(serializedFile));	    oos.writeObject(atree);	    oos.writeObject(WordTable.globalTable);       	    oos.close();	    System.out.println("Wrote tree to " + serializedFile);	} else {	    throw new ConfigurationException("Missing output name for writing Alternting Tree.");	}    }      /**     * Load an existing tree from a file     * Instrument the tree using the examples and booster specified in the configuration     * for this Controller.     * @param serializedFile     * @throws Exception     */    public AlternatingTree loadTree(String serializedFile) throws Exception {	// output a serialization of the alternating tree	m_exampleDescription= m_trainStream.getExampleDescription();	AlternatingTree atree= null;    	ObjectInputStream input= new ObjectInputStream(new FileInputStream(serializedFile));	atree= (AlternatingTree) input.readObject();	WordTable.globalTable= (WordTable) input.readObject();	System.out.println("Loaded tree from file " + serializedFile);    	return atree;    }        public WritablePredictor getPredictor() {	return m_learningTree.getCombinedPredictor();    }        public ExampleStream getTrainStream() {	return m_trainStream;    }      public ExampleStream getTestStream() {	return m_testStream;    }      public Configuration getConfiguration() {	return m_config;    }      public Booster getBooster() {	return m_booster;    }      public InstrumentedAlternatingTree getTree() {	return m_learningTree;    }      /**     * The basic learner.      * @param iterNo number of rounds to boost the learner     * @throws NotSupportedException     * @throws InstrumentException     */    private void learn(int iterNo)	throws NotSupportedException, InstrumentException {	// The stopping criterion should also be more general.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
69av一区二区三区| 7777精品伊人久久久大香线蕉 | 国产成人亚洲综合色影视| 日韩欧美激情一区| 波多野结衣欧美| 青青草国产成人av片免费| 精品久久国产字幕高潮| 91麻豆精品秘密| 免费精品视频最新在线| 亚洲精品欧美在线| 国产亚洲婷婷免费| 欧美伊人精品成人久久综合97| 蜜臀久久久久久久| 精品国产乱码久久久久久牛牛| 色综合久久天天| 久久香蕉国产线看观看99| 欧美一区二区在线看| 日韩视频免费观看高清完整版在线观看 | 精品三级av在线| 欧美一区二区三区精品| 8v天堂国产在线一区二区| 极品少妇一区二区三区精品视频| 国产人成一区二区三区影院| 一区二区在线观看免费| 精品一区二区免费视频| 国产乱码一区二区三区| 老司机精品视频导航| 蜜桃传媒麻豆第一区在线观看| 午夜日韩在线电影| 日本大胆欧美人术艺术动态| 亚洲成人av电影在线| 麻豆成人免费电影| 狠狠色丁香婷婷综合| 国产精品一级在线| 精品一区二区三区在线播放视频| 亚洲国产精品久久久久婷婷884 | 亚洲一区二区三区四区中文字幕| 国产一区啦啦啦在线观看| 久久99精品久久久久婷婷| 国产ts人妖一区二区| 91视频在线看| 欧美精品免费视频| 国产亚洲制服色| 午夜欧美在线一二页| 国内成+人亚洲+欧美+综合在线| 国产电影一区在线| 欧洲精品中文字幕| 精品入口麻豆88视频| 国产精品午夜在线| 亚洲国产欧美日韩另类综合| 免费在线视频一区| 成人爽a毛片一区二区免费| 在线视频欧美精品| 亚洲欧美一区二区三区极速播放| 日本午夜一区二区| 欧美亚洲综合色| 亚洲欧美色一区| 91美女在线观看| 亚洲另类在线制服丝袜| 成人app软件下载大全免费| 久久蜜桃香蕉精品一区二区三区| 国产专区欧美精品| 欧美三级日本三级少妇99| 亚洲欧美国产高清| www.激情成人| 亚洲精品免费在线播放| 91麻豆免费在线观看| 国产日产精品1区| 福利一区福利二区| 中文字幕亚洲电影| 成人高清在线视频| 国产精品另类一区| 成人性生交大片免费看视频在线| 久久综合九色综合欧美就去吻| 美女视频一区二区三区| 精品sm捆绑视频| 成人免费看黄yyy456| 国产精品久久久久久久久果冻传媒| 成人午夜av电影| 亚洲高清视频在线| 欧美一区二区视频在线观看2020 | 久久综合色鬼综合色| 国产成人欧美日韩在线电影 | 中文字幕一区av| 欧美综合一区二区三区| 亚洲一二三四区| 2欧美一区二区三区在线观看视频| 精品一区二区三区在线观看国产 | 亚洲成av人在线观看| 国产喷白浆一区二区三区| 欧美婷婷六月丁香综合色| 蜜桃av一区二区在线观看| 国产精品久久久久影视| 日韩一级二级三级| 欧美肥妇free| 色综合色综合色综合| 国产91丝袜在线18| 国产在线不卡视频| 午夜精品福利视频网站| 亚洲素人一区二区| 国产蜜臀97一区二区三区| 日韩一区二区三区四区五区六区| aaa亚洲精品一二三区| 国产精品综合二区| 久久精品国产99久久6| 男人的天堂亚洲一区| 亚洲成人av中文| 婷婷综合在线观看| 男女视频一区二区| 久久精品国产免费看久久精品| 亚洲五月六月丁香激情| 亚洲资源中文字幕| 亚洲成人精品影院| 奇米888四色在线精品| 麻豆精品一区二区综合av| 人人精品人人爱| 精品一区二区三区免费观看 | 亚洲在线中文字幕| 亚洲乱码中文字幕| 亚洲成人www| 韩国女主播成人在线观看| 成人丝袜高跟foot| 欧美少妇一区二区| 日韩欧美在线网站| 欧美激情一区二区三区蜜桃视频| 久久婷婷色综合| 国产精品久久久久久一区二区三区 | 日本不卡一二三| 亚洲一区二区精品久久av| 午夜精品视频一区| 国产一区二区伦理片| 欧洲精品一区二区三区在线观看| 这里是久久伊人| 国产精品久久国产精麻豆99网站 | 久久久av毛片精品| 亚洲蜜臀av乱码久久精品 | 国产成人精品三级麻豆| 色综合久久久久综合| 欧美成人一区二区| 亚洲综合清纯丝袜自拍| 国产盗摄视频一区二区三区| 欧美伊人久久久久久久久影院| 久久综合狠狠综合久久激情| 日韩二区三区四区| 欧美日韩精品欧美日韩精品一| 久久一夜天堂av一区二区三区| 日本成人在线不卡视频| 97久久人人超碰| 国产精品久久久久影视| 成人做爰69片免费看网站| 精品国产一区二区三区av性色| 亚州成人在线电影| 欧美一区二区视频在线观看 | 欧美视频在线一区二区三区| 国产精品美女久久久久久2018 | 蜜臀精品久久久久久蜜臀 | 精品国产一区二区三区av性色| 老司机精品视频导航| 日韩一区二区三区三四区视频在线观看| 亚洲欧美色图小说| 欧美老肥妇做.爰bbww视频| 免费xxxx性欧美18vr| 久久精品男人的天堂| 99久久国产免费看| 性做久久久久久久久| 2020日本不卡一区二区视频| zzijzzij亚洲日本少妇熟睡| 一区二区三区四区视频精品免费| 欧美性感一区二区三区| 国产一区二区伦理| 亚洲一线二线三线久久久| 久久久五月婷婷| 欧美一区二区三区四区久久| 国产乱码字幕精品高清av| 亚洲影院久久精品| 亚洲美女区一区| 欧美日韩亚洲综合| 国产福利一区二区| 日韩福利电影在线观看| 国产精品女主播在线观看| 日韩欧美国产精品一区| 在线观看亚洲a| 91一区二区在线观看| 精品亚洲免费视频| 天堂在线一区二区| 亚洲综合色视频| 亚洲免费在线观看视频| 国产日韩欧美一区二区三区综合| 日韩欧美中文字幕制服| 欧美伦理电影网| 欧美精品vⅰdeose4hd| 欧美亚日韩国产aⅴ精品中极品| aaa国产一区| 欧洲另类一二三四区| 在线一区二区视频| 欧美精品久久一区| 日韩一区二区三区视频在线观看 | 日本精品一级二级| 色婷婷国产精品| 欧美日韩在线播放一区|