The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"Replicating Rapid Miner Trained ANN Model in C"
We are working on a pattern recognition problem for last few months using Artificial Neural Network (ANN) modelling.
Recently we experimented with Rapid Miner to train our ANN models. The accuracy of the models is as desirable.
As the next step, we want to replicate the following trained ANN model in C.
Input Vector (3 nodes) --- > Normalization ----> Hidden Layer (3 nodes) -----> Sigmoid function ----> Output Layer (2 nodes) --> Sigmoid function
Query 1: We have used default normalization method. As per online documentation, since sigmoid function is used, the input vector values are scaled down between +1 and -1. Is the example below show my understanding of normalization:
Input1 (say 3 components) : [1, -3, 4];
Input2 (say 3 components) : [2, 6, -1];
Max value for each component: [2 6 4];
Normalized Input 1: [1/2 , -3/6, 4/4]; == [.5, -.5, 1];
Normalized Input 2: [2/2 , 6/6, -1/4]; == [1, 1, -.25];
Kindly confirm.
Query 2: If some other normalization is used (say using standard deviation and mean), how to view the values of those parameters?
Query 3: If there a direct export tool available with in Rapid Miner, so that we can replicate the model in C/Java?
We will be highly thankful if someone can respond with answers to our queries.
Recently we experimented with Rapid Miner to train our ANN models. The accuracy of the models is as desirable.
As the next step, we want to replicate the following trained ANN model in C.
Input Vector (3 nodes) --- > Normalization ----> Hidden Layer (3 nodes) -----> Sigmoid function ----> Output Layer (2 nodes) --> Sigmoid function
Query 1: We have used default normalization method. As per online documentation, since sigmoid function is used, the input vector values are scaled down between +1 and -1. Is the example below show my understanding of normalization:
Input1 (say 3 components) : [1, -3, 4];
Input2 (say 3 components) : [2, 6, -1];
Max value for each component: [2 6 4];
Normalized Input 1: [1/2 , -3/6, 4/4]; == [.5, -.5, 1];
Normalized Input 2: [2/2 , 6/6, -1/4]; == [1, 1, -.25];
Kindly confirm.
Query 2: If some other normalization is used (say using standard deviation and mean), how to view the values of those parameters?
Query 3: If there a direct export tool available with in Rapid Miner, so that we can replicate the model in C/Java?
We will be highly thankful if someone can respond with answers to our queries.
Tagged:
0
Answers
in your last question you ask, how to export a RapidMiner model to C or Java. RapidMiner is written entirely in Java, and it is open source, so you can access the complete RapidMiner API from your Java code (if it is released under the terms of the AGPL). One way to go would be to train your models in RapidMiner and store them in a repository. Then you can connect to the repository from your java code (using RapidMiner's API) and apply it.
Another possibilty which we probably would chose is to install an instance of RapidAnalytics, which allows you to export a classification process as a webservice. That way you could send unknown examples to the webservice, which will classify the data and send the labelled data back to the caller.
Question 1 and 2: to have more control over the normalization used you could disable the normalization option in the Neural Net and instead use the Normalization operator in front of it.
Best regards,
Marius
Replicating trained ANN model in any application; just to see it working
Hello,
what the matter? I’ve trained an ANN for a regression task. It consists of 19 Input nodes, 11 HiddenLayer- nodes and one in the output. (learning rate 0,35, training cycles 1000, Cross-Validation with 10 folds, root_mean_squared_error: 0.063 +/- 0.032 )
I wanted to recalculate the model acording to the values of weights and bias provided by RapidMiner. I did the following steps:
Under this link: an excel-file whith all values and calculation ca be found:
https://www.dropbox.com/sh/je5pvetfguq9yrg/AAB0eN1vH_Zo4DnW0lzSkL0Va?dl=0
Any idea, where at which point i’ve taken the wrong way?
Thanks in advance.
Lukas
Would you be able to provide the process XML?
Hey,
i think the easiest way is too look into our source code. The important class is: https://github.com/rapidminer/rapidminer-studio/blob/master/src/main/java/com/rapidminer/operator/learner/functions/neuralnet/ImprovedNeuralNetModel.java
Input and output nodes are basically just normalizing. The sigmoid function for inner nodes is defined at:
Best,
Martin
Dortmund, Germany
Sorry Thomas fo beeing so late respondig to Your post. Somehow I didn't get a mail....
So, I dont´' t get it. I did again the regression (ANN) on Rapidminer, where everything looks brilliant, but when rebuilding the process with excell i do not get the value i am searching for. This link provides the xml-file of the RM-process and the excel-sheet: https://www.dropbox.com/sh/je5pvetfguq9yrg/AAB0eN1vH_Zo4DnW0lzSkL0Va?dl=0
Hmm, my activision function is (1+exp(-x))^-1 where x ist the summed up product of the input values with their corresponding optimized weights. Do You use an other function?
Thank you very much in advance.
Lukas
And here again sorry for looking up so late Your post.
It is usefill for me because now I know, that my sigmoid-function is not the problem.
If I ever find a solution, I let You know.
Thanks& have a nice week-end.
Lukas