Hi both,
After check out the weight from model. For example, my model is
model = Sequential()
model.add(Convolution2D(1, 3, 3, border_mode='same', dim_ordering='tf', input_shape=x_train.shape[1:]))
model.add(Activation('relu'))
model.add(Convolution2D(2, 3, 3, border_mode='same'))
model.add(Activation('relu'))
So doing a 3x3 convolution with 1 set of filter.
And then call to show the parameters,
input shape: (32, 32, 3)
output shape: (None, 32, 32, 1)
model layer 0: [array([[[[-0.44335088],
[-0.20550063],
[-0.54055387]],
[[ 0.45638397],
[ 0.18023646],
[ 0.27544647]],
[[-0.52478981],
[-0.3563363 ],
[-0.38794193]]],
[[[-0.35504171],
[ 0.22461028],
[-0.05062532]],
[[-0.19462331],
[-0.0770151 ],
[ 0.56060874]],
[[-0.35007137],
[-0.36605915],
[-0.48056158]]],
[[[ 0.16772677],
[-0.12315023],
[ 0.09024198]],
[[ 0.47404319],
[-0.33782277],
[-0.56497747]],
[[-0.0320316 ],
[ 0.34991249],
[ 0.22081527]]]], dtype=float32), array([ 0.], dtype=float32)]So it shows a 3x3x3(rgb) filter and a constant offset 0. For this one, it's consistent to my understanding.
And then layer 1 is aviation.
Then layer 2, doing a 3x3 convolution with 2 set of filters, and it shows,
model layer 2: [array([[[[ 0.63717717, 0.62629467]],
[[ 0.2503061 , -0.33820277]],
[[-0.56018806, -0.26080328]]],
[[[-0.24903327, 0.08353958]],
[[ 0.00375767, 0.25935245]],
[[ 0.34627977, 0.23111989]]],
[[[-0.21744239, 0.59195977]],
[[ 0.01376275, -0.70028448]],
[[ 0.14046614, 0.1176499 ]]]], dtype=float32), array([ 0., 0.], dtype=float32)]Question 1:
it's a 3x3x2 filter, can you guide me how to translate this? They should be 2 separated 3x3x1 filters. (input shape is 32x32x1)
Question 2:
How does Keras decide these coefficient of convolution filters for each layer with different number of sets?
Sincerely,
Terry
Lin Terry於 2016年11月2日星期三 UTC+8下午10時46分25秒寫道: