final Map<String, String> params = section.parseParams(); inputCount = EncogFileSection.parseInt(params, PersistConst.INPUT_COUNT); instarCount = EncogFileSection.parseInt(params, PersistConst.INSTAR); outputCount = EncogFileSection.parseInt(params, PersistConst.OUTPUT_COUNT); winnerCount = EncogFileSection.parseInt(params, PersistCPN.PROPERTY_winnerCount); m1 = EncogFileSection.parseMatrix(params,
final Map<String, String> params = section.parseParams(); flat.setBeginTraining(EncogFileSection.parseInt(params, BasicNetwork.TAG_BEGIN_TRAINING)); flat.setConnectionLimit(EncogFileSection.parseDouble(params, BasicNetwork.TAG_CONNECTION_LIMIT)); flat.setContextTargetOffset(EncogFileSection.parseIntArray(params, BasicNetwork.TAG_CONTEXT_TARGET_OFFSET)); flat.setContextTargetSize(EncogFileSection.parseIntArray(params, BasicNetwork.TAG_CONTEXT_TARGET_SIZE)); flat.setEndTraining(EncogFileSection.parseInt(params, BasicNetwork.TAG_END_TRAINING)); flat.setHasContext(EncogFileSection.parseBoolean(params, BasicNetwork.TAG_HAS_CONTEXT)); flat.setInputCount(EncogFileSection.parseInt(params, PersistConst.INPUT_COUNT)); flat.setLayerCounts(EncogFileSection.parseIntArray(params, BasicNetwork.TAG_LAYER_COUNTS)); flat.setLayerFeedCounts(EncogFileSection.parseIntArray(params, BasicNetwork.TAG_LAYER_FEED_COUNTS)); flat.setLayerOutput(EncogFileSection.parseDoubleArray(params, PersistConst.OUTPUT)); flat.setLayerSums(new double[flat.getLayerOutput().length]); flat.setOutputCount(EncogFileSection.parseInt(params, PersistConst.OUTPUT_COUNT)); flat.setWeightIndex(EncogFileSection.parseIntArray(params, BasicNetwork.TAG_WEIGHT_INDEX)); flat.setWeights(EncogFileSection.parseDoubleArray(params, PersistConst.WEIGHTS));
&& section.getSubSectionName().equals("SVM-PARAM")) { final Map<String, String> params = section.parseParams(); result.setInputCount(EncogFileSection.parseInt(params, PersistConst.INPUT_COUNT)); result.getParams().C = EncogFileSection.parseDouble(params, result.getParams().coef0 = EncogFileSection.parseDouble(params, PersistSVM.PARAM_COEF0); result.getParams().degree = EncogFileSection.parseInt(params, PersistSVM.PARAM_DEGREE); result.getParams().eps = EncogFileSection.parseDouble(params, result.getParams().gamma = EncogFileSection.parseDouble(params, PersistSVM.PARAM_GAMMA); result.getParams().kernel_type = EncogFileSection.parseInt( params, PersistSVM.PARAM_KERNEL_TYPE); result.getParams().nr_weight = EncogFileSection.parseInt( params, PersistSVM.PARAM_NUM_WEIGHT); result.getParams().nu = EncogFileSection.parseDouble(params, result.getParams().p = EncogFileSection.parseDouble(params, PersistSVM.PARAM_P); result.getParams().probability = EncogFileSection.parseInt( params, PersistSVM.PARAM_PROBABILITY); result.getParams().shrinking = EncogFileSection.parseInt( params, PersistSVM.PARAM_SHRINKING); result.getParams().svm_type = EncogFileSection.parseInt(params, PersistSVM.PARAM_SVM_TYPE); result.getParams().weight = section.parseDoubleArray(
result.setCurrentState(NumberList.fromList(CSVFormat.EG_FORMAT, params.get(PersistConst.OUTPUT))); result.setNeuronCount(EncogFileSection.parseInt(params, PersistConst.NEURON_COUNT)); result.setAnnealCycles(EncogFileSection.parseInt(params, BoltzmannMachine.ANNEAL_CYCLES)); result.setRunCycles(EncogFileSection.parseInt(params, BoltzmannMachine.RUN_CYCLES)); result.setTemperature(EncogFileSection.parseDouble(params,
final Map<String, String> params = section.parseParams(); states = EncogFileSection.parseInt(params, HiddenMarkovModel.TAG_STATES);
/** * {@inheritDoc} */ @Override public Object read(final InputStream is) { final BAM result = new BAM(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("BAM") && section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); } if (section.getSectionName().equals("BAM") && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams(); result.setF1Count(EncogFileSection.parseInt(params, PersistConst.PROPERTY_F1_COUNT)); result.setF2Count(EncogFileSection.parseInt(params, PersistConst.PROPERTY_F2_COUNT)); result.setWeightsF1toF2(EncogFileSection.parseMatrix(params, PersistConst.PROPERTY_WEIGHTS_F1_F2)); result.setWeightsF2toF1(EncogFileSection.parseMatrix(params, PersistConst.PROPERTY_WEIGHTS_F2_F1)); } } return result; }
final Map<String, String> params = section.parseParams(); flat.setBeginTraining(EncogFileSection.parseInt(params, BasicNetwork.TAG_BEGIN_TRAINING)); flat.setConnectionLimit(EncogFileSection.parseDouble(params, flat.setContextTargetSize(EncogFileSection.parseIntArray( params, BasicNetwork.TAG_CONTEXT_TARGET_SIZE)); flat.setEndTraining(EncogFileSection.parseInt(params, BasicNetwork.TAG_END_TRAINING)); flat.setHasContext(EncogFileSection.parseBoolean(params, BasicNetwork.TAG_HAS_CONTEXT)); flat.setInputCount(EncogFileSection.parseInt(params, PersistConst.INPUT_COUNT)); flat.setLayerCounts(EncogFileSection.parseIntArray(params, PersistConst.OUTPUT)); flat.setLayerSums(new double[flat.getLayerOutput().length]); flat.setOutputCount(EncogFileSection.parseInt(params, PersistConst.OUTPUT_COUNT)); flat.setWeightIndex(EncogFileSection.parseIntArray(params,
&& section.getSubSectionName().equals("UNIVERSE-PARAM")) { final Map<String, String> params = section.parseParams(); cols = EncogFileSection.parseInt(params,PersistConst.COLS); rows = EncogFileSection.parseInt(params,PersistConst.ROWS); } else if (section.getSectionName().equals("BasicUniverse") && section.getSubSectionName().equals("UNIVERSE-CELLS")) { min = EncogFileSection.parseDouble(params,PersistConst.MIN); max = EncogFileSection.parseDouble(params,PersistConst.MAX); elementCount = EncogFileSection.parseInt(params,BasicUniverse.ELEMENT_COUNT); size = EncogFileSection.parseInt(params,PersistConst.SIZE);
final Map<String, String> params = section.parseParams(); flat.setBeginTraining(EncogFileSection.parseInt(params, BasicNetwork.TAG_BEGIN_TRAINING)); flat.setConnectionLimit(EncogFileSection.parseDouble(params, flat.setContextTargetSize(EncogFileSection.parseIntArray( params, BasicNetwork.TAG_CONTEXT_TARGET_SIZE)); flat.setEndTraining(EncogFileSection.parseInt(params, BasicNetwork.TAG_END_TRAINING)); flat.setHasContext(EncogFileSection.parseBoolean(params, BasicNetwork.TAG_HAS_CONTEXT)); flat.setInputCount(EncogFileSection.parseInt(params, PersistConst.INPUT_COUNT)); flat.setLayerCounts(EncogFileSection.parseIntArray(params, PersistConst.OUTPUT)); flat.setLayerSums(new double[flat.getLayerOutput().length]); flat.setOutputCount(EncogFileSection.parseInt(params, PersistConst.OUTPUT_COUNT)); flat.setWeightIndex(EncogFileSection.parseIntArray(params,
/** * {@inheritDoc} */ @Override public Object read(final InputStream is) { final HopfieldNetwork result = new HopfieldNetwork(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("HOPFIELD") && section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); } if (section.getSectionName().equals("HOPFIELD") && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams(); result.setWeights(section.parseDoubleArray(params, PersistConst.WEIGHTS)); result.setCurrentState(section.parseDoubleArray(params, PersistConst.OUTPUT)); result.setNeuronCount(EncogFileSection.parseInt(params, PersistConst.NEURON_COUNT)); } } return result; }
result.setActivationCycles(EncogFileSection.parseInt(params, PersistConst.ACTIVATION_CYCLES)); result.setInputCount(EncogFileSection.parseInt(params, PersistConst.INPUT_COUNT)); result.setOutputCount(EncogFileSection.parseInt(params, PersistConst.OUTPUT_COUNT)); result.setPopulationSize(EncogFileSection.parseInt(params, NEATPopulation.PROPERTY_POPULATION_SIZE)); result.setSurvivalRate(EncogFileSection.parseDouble(params, NEATPopulation.PROPERTY_SURVIVAL_RATE)); result.setActivationCycles(EncogFileSection.parseInt(params, NEATPopulation.PROPERTY_CYCLES));
&& section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams(); inputCount = EncogFileSection.parseInt(params, PersistConst.INPUT_COUNT); outputCount = EncogFileSection.parseInt(params, PersistConst.OUTPUT_COUNT); kernel = PersistBasicPNN.stringToKernel(params
result.setD1(EncogFileSection.parseDouble(params, ART.PROPERTY_D1)); result.setF1Count(EncogFileSection.parseInt(params, PersistConst.PROPERTY_F1_COUNT)); result.setF2Count(EncogFileSection.parseInt(params, PersistConst.PROPERTY_F2_COUNT)); result.setNoWinner(EncogFileSection.parseInt(params, ART.PROPERTY_NO_WINNER)); result.setL(EncogFileSection