0
$\begingroup$

I am trying to replicate an example right out of the help manual (ref/method/NeuralNetwork). This example compares the convolutional NN versus a fully-connected NN. I am using Mathematica 11.3 on Linux 64 bit Uuntu 16.04.

data = Table[
   x -> x^2 + RandomVariate[NormalDistribution[]], {x, 
    RandomReal[{-10, 10}, 50]}];
dataplot = ListPlot[List @@@ data];

fullyconnectedpredictor = 
 Predict[data, 
  Method -> {"NeuralNetwork", "NetworkType" -> "FullyConnected"}]

convolutionalpredictor = 
 Predict[data, 
  Method -> {"NeuralNetwork", "NetworkType" -> "Convolutional"}]

The help manual provides the following plot as comparison:

Show[dataplot, 
 Plot[{fullyconnectedpredictor[x], 
   convolutionalpredictor[x]}, {x, -10, 10}, 
  PlotLegends -> {"FullyConnected", "Convolutional"}]]

enter image description here

Running the same example (in the help page) gives me a completely different and horrible result:

enter image description here

I thought maybe it was a Mathematica kernel issue and I restarted my computer and launched a fresh instance of Mathematica.

What happened here? Am I overlooking something? As an added note, if I were to change the Method->"NearestNeighbor" or "GradientBoostedTrees", it works just fine.

$\endgroup$
  • $\begingroup$ Works Fine In Mac @ Wolfram Mathematica 12.0 $\endgroup$ – HyperGroups May 24 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.