keras下Convolution1D与Convolution2D的区别

from keras.models import Sequential
from keras.layers.core import Flatten
from keras.layers.convolutional import Convolution2D,Convolution1D
#Convolution2D
model = Sequential()
model.add(Convolution2D(64, 3, 3, border_mode=“same”, input_shape=(32, 32,3)))
print(model.output_shape)#model.output_shape==(None, 32, 32, 64)
model.add(Flatten())
print(model.output_shape)#model.output_shape==(None, 65536)
model = Sequential()
model.add(Convolution1D(64, 3, border_mode=‘same’, input_shape=(10, 32)))
print(model.output_shape)
model.add(Convolution1D(32, 3, border_mode=‘same’))
print(model.output_shape)
#Convolution1D

model = Sequential()
model.add(Convolution1D(64, 3, border_mode=‘same’, input_shape=(10, 32)))
print(model.output_shape)#(None, 10, 64)
model.add(Convolution1D(32, 3, border_mode=‘same’))
print(model.output_shape)#(None, 10, 32)

你可能感兴趣的:(python)