Do matlab has build-in mnist dataset for CNN training? If I load it as dlarray, how do I train it with CNN?

10 ビュー (過去 30 日間)
This documentation shows the example to design CNN for digit image classification.
Is the 'toolbox/nnet/nndemos/nndatasets/DigitDataset' MNIST dataset?
It just contains 1000 samples for each label.
MNIST should have 60k training and 10k testing data.
If I use the dataset downloaded and loaded by 'processImagesMNIST' in "examples/nnet/main" according to this, it gives dlarray.
It is not in the format for the imagedatastore.
I only find the way to train dlarray here, but it's not for simple CNN.
My current workaround is to convert dlarray to numeric array by extractdata, and then feed it to trainNetwork function.
Any other advice?
Thanks.

採用された回答

Walter Roberson
Walter Roberson 2022 年 8 月 3 日
編集済み: Walter Roberson 2022 年 8 月 5 日
  2 件のコメント
Runcong Kuang
Runcong Kuang 2022 年 8 月 4 日
Yes, thanks.
This is what I am using. But it's in dlarray, not that for trainNetwork function.
I searched for most of the answers and most of them use fread to read the downloaded files as unit8 format and normalize them.
I don't know if my extractdata method is efficient for the training in trainNetwork, or I should use DL toolbox method to this.
Thanks.
Walter Roberson
Walter Roberson 2022 年 8 月 5 日
No, if you
openExample('nnet/GeneratingHanddrawnDigitsUsingAVariationalAutoencoderVAEExample')
and then look at processImagesMNIST.m in that directory, you will see that the function reads an MNIST image and returns a 28 x 28 x 1 x something double precision value.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by