show
설명
예제
샘플 숫자 데이터의 압축을 풀고 영상 데이터저장소를 만듭니다. imageDatastore
함수는 폴더 이름을 기준으로 영상에 자동으로 레이블을 지정합니다.
unzip("DigitsData.zip") imds = imageDatastore("DigitsData", ... IncludeSubfolders=true, ... LabelSource="foldernames");
컨벌루션 신경망 아키텍처를 정의합니다. 신경망 입력 계층의 영상 크기와 마지막 완전 연결 계층의 클래스 개수를 지정합니다. 각 영상은 28×28×1 픽셀입니다.
inputSize = [28 28 1]; numClasses = numel(categories(imds.Labels)); layers = [ imageInputLayer(inputSize) convolution2dLayer(5,20) batchNormalizationLayer reluLayer fullyConnectedLayer(numClasses) softmaxLayer];
훈련 옵션을 지정합니다.
SGDM 솔버를 사용하여 훈련을 Epoch 4회 수행합니다.
정확도 메트릭을 모니터링합니다.
options = trainingOptions("sgdm", ... MaxEpochs=4, ... Metrics="accuracy");
신경망을 훈련시킵니다. 분류에는 교차 엔트로피 손실을 사용합니다. 훈련된 신경망과 훈련 정보를 반환합니다.
[net,info] = trainnet(imds,layers,"crossentropy",options);
Iteration Epoch TimeElapsed LearnRate TrainingLoss TrainingAccuracy _________ _____ ___________ _________ ____________ ________________ 1 1 00:00:01 0.01 2.7615 3.9062 50 1 00:00:06 0.01 0.48211 85.938 100 2 00:00:09 0.01 0.16471 96.094 150 2 00:00:13 0.01 0.10177 96.094 200 3 00:00:17 0.01 0.057216 100 250 4 00:00:20 0.01 0.031815 100 300 4 00:00:24 0.01 0.021116 100 312 4 00:00:25 0.01 0.029253 99.219 Training stopped: Max epochs completed
훈련 정보를 확인합니다.
info
info = TrainingInfo with properties: TrainingHistory: [312×5 table] ValidationHistory: [0×0 table] OutputNetworkIteration: 312 StopReason: "Max epochs completed"
show
함수를 사용하여 훈련 정보를 플롯으로 표시합니다.
show(info)
close
함수를 사용하여 플롯을 닫습니다.
close(info)
입력 인수
훈련 정보로, TrainingInfo
객체로 지정됩니다.
버전 내역
R2023b에 개발됨
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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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)