reset
Reset minibatchqueue to start of data
Syntax
Description
reset( resets mbq)mbq back
to the start of the underlying datastore.
Examples
You can call next on a
minibatchqueue object until all data is returned. When you reach the end of
the data, use reset to reset the minibatchqueue object and
continue obtaining mini-batches with next.
Create a minibatchqueue object from a datastore.
ds = digitDatastore; mbq = minibatchqueue(ds,MiniBatchSize=256)
mbq =
minibatchqueue with 1 output and properties:
Mini-batch creation:
MiniBatchSize: 256
PartialMiniBatch: 'return'
MiniBatchFcn: 'collate'
PreprocessingEnvironment: 'serial'
Outputs:
OutputCast: {'single'}
OutputAsDlarray: 1
MiniBatchFormat: {''}
OutputEnvironment: {'auto'}
Iterate over all data in the minibatchqueue object. Use
hasdata to check if data is still available.
while hasdata(mbq) [~] = next(mbq); end
When hasdata returns 0
(false), you cannot collect a mini-batch using
next.
hasdata(mbq)
ans = 0
X = next(mbq);
Error using minibatchqueue/next (line 353) Unable to provide a mini-batch because end of data reached. Use reset or shuffle to continue generating mini-batches from the data set.
Reset the minibatchqueue object. Now, hasdata returns
1 (true), and you can continue to obtain data
using next.
reset(mbq); hasdata(mbq)
ans = 1
X = next(mbq);
Input Arguments
Mini-batch queue, specified as a minibatchqueue object.
Version History
Introduced in R2020b
See Also
hasdata | next | shuffle | minibatchqueue
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)