Skip to main content
added 68 characters in body
Source Link
Alexey Golyshev
  • 9.6k
  • 2
  • 27
  • 58

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

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

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

Source Link
Alexey Golyshev
  • 9.6k
  • 2
  • 27
  • 58

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