shuffle
データストア内のすべてのデータをシャッフルする
説明
例
ImageDatastore オブジェクト imds を作成します。ファイルをシャッフルして、同じファイルをランダムな順序で含む新しいデータストアを作成します。
imds = imageDatastore(fullfile(matlabroot, 'toolbox', 'matlab', {'demos','imagesci'}),'LabelSource','foldernames','FileExtensions', {'.jpg', '.png', '.tif'})
imds =
ImageDatastore with properties:
Files: {
' ...\matlab\toolbox\matlab\demos\cloudCombined.jpg';
' ...\matlab\toolbox\matlab\demos\example.tif';
' ...\matlab\toolbox\matlab\demos\landOcean.jpg'
... and 5 more
}
Labels: [demos; demos; demos ... and 5 more categorical]
ReadFcn: @readDatastoreImage
imdsrand = shuffle(imds)
imdsrand =
ImageDatastore with properties:
Files: {
' ...\matlab\toolbox\matlab\demos\street2.jpg';
' ...\matlab\toolbox\matlab\demos\landOcean.jpg';
' ...\matlab\toolbox\matlab\imagesci\corn.tif'
... and 5 more
}
Labels: [demos; demos; imagesci ... and 5 more categorical]
ReadFcn: @readDatastoreImage
入力引数
入力データストア。datastore オブジェクトとして指定します。入力データストアには、isShuffleable が true を返す任意のデータストア (imageDatastore など) を指定できます。また、入力データストアには、基となるすべてのデータストアがシャッフル可能な CombinedDatastore、SequentialDatastore、または TransformedDatastore も指定できます。
出力引数
出力データストア。ds のデータをランダムな順序で含む datastore オブジェクトとして返されます。
拡張機能
使用上の注意および制限:
スレッドベースの環境では、次のデータストアでのみ
shuffleを使用できます。ImageDatastoreオブジェクトcombineまたはtransformを使用してImageDatastoreオブジェクトから作成するCombinedDatastore、SequentialDatastore、またはTransformedDatastoreオブジェクト
Parallel Computing Toolbox™ がある場合は、他のデータストアで
shuffleを使用できます。これを行うには、backgroundPoolまたはThreadPoolを使用する代わりに、プロセスベースの並列プールを使用して関数を実行します (ProcessPoolまたはClusterPoolを使用します)。
詳細については、スレッドベースの環境での MATLAB 関数の実行を参照してください。
バージョン履歴
R2016a で導入
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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)