📄 maincontroller.java
字号:
/* * NetworkController.java 1.0 05/11/2004 * * NeuralNetworkToolkit * Copyright (C) 2004 Universidade de Brasília * * This file is part of NeuralNetworkToolkit. * * NeuralNetworkToolkit 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. * * NeuralNetworkToolkit 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 NeuralNetworkToolkit; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 - USA. */ package neuralnetworktoolkit;import java.util.Vector;import neuralnetworktoolkit.architectures.ArchitectureParameters;import neuralnetworktoolkit.methods.TrainingParameters;import neuralnetworktoolkit.validation.ValidationStatistics;/** * @author iver * */public class MainController { private Vector networkControllers; private int currentNetworkControllerIndex; private NetworkController currentNetworkController; private double[][] data; private MainController() { this.networkControllers = new Vector(); } public static MainController getMainController() { return new MainController(); } public void addNetworkController() { NetworkController nc = new NetworkController(); networkControllers.addElement(nc); } public void removeNetworkController(int index) { networkControllers.removeElementAt(index); } public void setCurrentNetworkController(int index) { this.currentNetworkControllerIndex = index; this.currentNetworkController = (NetworkController) this.networkControllers.elementAt(index); } public void createNeuralNetwork(ArchitectureParameters parameters) { try { this.currentNetworkController.createNeuralNetwork(parameters); } catch (NetworkControllerException e) { e.printStackTrace(); } } public void createNeuralNetwork(int[] parameters, String initializationName, String[] functions) { try { this.currentNetworkController.createNeuralNetwork(parameters, initializationName, functions); } catch (NetworkControllerException e) { e.printStackTrace(); } } public void createNeuralNetwork(NeuralModel nm) { try { this.currentNetworkController.createNeuralNetwork(nm); } catch (NetworkControllerException e) { e.printStackTrace(); } } public void infereWithNetwork() { try { this.currentNetworkController.infereWithNetwork(); } catch (NetworkControllerException e) { e.printStackTrace(); } } public void setInferenceData(double[][] data) { this.currentNetworkController.setInferenceData(data); } public void setTrainingData(double[][] data) { this.currentNetworkController.setTrainingData(data); } public void setValidationData(double[][] data) { this.currentNetworkController.setValidationData(data); } public void setNormalization(String normalizer, int type) { try { this.currentNetworkController.setNormalization(normalizer, type); } catch (NetworkControllerException e) { e.printStackTrace(); } } public void setOutputIndex(int[] outputIndex) { this.currentNetworkController.setOutputIndex(outputIndex); } public void setTrainingMethod(String trainingMethodName) { try { this.currentNetworkController.setTrainingMethod(trainingMethodName); } catch (NetworkControllerException e) { e.printStackTrace(); } } public StatisticalResults trainNeuralNetwork(TrainingParameters param) { StatisticalResults result = null; try { result = this.currentNetworkController.trainNeuralNetwork(param); } catch (NetworkControllerException e) { e.printStackTrace(); } return result; } public ValidationStatistics validateNetwork(String validationType, TrainingParameters param) { ValidationStatistics result = null; try { result = this.currentNetworkController.validateNetwork(validationType, param); } catch (NetworkControllerException e) { e.printStackTrace(); } return result; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -