/** * Load a generic subsection. * * @param section * The section to load from. */ private void loadSubSection(final EncogFileSection section) { final Map<String, String> prop = section.parseParams(); for (final String name : prop.keySet()) { final String key = section.getSectionName().toUpperCase() + ":" + section.getSubSectionName().toUpperCase() + "_" + name; String value = prop.get(name); if (value == null) { value = ""; } validateProperty(section.getSectionName(), section.getSubSectionName(), name, value); this.script.getProperties().setProperty(key, value); } }
/** * Handle loading a task. * * @param section * The section. */ private void handleTask(final EncogFileSection section) { final AnalystTask task = new AnalystTask(section.getSubSectionName()); for (final String line : section.getLines()) { task.getLines().add(line); } this.script.addTask(task); }
/** * {@inheritDoc} */ @Override public Object read(final InputStream is) { final SOM result = new SOM(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("SOM") && section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); } if (section.getSectionName().equals("SOM") && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams(); result.setWeights(EncogFileSection.parseMatrix(params, PersistConst.WEIGHTS)); } } return result; }
/** * {@inheritDoc} */ @Override public Object read(final InputStream is) { final TrainingContinuation result = new TrainingContinuation(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("CONT") && section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); for (final String key : params.keySet()) { if (key.equalsIgnoreCase("type")) { result.setTrainingType(params.get(key)); } else { final double[] list = section .parseDoubleArray(params, key); result.put(key, list); } } } } return result; }
final String currentSubsection = section.getSubSectionName();
&& section.getSubSectionName().equals("BAYES-PARAM")) { final Map<String, String> params = section.parseParams(); queryType = params.get("queryType"); && section.getSubSectionName().equals("BAYES-TABLE")) { && section.getSubSectionName().equals("BAYES-PROPERTIES")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(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; }
&& section.getSubSectionName().equals("PARAMS")) { properties = section.parseParams(); && section.getSubSectionName().equals("CONFIG")) { final Map<String, String> params = section.parseParams(); transitionProbability = section.parseMatrix(params, HiddenMarkovModel.TAG_TRANSITION); } else if (section.getSectionName().equals("HMM") && section.getSubSectionName().startsWith("DISTRIBUTION-")) { final Map<String, String> params = section.parseParams(); String t = params.get(HiddenMarkovModel.TAG_DIST_TYPE);
/** * {@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; }
&& section.getSubSectionName().equals("PARAMS")) { objParams = section.parseParams(); && 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")) { final Map<String, String> params = section.parseParams(); min = EncogFileSection.parseDouble(params,PersistConst.MIN); && section.getSubSectionName().equals("UNIVERSE")) {
while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); } else if (section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("EPL-POPULATION")) { for (final String line : section.getLines()) { final List<String> cols = EncogFileSection && section.getSubSectionName().equals("EPL-OPCODES")) { for (final String line : section.getLines()) { final List<String> cols = EncogFileSection && section.getSubSectionName().equals("EPL-SYMBOLIC")) { boolean first = true; for (final String line : section.getLines()) {
&& section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams(); result.setWeights(NumberList.fromList(CSVFormat.EG_FORMAT,
&& section.getSubSectionName().equals("PARAMS")) { networkParams = section.parseParams(); && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams();
&& section.getSubSectionName().equals("PARAMS")) { networkParams = section.parseParams(); && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams(); inputCount = EncogFileSection.parseInt(params, && section.getSubSectionName().equals("SAMPLES")) { for (final String line : section.getLines()) { final List<String> cols = EncogFileSection
&& section.getSubSectionName().equals("INNOVATIONS")) { for (final String line : section.getLines()) { final List<String> cols = EncogFileSection && section.getSubSectionName().equals("SPECIES")) { NEATGenome lastGenome = null; BasicSpecies lastSpecies = null; && section.getSubSectionName().equals("CONFIG")) { final Map<String, String> params = section.parseParams();
EncogFileSection section; while((section = in.readNextSection()) != null) { if(section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); if(section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams(); flat.setWeights(EncogFileSection.parseDoubleArray(params, PersistConst.WEIGHTS)); flat.setBiasActivation(EncogFileSection.parseDoubleArray(params, BasicNetwork.TAG_BIAS_ACTIVATION)); } else if(section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("ACTIVATION")) { int index = 0; } else if(section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("SUBSET")) { final Map<String, String> params = section.parseParams(); String subsetStr = params.get("SUBSETFEATURES");
&& section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); && section.getSubSectionName().equals("SVM-PARAM")) { final Map<String, String> params = section.parseParams(); result.setInputCount(EncogFileSection.parseInt(params, .parseIntArray(params, PersistSVM.PARAM_WEIGHT_LABEL); } else if (section.getSectionName().equals("SVM") && section.getSubSectionName().equals("SVM-MODEL")) { try { final StringReader rdr = new StringReader(
&& section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams();
&& section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams(); params, BasicNetwork.TAG_BIAS_ACTIVATION)); } else if (section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("ACTIVATION")) { int index = 0;
&& section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams(); params, BasicNetwork.TAG_BIAS_ACTIVATION)); } else if (section.getSectionName().equals("RBF-NETWORK") && section.getSubSectionName().equals("ACTIVATION")) { int index = 0; && section.getSubSectionName().equals("RBF")) { int index = 0;