You can download the FasionMNIST and unzip the data, you'll see that train-images-idx3-ubyte
.
You may also use official ResourceData["FashionMNIST"]
after Mathematica V12
.
I'm using fashion MNIST dataset to train with SVM method via Classify
.
I think MNIST can also reproduce this problem.
trainingBytes=Import["train-images-idx3-ubyte","Byte"];
trainingImages=Map[Image[Partition[#,28]]&,Partition[Drop[trainingBytes,16],28^2]];
testBytes=Import["t10k-images-idx3-ubyte","Byte"];
testImages=Map[Image[Partition[#,28]]&,Partition[Drop[testBytes,16],28^2]];
trainingLabels=Drop[Import["train-labels-idx1-ubyte","Byte"],8];
testLabels=Drop[Import["t10k-labels-idx1-ubyte","Byte"],8];
trainingSet=Thread[trainingImages->trainingLabels];
testSet=Thread[testImages->testLabels];
model = Classify[trainingSet, Method -> "SupportVectorMachine",
PerformanceGoal -> "TrainingSpeed"]
It's possible to train successful by chance, but the FrontEnd will generate some stuck problems in the progressing, that means the loss and examples in the panel are stopped to update and FrontEnd may broken.
The lucky thing is in this case it costs only about 7 minutes, I got a model.
However, if I run the code in wolframscript
, The training sample is always 10000/60000,
after 17 minutes, it gives some updating.
| 17m10s | 48000/60000 | SupportVectorMachine | 0.817 | 0.647 |
| 21m54s | 48000/60000 | SupportVectorMachine | 0.852 | 0.559 |
| 36m28s | 48000/60000 | SupportVectorMachine | 0.852 | 0.559 |
I'm on Mac 2018 pro with Mathematica 13.1, I think something is wrong with this implementation.
Update
on Windows 10, seems FrontEnd problem is also happened.
Wolfram Mathematica Broken and Quit in Windows.
RandomSample 20000 training data is enough to reproduce the problem on Windows.
Not only for SVM method, other method can produce such phenomenon.
ResourceData["FashionMNIST"]
$\endgroup$