/** * {@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; }
/** * {@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; }
/** * Load an Encog script. * * @param stream * The stream to load from. */ public void load(final InputStream stream) { EncogReadHelper reader = null; try { EncogFileSection section = null; reader = new EncogReadHelper(stream); while ((section = reader.readNextSection()) != null) { processSubSection(section); } // init the script this.script.init(); } finally { if (reader != null) { reader.close(); } } }
String contentsStr = ""; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("BAYES-NETWORK") && section.getSubSectionName().equals("BAYES-PARAM")) {
/** * {@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; }
while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("PARAMS")) {
EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("HMM") && section.getSubSectionName().equals("PARAMS")) {
/** * {@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; }
EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("BOLTZMANN") && section.getSubSectionName().equals("PARAMS")) {
EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("NEAT-POPULATION") && section.getSubSectionName().equals("INNOVATIONS")) {
Matrix m2 = null; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("CPN") && section.getSubSectionName().equals("PARAMS")) {
EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("BasicUniverse") && section.getSubSectionName().equals("PARAMS")) {
double[] sigma = null; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("PNN") && section.getSubSectionName().equals("PARAMS")) {
final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while((section = in.readNextSection()) != null) { if(section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("PARAMS")) { final Map<String, String> params = section.parseParams();
EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("SVM") && section.getSubSectionName().equals("PARAMS")) {
EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("ART1") && section.getSubSectionName().equals("PARAMS")) {
EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("PARAMS")) {
EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("RBF-NETWORK") && section.getSubSectionName().equals("PARAMS")) {