Mathematica Asked on August 7, 2021
I have used Mathematica’s automated Classify function:
class = Classify[trainlist, Method -> "NeuralNetwork",
PerformanceGoal -> "Quality"];
acc = ClassifierMeasurements[class, testlist];
‘trainlist’ has 720 examples and ‘testlist’ has 180 examples. I get 89% accuracy. Great. But now I would like build the network from scratch so I can understand it better. That turns out to be very difficult since Classify[] is like a black box.
The most information I can get about how the network is built is from these two tables. So I tried to build my own from this information:
net = NetChain[{LinearLayer[50, "Input" -> 251],
ElementwiseLayer["SELU"], LinearLayer[50, "Input" -> 50],
ElementwiseLayer["SELU"], LinearLayer[9, "Input" -> 50],
SoftmaxLayer["Input" -> {9}]}]
netin = NetInitialize[net]
nettrain =
NetTrain[netin, trainlist[[1 ;; 576]], Method -> "ADAM",
MaxTrainingRounds -> 1000, ValidationSet -> trainlist[[577 ;; 720]]]
In all there are about 15500 parameters (I assume they mean weights). But when I check the accuracy, it’s only 0.1111. I have nine classifications so that means it only does as well as random guessing. Why is it so difficult to build a network that does as well as the automated function?
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP