com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

Using Deep Learning Models without H2O Runtime

This section describes how to use deep learning models without H2O runtime in WSO2 ML predictions. This is done using a POJO file that encapsulates the model used for prediction.

  1. Build a deep learning model.
    For detailed instructions to create a model, see Generating Models.
    For more information about deep learning, see Generating a Model Using the Stacked Autoencoders Algorithm     .
  2. Locate the following files in <ML_HOME>/models directory. These files are required to use the deep learning models.
    • <model_name>_dl file: This file contains the required model configurations of the DL model.
    • A java file with <model_name>s’ “.” and “-” replaced by “_” - POJO file.
  3. Enter the following command in the command prompt while the H2O server is running.
    curl http://{IP_address}:54321/3/h2o-genmodel.jar > h2o-genmodel.jar 
    This downloads the h2o-genmodel.jar file which is required to compile the POJO file.
  4. Install the required ML features in WSO2 CEP, and then disable the H2O server by setting the following property in the <CEP_HOME>/repository/etc/h2o-config.xml file.
    <property name="enabled">false</property>
  5. When ML features are installed in WSO2 CEP, the models directory is created inside <CEP_HOME>. Create a directory named dl_models inside the <CEP_HOME>/models directory, and place the POJO java file and h2o-genmodel.jar in it.
  6. Navigate to <CEP_HOME>/models/dl_models from the command line, and issue the following command to compile the POJO file.
    javac -cp h2o-genmodel.jar -J-Xmx2g -J-XX:MaxPermSize=128m {DL_MODEL}.java
    As a result, all the class files required to use deep learning models for prediction are created.
  7. Predict using the deep learning model.

When you are prompted to set the location of the deep learning model at the time of making predictions, give the location (registry or file path) of the <model_name>_dl file you saved separately in step 3.