Package org.encog.ml

Examples of org.encog.ml.MLMethod


  private MLMethod obtainMethod() {
    final String resourceID = getProp().getPropertyString(
        ScriptProperties.ML_CONFIG_MACHINE_LEARNING_FILE);
    final File resourceFile = getScript().resolveFilename(resourceID);

    final MLMethod method = (MLMethod) EncogDirectoryPersistence
        .loadObject(resourceFile);

    if (!(method instanceof MLMethod)) {
      throw new AnalystError(
          "The object to be trained must be an instance of MLMethod. "
              + method.getClass().getSimpleName());
    }

    return method;
  }
View Full Code Here


    final int input = egb.getInputCount();
    final int ideal = egb.getIdealCount();
    egb.close();

    final MLMethodFactory factory = new MLMethodFactory();
    final MLMethod obj = factory.create(type, arch, input, ideal);

    EncogDirectoryPersistence.saveObject(resourceFile, obj);

    return false;
  }
View Full Code Here

    final File methodFile = analyst.getScript().resolveFilename(methodID);

    final File processFile = analyst.getScript().resolveFilename(processID);

    MLMethod method = null;
    int[] contextTargetOffset = null;
    int[] contextTargetSize = null;
    boolean hasContext = false;
    int inputCount = 0;
    int[] layerContextCount = null;
View Full Code Here

  private void embedNetwork(final EncogProgramNode node) {
    addBreak();

    final File methodFile = (File) node.getArgs().get(0).getValue();

    final MLMethod method = (MLMethod) EncogDirectoryPersistence
        .loadObject(methodFile);

    if (!(method instanceof MLFactory)) {
      throw new EncogError("Code generation not yet supported for: "
          + method.getClass().getName());
    }

    final FlatNetwork flat = ((ContainsFlat) method).getFlat();

    // header
View Full Code Here

  private void embedNetwork(final EncogProgramNode node) {
    addBreak();

    final File methodFile = (File) node.getArgs().get(0).getValue();

    final MLMethod method = (MLMethod) EncogDirectoryPersistence
        .loadObject(methodFile);

    if (!(method instanceof MLFactory)) {
      throw new EncogError("Code generation not yet supported for: "
          + method.getClass().getName());
    }

    final MLFactory factoryMethod = (MLFactory) method;

    final String methodName = factoryMethod.getFactoryType();
View Full Code Here

    final File methodFile = analyst.getScript().resolveFilename(methodID);

    final File processFile = analyst.getScript().resolveFilename(processID);

    MLMethod method = null;
    int[] contextTargetOffset = null;
    int[] contextTargetSize = null;
    boolean hasContext = false;
    int inputCount = 0;
    int[] layerContextCount = null;
View Full Code Here

    final File resourceFile = getScript().resolveFilename(resourceID);

    final File outputFile = getAnalyst().getScript().resolveFilename(
        outputID);

    final MLMethod method = (MLMethod) EncogDirectoryPersistence
        .loadObject(resourceFile);
    getAnalyst().setMethod(method);
   
    if( method instanceof BayesianNetwork ) {
      ((BayesianNetwork)method).defineClassificationStructure(query);
View Full Code Here

  @Override
  public boolean executeCommand(final String args) {

    setKfold( obtainCross() );
    final MLDataSet trainingSet = obtainTrainingSet();
    MLMethod method = obtainMethod();
    final MLTrain trainer = createTrainer(method, trainingSet);
   
    if( method instanceof BayesianNetwork ) {
      final String query = getProp().getPropertyString(
          ScriptProperties.ML_CONFIG_QUERY);
View Full Code Here

  public MLMethod obtainMethod() {
    final String resourceID = getProp().getPropertyString(
        ScriptProperties.ML_CONFIG_MACHINE_LEARNING_FILE);
    final File resourceFile = getScript().resolveFilename(resourceID);

    final MLMethod method = (MLMethod) EncogDirectoryPersistence
        .loadObject(resourceFile);

    if (!(method instanceof MLMethod)) {
      throw new AnalystError(
          "The object to be trained must be an instance of MLMethod. "
              + method.getClass().getSimpleName());
    }

    return method;
  }
View Full Code Here

    final int input = egb.getInputCount();
    final int ideal = egb.getIdealCount();
    egb.close();

    final MLMethodFactory factory = new MLMethodFactory();
    final MLMethod obj = factory.create(type, arch, input, ideal);

    if (obj instanceof BayesianNetwork) {
      final String query = getProp().getPropertyString(
          ScriptProperties.ML_CONFIG_QUERY);
      ((BayesianNetwork) obj).defineClassificationStructure(query);
View Full Code Here

TOP

Related Classes of org.encog.ml.MLMethod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.