A program to recognize and reward our most engaged community members
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:
public double calculateValue(InnerNode node, Example example) { Node[] inputs = node.getInputNodes(); double[] weights = node.getWeights(); double weightedSum = weights[0]; // bias for (int i = 0; i < inputs.length; i++) { weightedSum += inputs[i].calculateValue(true, example) * weights[i + 1]; } double result = 0.0d; if (weightedSum < -45.0d) { result = 0; } else if (weightedSum > 45.0d) { result = 1; } else { result = 1 / (1 + Math.exp(-1 * weightedSum)); } return result; }
Best,
Martin
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.
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.
1 / (1 + Math.exp(-1 * weightedSum))
If I ever find a solution, I let You know.
Thanks& have a nice week-end.