shuffle
데이터저장소의 모든 데이터 읽기 섞기
설명
예제
파일 섞기(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
입력 인수
ds
— 입력 데이터저장소
객체
입력 데이터저장소로, datastore 객체로 지정됩니다. 입력 데이터저장소는 isShuffleable
이 true
를 반환하는 모든 데이터저장소(예: imageDatastore
)일 수 있습니다. 입력 데이터저장소는 모든 기본 데이터저장소의 섞기가 가능한 CombinedDatastore
, SequentialDatastore
또는 TransformedDatastore
일 수도 있습니다.
출력 인수
dsrand
— 출력 데이터저장소
객체
출력 데이터저장소로, ds
의 데이터를 임의의 순서로 포함하는 datastore 객체로 반환됩니다.
확장 기능
스레드 기반 환경
MATLAB®의 backgroundPool
을 사용해 백그라운드에서 코드를 실행하거나 Parallel Computing Toolbox™의 ThreadPool
을 사용해 코드 실행 속도를 높일 수 있습니다.
사용법 관련 참고 및 제한 사항:
스레드 기반 환경에서는 다음과 같은 데이터저장소에만
shuffle
함수를 사용할 수 있습니다.ImageDatastore
객체ImageDatastore
객체로부터combine
또는transform
을 사용하여 생성한CombinedDatastore
,SequentialDatastore
또는TransformedDatastore
객체
Parallel Computing Toolbox™가 있는 경우
shuffle
함수를 다른 데이터저장소에도 사용할 수 있습니다. 이렇게 하려면backgroundPool
또는ThreadPool
을 사용하는 대신 프로세스를 지원하는 병렬 풀을 사용하는 함수를 실행하십시오(ProcessPool
또는ClusterPool
사용).
자세한 내용은 스레드 기반 환경에서 MATLAB 함수 실행하기 항목을 참조하십시오.
버전 내역
R2016a에 개발됨
참고 항목
ImageDatastore
| datastore
| isShuffleable
| matlab.io.Datastore
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- 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)