6
$\begingroup$

I would like to use PredictorMeasurements on the result of NetTrain, but it says it expects a PredictorFunction object. So apparently, the output of NetTrain is not a PredictorFunction.

Am I right? If so, can this be done?

Thanks

$\endgroup$

1 Answer 1

5
$\begingroup$

In Mathematica 11.1 you can convert your network only into a ClassifierFunction. I expect that converting into a PredictorFunction will be added in the next releases.

net = NetChain[
  {100, 2, SoftmaxLayer[]},
  "Input" -> 100,
  "Output" -> NetDecoder[{"Class", {0, 1}}]
  ]

SeedRandom[0];
X = RandomReal[{-1, 1}, {1000, 100}];
Y = RandomInteger[1, 1000];

net = NetTrain[net, X -> Y, MaxTrainingRounds -> 1]

c = Classify[net]

enter image description here

UPDATE

Yes, it's possible.

https://mathematica.stackexchange.com/a/169186/23402

$\endgroup$
2
  • $\begingroup$ Any idea how to ensure that a net is evaluated with a GPU when applying ClassifierMeasurements? Takes forever with a CPU... $\endgroup$
    – dan7geo
    Commented Jun 5, 2017 at 6:21
  • $\begingroup$ @dan7geo I don't know. Sorry. $\endgroup$ Commented Jun 5, 2017 at 12:35

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.