I am using the Predict-Function with the NeuralNetwork-method on some training data. But I cannot figure out the characteristics of the NN that is built, especially not the layer types. How can I get more information about the NN?
1 Answer
$\begingroup$
$\endgroup$
2
If you're on 12.1.1.0 then this works by peeking into the internals of PredictorFunction
:
trainingData = {0.3 -> 0, 0.4 -> 0, 0.5 -> 1, 0.6 -> 1, 0.9 -> 1};
pf = Predict[trainingData, Method -> "NeuralNetwork"];
First[pf]["Model"]["Network"]
All sorts of other properties are visible in the rat's nest of associations in First[pf]
.
We can go deeper and apply Normal
to the NetGraph
to see what specific functions are in the layers. As you can see it's all linear units and SELUs:
-
$\begingroup$ Thanks for that! I have a follow-up question. If I call
Information[pf, "NetworkDepth"]
in your example I get 8. How does that fit in? $\endgroup$ Commented Oct 8, 2020 at 8:49 -
$\begingroup$ Try retraining with
pf = Predict[trainingData, Method -> {"NeuralNetwork", "NetworkDepth" -> 5}]
, vary the NetworkDepth and see what the image above looks like. I have a feeling you get 8 because there is 1 initial linear layer, then 8 pairs of SELU+Linear units, and 1 final constant layer. $\endgroup$– flintyCommented Oct 8, 2020 at 12:10