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.
- 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 . - 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.
- 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 theh2o-genmodel.jar
file which is required to compile the POJO file. - 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>
- When ML features are installed in WSO2 CEP, the
models
directory is created inside<CEP_HOME>
. Create a directory nameddl_models
inside the<CEP_HOME>/models
directory, and place thePOJO
java file andh2o-genmodel.jar
in it. - 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.
- 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.