Manually construct a net and initialize it with random parameters:
net=NetInitialize@NetChain[{LinearLayer[10],BatchNormalizationLayer[],ElementwiseLayer[Ramp],LinearLayer[10],BatchNormalizationLayer[],ElementwiseLayer[Ramp],LinearLayer[1]},"Input""Scalar","Output""Scalar"]
Out[]=
NetChain
Evaluate it on a set of values:
net[{1,2,3}]
Out[]=
{0.240015,0.48003,0.720045}
In[]:=
x=Range[-5,5,.01];f:=x.3x^2+2x-4y=f[x];
Train the net for a few rounds checking in real time how it is fitting the model:
trainedNet=NetTrain[net,<|"Input"x,"Output"y|>,MaxTrainingRounds300,TrainingProgressReporting{Function[Plot[{f[x],#Net[x]},{x,-5,5},PlotLegends{HoldForm[f[x]],HoldForm[net[x]]}]],"Interval"1}];
Out[]=
The net result is now close to the symbolic computation:
trainedNet[{1,2,3}]
Out[]=
{-1.55553,1.0997,4.77498}
f[{1,2,3}]
Out[]=
{-1.7,1.2,4.7}