Main Content

Layer

딥러닝을 위한 신경망 계층

설명

딥러닝을 위한 신경망의 아키텍처를 정의하는 계층입니다.

생성

MATLAB®의 딥러닝 계층 목록은 딥러닝 계층 목록 항목을 참조하십시오. 모든 계층이 순차적으로 연결된 신경망의 아키텍처를 지정하려면 계층으로 구성된 배열을 직접 만드십시오. 계층이 입력값 또는 출력값을 여러 개 가질 수 있는 신경망 아키텍처를 지정하려면 dlnetwork 객체를 사용하십시오.

또는 importCaffeLayers, importKerasLayers, importONNXLayers를 사용하여 각각 Caffe, Keras, ONNX에서 계층을 가져올 수도 있습니다.

사용자 지정 계층을 만드는 방법은 사용자 지정 딥러닝 계층 정의하기 항목을 참조하십시오.

예제

모두 축소

하나의 컨벌루션 계층, ReLU 계층, 완전 연결 계층을 갖는 분류를 위한 컨벌루션 신경망 아키텍처를 정의합니다.

layers = [ ...
    imageInputLayer([28 28 3])
    convolution2dLayer([5 5],10)
    reluLayer
    fullyConnectedLayer(10)
    softmaxLayer
    classificationLayer]
layers = 
  6x1 Layer array with layers:

     1   ''   Image Input             28x28x3 images with 'zerocenter' normalization
     2   ''   2-D Convolution         10 5x5 convolutions with stride [1  1] and padding [0  0  0  0]
     3   ''   ReLU                    ReLU
     4   ''   Fully Connected         10 fully connected layer
     5   ''   Softmax                 softmax
     6   ''   Classification Output   crossentropyex

layersLayer 객체입니다.

또는 계층을 개별적으로 만든 다음 결합해도 됩니다.

input = imageInputLayer([28 28 3]);
conv = convolution2dLayer([5 5],10);
relu = reluLayer;
fc = fullyConnectedLayer(10);
sm = softmaxLayer;
co = classificationLayer;

layers = [ ...
    input
    conv
    relu
    fc
    sm
    co]
layers = 
  6x1 Layer array with layers:

     1   ''   Image Input             28x28x3 images with 'zerocenter' normalization
     2   ''   2-D Convolution         10 5x5 convolutions with stride [1  1] and padding [0  0  0  0]
     3   ''   ReLU                    ReLU
     4   ''   Fully Connected         10 fully connected layer
     5   ''   Softmax                 softmax
     6   ''   Classification Output   crossentropyex

하나의 컨벌루션 계층, ReLU 계층, 완전 연결 계층을 갖는 분류를 위한 컨벌루션 신경망 아키텍처를 정의합니다.

layers = [ ...
    imageInputLayer([28 28 3])
    convolution2dLayer([5 5],10)
    reluLayer
    fullyConnectedLayer(10)
    softmaxLayer];

첫 번째 계층을 선택하여 영상 입력 계층을 표시합니다.

layers(1)
ans = 
  ImageInputLayer with properties:

                      Name: ''
                 InputSize: [28 28 3]
        SplitComplexInputs: 0

   Hyperparameters
          DataAugmentation: 'none'
             Normalization: 'zerocenter'
    NormalizationDimension: 'auto'
                      Mean: []

영상 입력 계층의 입력 크기를 표시합니다.

layers(1).InputSize
ans = 1×3

    28    28     3

컨벌루션 계층의 스트라이드를 표시합니다.

layers(2).Stride
ans = 1×2

     1     1

완전 연결 계층의 편향 학습률 인자에 액세스합니다.

layers(4).BiasLearnRateFactor
ans = 1

버전 내역

R2016a에 개발됨