/** * {@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(); } } }
public final Object read(final InputStream is) { final BayesianNetwork result = new BayesianNetwork(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; String queryType = "";
/** * {@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; }
final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section;
List<StateDistribution> distributions = new ArrayList<StateDistribution>(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section;
/** * {@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; }
public Object read(final InputStream is) { final BoltzmannMachine result = new BoltzmannMachine(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section;
innovationList.setPopulation(result); result.setInnovations(innovationList); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section;
public Object read(final InputStream is) { Map<String, String> networkParams = null; final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; int inputCount = 0;
Map<String, String> objParams=null; BasicUniverse result = null; final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section;
public Object read(final InputStream is) { final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; final BasicMLDataSet samples = new BasicMLDataSet();
final BasicFloatNetwork result = new BasicFloatNetwork(); final FlatNetwork flat = new FlatNetwork(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while((section = in.readNextSection()) != null) {
public Object read(final InputStream is) { final SVM result = new SVM(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section;
public Object read(final InputStream is) { final ART1 result = new ART1(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section;
final BasicNetwork result = new BasicNetwork(); final FlatNetwork flat = new FlatNetwork(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section;
final FlatNetworkRBF flat = (FlatNetworkRBF) result.getFlat(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section;