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:
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
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$