2017-02-09 1 views
1

googlenet의 prototxt를 살펴보면 맨 아래에 여러 개의 하단 입력이있는 연결 레이어가 시작 레이어에 있음을 알 수 있습니다.연결 계층 다음에 googlenet의 출력 차원은 무엇입니까?

예컨대 :

가 알 수있는 바와 같이
layer { 
    name: "inception_3a/output" 
    type: "Concat" 
    bottom: "inception_3a/1x1" 
    bottom: "inception_3a/3x3" 
    bottom: "inception_3a/5x5" 
    bottom: "inception_3a/pool_proj" 
    top: "inception_3a/output" 
} 

, 하나 개의 1x1 전환 계층, 하나 개의 3 × 전환 계층, 하나 개의 5x5 전환 층 최종적 풀링 층이있다. 이들 층은 다음과 같이 설명된다 :

입력 : 이러한 출력 상이한 개수도 다른 필터 사이즈의 CONCAT 층에 아무렇게나 문서를 가지고 있음을 알 수있다

layer { 
    name: "inception_3a/1x1" 
    type: "Convolution" 
    bottom: "pool2/3x3_s2" 
    top: "inception_3a/1x1" 
    param { 
    lr_mult: 1 
    decay_mult: 1 
    } 
    param { 
    lr_mult: 2 
    decay_mult: 0 
    } 
    convolution_param { 
    num_output: 64 
    kernel_size: 1 
    weight_filler { 
     type: "xavier" 
     std: 0.03 
    } 
    bias_filler { 
     type: "constant" 
     value: 0.2 
    } 
    } 
} 
layer { 
    name: "inception_3a/relu_1x1" 
    type: "ReLU" 
    bottom: "inception_3a/1x1" 
    top: "inception_3a/1x1" 
} 
layer { 
    name: "inception_3a/3x3_reduce" 
    type: "Convolution" 
    bottom: "pool2/3x3_s2" 
    top: "inception_3a/3x3_reduce" 
    param { 
    lr_mult: 1 
    decay_mult: 1 
    } 
    param { 
    lr_mult: 2 
    decay_mult: 0 
    } 
    convolution_param { 
    num_output: 96 
    kernel_size: 1 
    weight_filler { 
     type: "xavier" 
     std: 0.09 
    } 
    bias_filler { 
     type: "constant" 
     value: 0.2 
    } 
    } 
} 
layer { 
    name: "inception_3a/relu_3x3_reduce" 
    type: "ReLU" 
    bottom: "inception_3a/3x3_reduce" 
    top: "inception_3a/3x3_reduce" 
} 
layer { 
    name: "inception_3a/3x3" 
    type: "Convolution" 
    bottom: "inception_3a/3x3_reduce" 
    top: "inception_3a/3x3" 
    param { 
    lr_mult: 1 
    decay_mult: 1 
    } 
    param { 
    lr_mult: 2 
    decay_mult: 0 
    } 
    convolution_param { 
    num_output: 128 
    pad: 1 
    kernel_size: 3 
    weight_filler { 
     type: "xavier" 
     std: 0.03 
    } 
    bias_filler { 
     type: "constant" 
     value: 0.2 
    } 
    } 
} 
layer { 
    name: "inception_3a/relu_3x3" 
    type: "ReLU" 
    bottom: "inception_3a/3x3" 
    top: "inception_3a/3x3" 
} 
layer { 
    name: "inception_3a/5x5_reduce" 
    type: "Convolution" 
    bottom: "pool2/3x3_s2" 
    top: "inception_3a/5x5_reduce" 
    param { 
    lr_mult: 1 
    decay_mult: 1 
    } 
    param { 
    lr_mult: 2 
    decay_mult: 0 
    } 
    convolution_param { 
    num_output: 16 
    kernel_size: 1 
    weight_filler { 
     type: "xavier" 
     std: 0.2 
    } 
    bias_filler { 
     type: "constant" 
     value: 0.2 
    } 
    } 
} 
layer { 
    name: "inception_3a/relu_5x5_reduce" 
    type: "ReLU" 
    bottom: "inception_3a/5x5_reduce" 
    top: "inception_3a/5x5_reduce" 
} 
layer { 
    name: "inception_3a/5x5" 
    type: "Convolution" 
    bottom: "inception_3a/5x5_reduce" 
    top: "inception_3a/5x5" 
    param { 
    lr_mult: 1 
    decay_mult: 1 
    } 
    param { 
    lr_mult: 2 
    decay_mult: 0 
    } 
    convolution_param { 
    num_output: 32 
    pad: 2 
    kernel_size: 5 
    weight_filler { 
     type: "xavier" 
     std: 0.03 
    } 
    bias_filler { 
     type: "constant" 
     value: 0.2 
    } 
    } 
} 
layer { 
    name: "inception_3a/relu_5x5" 
    type: "ReLU" 
    bottom: "inception_3a/5x5" 
    top: "inception_3a/5x5" 
} 
layer { 
    name: "inception_3a/pool" 
    type: "Pooling" 
    bottom: "pool2/3x3_s2" 
    top: "inception_3a/pool" 
    pooling_param { 
    pool: MAX 
    kernel_size: 3 
    stride: 1 
    pad: 1 
    } 
} 
layer { 
    name: "inception_3a/pool_proj" 
    type: "Convolution" 
    bottom: "inception_3a/pool" 
    top: "inception_3a/pool_proj" 
    param { 
    lr_mult: 1 
    decay_mult: 1 
    } 
    param { 
    lr_mult: 2 
    decay_mult: 0 
    } 
    convolution_param { 
    num_output: 32 
    kernel_size: 1 
    weight_filler { 
     type: "xavier" 
     std: 0.1 
    } 
    bias_filler { 
     type: "constant" 
     value: 0.2 
    } 
    } 
} 

