H2O is an Open Source, Distributed, Fast & Scalable Machine Learning Platform: Deep Learning, Gradient Boosting (GBM) & XGBoost, Random Forest, Generalized Linear Modeling (GLM with Elastic Net), K-Means, PCA, Generalized Additive Models (GAM), RuleFit, Support Vector Machine (SVM), Stacked Ensembles, Automatic Machine Learning (AutoML), etc.
I'm sorry, I may be confused, but how is the code thread safe if there are lines like this:
ACTIVATION[i][r] = Math.max(0, ACTIVATION[i][r]);
Where ACTIVATION is defined as:
public static final double[][] ACTIVATION = new double[][] {
/ Input / dl0_Activation_0.VALUES,
/ Rectifier / dl0_Activation_1.VALUES,
/ Rectifier / dl0_Activation_2.VALUES,
/ Softmax / dl0_Activation_3.VALUES
};
Since all the local storage for the generated class is static, everything is overwritten by multiple threads.
Am I missing something? (I ask because I get different results from a multithreaded version of my code than from a single threaded, so I looked into the generated class and found this)
Thanks
On Wednesday, February 17, 2016 at 2:54:38 AM UTC-8, Tom Kraljevic wrote:
the generated pojo code is thread safe.
and if you are using the "easy" pojo api model wrappers, you can allocate the wrappers up front and share them across threads, as shown in the building a smarter application code example.
Is there any reason why the generated predictor code isn't thread safe? Are there any "easy" ways to change all the static variables so the classes can be used by multiple threads?
On Feb 17, 2016, at 7:10 AM, Jamie MacLennan heyjamiemac@gmail.com wrote:
I'm sorry, I may be confused, but how is the code thread safe if there are lines like this:
ACTIVATION[i][r] = Math.max(0, ACTIVATION[i][r]);
Where ACTIVATION is defined as:
public static final double[][] ACTIVATION = new double[][] { / Input / dl0_Activation_0.VALUES, / Rectifier / dl0_Activation_1.VALUES, / Rectifier / dl0_Activation_2.VALUES, / Softmax / dl0_Activation_3.VALUES };
Since all the local storage for the generated class is static, everything is overwritten by multiple threads.
Am I missing something? (I ask because I get different results from a multithreaded version of my code than from a single threaded, so I looked into the generated class and found this)
Thanks
On Wednesday, February 17, 2016 at 2:54:38 AM UTC-8, Tom Kraljevic wrote:
the generated pojo code is thread safe.
and if you are using the "easy" pojo api model wrappers, you can allocate the wrappers up front and share them across threads, as shown in the building a smarter application code example.
tom
Sent from my iPhone
On Feb 16, 2016, at 10:04 PM, Jamie MacLennan heyja...@gmail.com wrote:
Is there any reason why the generated predictor code isn't thread safe? Are there any "easy" ways to change all the static variables so the classes can be used by multiple threads?