"Extracting NN weights for use in other application."
wessel
New Altair Community Member
Dear All,
I wish to train a neural-network in RM, and export the weights to another Java program.
RM provides the following text output:
Node 1 (Sigmoid) Node 2 (Sigmoid) Output (Linear)
---------------- ---------------- -------------------
att1: -0.198 att1: -1.080 Node 1: 1.210
att2: 0.399 att2: -0.660 Node 2: -2.484
att3: 0.736 att3: -0.370 Threshold: 0.615
att4: 0.472 att4: -0.740
Threshold: -0.439 Threshold: 0.351
But this is of no use, since these weights are not in full double precision.
When I use the model writer to write an XML file, I think I do get the proper weights,
somewhere in the file, but the question is "where exactly".
For example:
<inputNodes id="73">
<com.rapidminer.operator.learner.functions.neuralnet.InnerNode id="74">
<weights id="75">
<double>-0.4394771578377415</double>
<double>-0.19801951972474785</double>
<double>0.3992843094056797</double>
<double>0.7363213055568706</double>
<double>0.4723782999051438</double>
<com.rapidminer.operator.learner.functions.neuralnet.InnerNode reference="74"/>
<com.rapidminer.operator.learner.functions.neuralnet.InnerNode id="91">
<weights id="92">
<double>0.3506573392426525</double>
<double>-1.0796773279531984</double>
<double>-0.6600984419916611</double>
<double>-0.36967194141103804</double>
<double>-0.7402183227344546</double>
</weights>
<weightChanges
These seem to correspond to the weights of hidden node 2.
But this XML file contains a lot more then just weights.
Best regards,
Wessel
I wish to train a neural-network in RM, and export the weights to another Java program.
RM provides the following text output:
Node 1 (Sigmoid) Node 2 (Sigmoid) Output (Linear)
---------------- ---------------- -------------------
att1: -0.198 att1: -1.080 Node 1: 1.210
att2: 0.399 att2: -0.660 Node 2: -2.484
att3: 0.736 att3: -0.370 Threshold: 0.615
att4: 0.472 att4: -0.740
Threshold: -0.439 Threshold: 0.351
But this is of no use, since these weights are not in full double precision.
When I use the model writer to write an XML file, I think I do get the proper weights,
somewhere in the file, but the question is "where exactly".
For example:
<inputNodes id="73">
<com.rapidminer.operator.learner.functions.neuralnet.InnerNode id="74">
<weights id="75">
<double>-0.4394771578377415</double>
<double>-0.19801951972474785</double>
<double>0.3992843094056797</double>
<double>0.7363213055568706</double>
<double>0.4723782999051438</double>
<com.rapidminer.operator.learner.functions.neuralnet.InnerNode reference="74"/>
<com.rapidminer.operator.learner.functions.neuralnet.InnerNode id="91">
<weights id="92">
<double>0.3506573392426525</double>
<double>-1.0796773279531984</double>
<double>-0.6600984419916611</double>
<double>-0.36967194141103804</double>
<double>-0.7402183227344546</double>
</weights>
<weightChanges
These seem to correspond to the weights of hidden node 2.
But this XML file contains a lot more then just weights.
Best regards,
Wessel
0
Answers
-
Hi Wessel,
the easiest and somehow quirky way would be to just increase the number of digits RapidMiner presents to the user. This is possible in the properties menu. It holds true for almost all places in RapidMiner and hence it should work with the Neural Net, too.
Greetings,
Sebastian0