2
$\begingroup$

Sorry if this was too trivial but I want to get the output of the neural network I trained for the specific inputs that I feed. The notation I often saw was of TrainedNet[inp] kind. But when I use this I do not get the output but the result given in figure below:enter image description here

$\endgroup$
2
  • $\begingroup$ Can you share the NetTrain invocation? I suspect you did NetTrain[mynet, data, All] - if you try something like results["TrainedNet"][inp] that may work. To avoid this, you can just do NetTrain[mynet, data] (ie, no All). $\endgroup$
    – Carl Lange
    Aug 26, 2019 at 15:21
  • $\begingroup$ Yes I was using it with All. It works fine when I remove the All. Thank you. $\endgroup$
    – Gizem Y.
    Aug 27, 2019 at 7:39

1 Answer 1

2
$\begingroup$

The issue here is that you used NetTrain[mynet, data, All], which returns a NetTrainResultsObject. From a NetTrainResultsObject, you can use ["TrainedNet"] (eg, results["TrainedNet"]) to get the network, or you can retrain your network with NetTrain[mynet, data] which will only return the trained net.

Further reading: https://reference.wolfram.com/language/ref/NetTrainResultsObject.html https://reference.wolfram.com/language/ref/NetTrain.html

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.