다음과 같다 :

n_i * c_i * h * w for each input blob i from 1 to K.

출력 :

전 f 축 = 0 : (n_1 + n_2 + ... + n_K) * c_1 * h * w이고 모든 입력 c_i는 이어야합니다.

축 = 1 인 경우 : n_1 * (c_1 + c_2 + ... + c_K) * h * w이고 모든 입력 n_i는 동일해야합니다.

첫 번째로, 기본값이 무엇인지 잘 모르겠습니다. 두 번째로 너비와 높이가 같아야하지만 모든 thre 전환 레이어가 다른 출력을 생성하므로 크기가 출력 볼륨을 갖지 않을지 잘 모르겠습니다. 모든 포인터는 정말로 감사 할 것입니다.

답변

1

'Concat'축의 기본값은 1이므로 채널 차원을 연결합니다. 이렇게하려면 연결되는 모든 레이어의 높이와 너비가 동일해야합니다. -> [32, 64, 28, 28]
inception_3a/× 3 -> [32, 128, 28, 28]

inception_3a/1 × : 로그를 보면, 사이즈 (배치 크기 (32)를 가정)되고 inception_3a/5 × -> [32, 32, 28, 28]
inception_3a/pool_proj -> [32, 32, 28, 28]

따라서, 최종 출력 사이즈 갖
inception_3a/출력 -> [32 (64 + 128 + 32 + 32) 28, 28] → [32, 256, 28, 28]

Caffe 로그에서 예상 한 바와 같이 :

Creating Layer inception_3a/output 
inception_3a/output <- inception_3a/1x1 
inception_3a/output <- inception_3a/3x3 
inception_3a/output <- inception_3a/5x5 
inception_3a/output <- inception_3a/pool_proj 
inception_3a/output -> inception_3a/output 
Setting up inception_3a/output 
Top shape: 32 256 28 28 (6422528) 
+0

축이 2 또는 3이면 다음 차원이됩니까? – Kev1n91

+0

네,하지만 모든 레이어가 다른 수의 채널을 가지고 있기 때문에이 경우에는 작동하지 않습니다. 실제로, 모든 입력 축은 코드에서보고 된대로 연결 축을 제외하고는 같은 크기 여야합니다. [concat_layer.cpp] (https://github.com/BVLC/caffe/blob/master/src/caffe/layers) /concat_layer.cpp) –

관련 문제