richzhang / colorization

Automatic colorization using deep neural networks. "Colorful Image Colorization." In ECCV, 2016.
http://richzhang.github.io/colorization/
BSD 2-Clause "Simplified" License
3.34k stars 923 forks source link

A strange question about the difference between train and deploy in prototxt #58

Closed Xinian closed 5 years ago

Xinian commented 5 years ago

Hi, Richard, I have some question about difference between ./colorization/model/colorization_deploy_v2.prototxt and ./colorization/model/colorization_train_val_v2.prototxt

in the end of colorization_deploy_v2.prototxt , you setup such a layer :

**

Decoding

**

layer { name: "class8_ab" type: "Convolution" bottom: "class8_313_rh" top: "class8_ab" convolution_param { num_output: 2 kernel_size: 1 stride: 1 dilation: 1 } } but this layer seems not be trained in colorization_train_val_v2.prototxt , so I can not understand how it maps the 313x64x64 to 2x224x224 , could you tell me why does it work ?

Thank you very much

richzhang commented 5 years ago

It contains the 313 ab color bin centers, so each spatial location is multiplied by a 313x2 matrix, implemented as a 1x1 convolution.

Xinian commented 5 years ago

I get it, thank you.