我正在使用 SVMLib 在 MNIST 数据集上训练一个简单的 SVM。它包含 60.000 个训练数据。但是,我有几个性能问题:训练似乎没完没了(几个小时后,我不得不手动关闭它,因为它没有响应)。我的代码很简单,我只调用ovrtrain
数据集,没有任何内核和任何特殊常量:
function features = readFeatures(fileName)
[fid, msg] = fopen(fileName, 'r', 'ieee-be');
header = fread(fid, 4, "int32" , 0, "ieee-be");
if header(1) ~= 2051
fprintf("Wrong magic number!");
end
M = header(2);
rows = header(3);
columns = header(4);
features = fread(fid, [M, rows*columns], "uint8", 0, "ieee-be");
fclose(fid);
return;
endfunction
function labels = readLabels(fileName)
[fid, msg] = fopen(fileName, 'r', 'ieee-be');
header = fread(fid, 2, "int32" , 0, "ieee-be");
if header(1) ~= 2049
fprintf("Wrong magic number!");
end
M = header(2);
labels = fread(fid, [M, 1], "uint8", 0, "ieee-be");
fclose(fid);
return;
endfunction
labels = readLabels("train-labels.idx1-ubyte");
features = readFeatures("train-images.idx3-ubyte");
model = ovrtrain(labels, features, "-t 0"); % doesn't respond...
我的问题:这正常吗?我在虚拟机 Ubuntu 上运行它。我应该等待更长的时间吗?