minibatchqueue function cannot generate the expected MiniBatchSize

조회 수: 2 (최근 30일)
Li Ea
Li Ea 2022년 5월 6일
댓글: Li Ea 2022년 5월 9일
As the title states, when I am using minibatchqueue, the data generated is not the batch size I specified, but the full batch.
Here's a very simple code to illustrate the problem:
t_list = dlarray(0:0.001:2,'CB');
mbq = minibatchqueue( ...
arrayDatastore(t_list), ...
MiniBatchFormat='CB',...
MiniBatchSize=200, ...
OutputEnvironment='auto');
next(mbq);
Running this code reveals two things that are not as expected:
I don't know what the problem is. Thanks to the technician for paying attention and giving an answer!

채택된 답변

Joss Knight
Joss Knight 2022년 5월 6일
You've asked your arrayDatastore to iterate over the rows because that's the default. So as far as arrayDatastore is concerned, you have one row, therefore the maximum number of times you can call read() is 1. Therefore minibatchqueue truncates the MiniBatchSize to 1 because you only have 1 observation.
If you want arrayDatastore to iterate over the columns you need to specify an IterationDimension of 2.
  댓글 수: 1
Li Ea
Li Ea 2022년 5월 9일
Thank you very much for your answer, my puzzle was solved perfectly!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by