All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hex.schemas.DeepLearningModelV2 Maven / Gradle / Ivy

package hex.schemas;

import hex.deeplearning.DeepLearningModel;
import water.Key;
import water.api.ModelOutputSchema;
import water.api.ModelSchema;
import water.util.PojoUtils;

public class DeepLearningModelV2 extends ModelSchema {

  public static final class DeepLearningModelOutputV2 extends ModelOutputSchema {
    //FIXME
    //add output fields

    @Override public DeepLearningModel.DeepLearningOutput createImpl() {
      DeepLearningModel.DeepLearningOutput impl = new DeepLearningModel.DeepLearningOutput(null);
      PojoUtils.copyProperties(impl, this, PojoUtils.FieldNaming.DEST_HAS_UNDERSCORES);
      return impl;
    }

    // Version&Schema-specific filling from the handler
    @Override public DeepLearningModelOutputV2 fillFromImpl( DeepLearningModel.DeepLearningOutput impl) {
      PojoUtils.copyProperties(this, impl, PojoUtils.FieldNaming.ORIGIN_HAS_UNDERSCORES);
      return this;
    }


  } // DeepLearningModelOutputV2

  // TOOD: I think we can implement the following two in ModelSchema, using reflection on the type parameters.
  public DeepLearningV2.DeepLearningParametersV2 createParametersSchema() { return new DeepLearningV2.DeepLearningParametersV2(); }
  public DeepLearningModelOutputV2 createOutputSchema() { return new DeepLearningModelOutputV2(); }

  //==========================
  // Custom adapters go here

  // Version&Schema-specific filling into the impl
  @Override public DeepLearningModel createImpl() {
    DeepLearningV2.DeepLearningParametersV2 p = ((DeepLearningV2.DeepLearningParametersV2)this.parameters);
    DeepLearningModel.DeepLearningParameters parms = p.createImpl();
    return new DeepLearningModel(Key.make() /*dest*/, parms, new DeepLearningModel.DeepLearningOutput(null), null, null);
  }

  // Version&Schema-specific filling from the impl
  @Override public DeepLearningModelV2 fillFromImpl( DeepLearningModel kmm ) {
    return super.fillFromImpl(kmm);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy