3
$\begingroup$

I tried to construct a predictor for a continuous variable using neural networks, something like

f(a,b,c,d,e) = x,

trying to predict x for a given set of a,b,c,d, and e.

The builtin Predict[] already did a great job, running

f = Predict[trainingData, Method->"NeuralNetwork"].

Because in the end this is just for prototyping, and I want to rebuilt the network "manually", I extracted the layer information, and it looks like this:

enter image description here

Afterwards I created a NetChain to reproduce the results from the PredictorFunction

net = NetChain[

   Flatten[
    {LinearLayer[50],
     
     Table[{
       LinearLayer[50],
       ElementwiseLayer["SELU"],
       DropoutLayer[0.5]
       }, {i, 
       10}],
     LinearLayer[50], LinearLayer[1]}]
   
   , "Input" -> 5
   ];

The problem arises here: After training, my self-made network performs significantly worse (always predicting a value very close to the mean of the training data set), so I guess the training process is significantly different.

result = NetTrain[ net, trainingData, All, MaxTrainingRounds -> 20]
f = result["TrainedNetwork"]

Is there a significant difference in the training process, if NetTrain is used rather than Predict[], or is something else causing the bad performance of my network?

Thanks in advance

$\endgroup$
2
  • $\begingroup$ Predict might be doing some preprocessing on the data. Can you provide an example of the training data or the predictor function as a WMLF file? $\endgroup$
    – Batracos
    Commented Apr 20, 2022 at 13:48
  • $\begingroup$ I think you should consider visit this mathematica.stackexchange.com/questions/146440/… $\endgroup$
    – Schwarzer
    Commented Feb 20, 2023 at 21:36

0

Your Answer

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

Browse other questions tagged or ask your own question.