I am teaching my comp to add naturals by creating a neural network:

trainingset = {"1+2" -> 3, "2+2" -> 4, "3+9" -> 12, "4+5" -> 9, 
"6+2" -> 8, "5+4" -> 9, "1+8" -> 9, "2+8" -> 10}; 
p = Predict[trainingset, Method -> "NeuralNetwork"];
p["3+4"] // Round


Not so bad, taking into account a small size of the trainingset.

What neural network is created by p? What layers does the one include? I find an answer in neither

Information[p, "Properties"]

{"AcceptanceThreshold", "AnomalyDetector", "BatchEvaluationSpeed",
"BatchEvaluationTime", "Calibrated", "EvaluationTime",
"ExampleNumber", "FeatureExtractor", "FeatureNames", "FeatureNumber",
"FeatureTypes", "FunctionMemory", "FunctionProperties",
"IndeterminateThreshold", "LearningCurve", "MaxTrainingMemory",
"MeanCrossEntropy", "Method", "MethodDescription", "MethodOption",
"MethodParameters", "MissingSynthesizer", "PerformanceGoal",
"Properties", "StandardDeviation", "TrainingLabelMean",
"TrainingTime", "UtilityFunction"}


Information[p, "MethodDescription"]

"An neural networks is composed of layers of artificial neuron units. Each unit computes its value as a function of the unit values in the previous layer. Information is processed layer by layer from the feature layer to the \noutput unit which gives the predicted value. It is also called a feed-forward neural network or a multi-layer perceptron"

Is that neural network similar to In[22] in the documentation?

  • 1
    $\begingroup$ The network itself can be extracted by p[[1]]["Model"]["Network"], and you can generally dive into the predictor function by replacing its head with List, e.g. List@@p. However, there is some preprocessing involved in formatting the input to the network, and the network itself is a bit on the complicated side to dive into. $\endgroup$
    – eyorble
    Commented Feb 20, 2023 at 8:43
  • $\begingroup$ @eyorble: Thank you. The result of p[[1]]["Model"]["Network"] is not clear to me. Can you kindly give an answer, elaborating your comment? $\endgroup$
    – user64494
    Commented Feb 20, 2023 at 9:05


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.