/** * 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); } }
/** * {@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 currentSection = section.getSectionName(); final String currentSubsection = section.getSubSectionName();
if (section.getSectionName().equals("BAYES-NETWORK") && section.getSubSectionName().equals("BAYES-PARAM")) { final Map<String, String> params = section.parseParams(); contentsStr = params.get("contents"); if (section.getSectionName().equals("BAYES-NETWORK") && section.getSubSectionName().equals("BAYES-TABLE")) { if (section.getSectionName().equals("BAYES-NETWORK") && section.getSubSectionName().equals("BAYES-PROPERTIES")) { final Map<String, String> params = section.parseParams();
/** * {@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; }
if (section.getSectionName().equals("HMM") && section.getSubSectionName().equals("PARAMS")) { properties = section.parseParams(); if (section.getSectionName().equals("HMM") && section.getSubSectionName().equals("CONFIG")) { final Map<String, String> params = section.parseParams(); } else if (section.getSectionName().equals("HMM") && section.getSubSectionName().startsWith("DISTRIBUTION-")) { final Map<String, String> params = section.parseParams();
/** * {@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; }
if (section.getSectionName().equals("BasicUniverse") && section.getSubSectionName().equals("PARAMS")) { objParams = section.parseParams(); if (section.getSectionName().equals("BasicUniverse") && 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(); size = EncogFileSection.parseInt(params,PersistConst.SIZE); } else if (section.getSectionName().equals("BasicUniverse") && section.getSubSectionName().equals("UNIVERSE")) {
Species lastSpecies = null; 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()) { } else if (section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("EPL-OPCODES")) { for (final String line : section.getLines()) { result.getContext().getFunctions().addExtension(name, args); } else if (section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("EPL-SYMBOLIC")) { boolean first = true;
if (section.getSectionName().equals("BOLTZMANN") && section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); if (section.getSectionName().equals("BOLTZMANN") && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams();
if (section.getSectionName().equals("CPN") && section.getSubSectionName().equals("PARAMS")) { networkParams = section.parseParams(); if (section.getSectionName().equals("CPN") && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams();
if (section.getSectionName().equals("PNN") && section.getSubSectionName().equals("PARAMS")) { networkParams = section.parseParams(); if (section.getSectionName().equals("PNN") && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams(); PersistConst.SIGMA); if (section.getSectionName().equals("PNN") && section.getSubSectionName().equals("SAMPLES")) { for (final String line : section.getLines()) {
if (section.getSectionName().equals("NEAT-POPULATION") && section.getSubSectionName().equals("INNOVATIONS")) { for (final String line : section.getLines()) { innovationID + 1); } else if (section.getSectionName().equals("NEAT-POPULATION") && section.getSubSectionName().equals("SPECIES")) { NEATGenome lastGenome = null; } else if (section.getSectionName().equals("NEAT-POPULATION") && 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");
if (section.getSectionName().equals("SVM") && section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); if (section.getSectionName().equals("SVM") && section.getSubSectionName().equals("SVM-PARAM")) { final Map<String, String> params = section.parseParams(); result.getParams().weight_label = EncogFileSection .parseIntArray(params, PersistSVM.PARAM_WEIGHT_LABEL); } else if (section.getSectionName().equals("SVM") && section.getSubSectionName().equals("SVM-MODEL")) { try {
if (section.getSectionName().equals("ART1") && section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); if (section.getSectionName().equals("ART1") && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams();
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.setBiasActivation(section.parseDoubleArray( params, BasicNetwork.TAG_BIAS_ACTIVATION)); } else if (section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("ACTIVATION")) { int index = 0;
if (section.getSectionName().equals("RBF-NETWORK") && section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams(); result.getProperties().putAll(params); if (section.getSectionName().equals("RBF-NETWORK") && section.getSubSectionName().equals("NETWORK")) { final Map<String, String> params = section.parseParams(); flat.setBiasActivation(section.parseDoubleArray( params, BasicNetwork.TAG_BIAS_ACTIVATION)); } else if (section.getSectionName().equals("RBF-NETWORK") && section.getSubSectionName().equals("ACTIVATION")) { int index = 0; } else if (section.getSectionName().equals("RBF-NETWORK") && section.getSubSectionName().equals("RBF")) { int index = 0;