2
$\begingroup$

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?

$\endgroup$

1 Answer 1

3
$\begingroup$

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"]

netgraph

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:

linear units and SELUs net graph

$\endgroup$
2
  • $\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$
    – Uwe Gotzes
    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$
    – flinty
    Oct 8, 2020 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.