/** * {@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; }
/** * 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(); } } }
continue; } else if( line.startsWith("##double")) { double[] d = readLargeArray(line); largeArrays.add(d); } else {
/** * {@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 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; }
public final Object read(final InputStream is) { final BayesianNetwork result = new BayesianNetwork(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; String queryType = ""; 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 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; }
List<StateDistribution> distributions = new ArrayList<StateDistribution>(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("HMM") && section.getSubSectionName().equals("PARAMS")) {
public Object read(final InputStream is) { final BoltzmannMachine result = new BoltzmannMachine(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("BOLTZMANN") && 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")) {
public Object read(final InputStream is) { Map<String, String> networkParams = null; final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; int inputCount = 0; Matrix m2 = null; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("CPN") && section.getSubSectionName().equals("PARAMS")) {
Map<String, String> objParams=null; BasicUniverse result = null; final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("BasicUniverse") && section.getSubSectionName().equals("PARAMS")) {
innovationList.setPopulation(result); result.setInnovations(innovationList); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("NEAT-POPULATION") && section.getSubSectionName().equals("INNOVATIONS")) {
public Object read(final InputStream is) { final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; final BasicMLDataSet samples = new BasicMLDataSet(); double[] sigma = null; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("PNN") && section.getSubSectionName().equals("PARAMS")) {
final BasicFloatNetwork result = new BasicFloatNetwork(); final FlatNetwork flat = new FlatNetwork(); 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();
public Object read(final InputStream is) { final ART1 result = new ART1(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("ART1") && section.getSubSectionName().equals("PARAMS")) {
public Object read(final InputStream is) { final SVM result = new SVM(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("SVM") && section.getSubSectionName().equals("PARAMS")) {
final BasicNetwork result = new BasicNetwork(); final FlatNetwork flat = new FlatNetwork(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("BASIC") && section.getSubSectionName().equals("PARAMS")) {
final FlatNetworkRBF flat = (FlatNetworkRBF) result.getFlat(); final EncogReadHelper in = new EncogReadHelper(is); EncogFileSection section; while ((section = in.readNextSection()) != null) { if (section.getSectionName().equals("RBF-NETWORK") && section.getSubSectionName().equals("PARAMS")) {