我就废话不多说,大家还是直接看代码吧~
def get_model():
n_classes = 6
inp=Input(shape=(40, 80))
reshape=Reshape((1,40,80))(inp)
# pre=ZeroPadding2D(padding=(1, 1))(reshape)
# 1
conv1=Convolution2D(32, 3, 3, border_mode='same',init='glorot_uniform')(reshape)
#model.add(Activation('relu'))
l1=LeakyReLU(alpha=0.33)(conv1)
conv2=ZeroPadding2D(padding=(1, 1))(l1)
conv2=Convolution2D(32, 3, 3, border_mode='same',init='glorot_uniform')(conv2)
#model.add(Activation('relu'))
l2=LeakyReLU(alpha=0.33)(conv2)
m2=MaxPooling2D((3, 3), strides=(3, 3))(l2)
d2=Dropout(0.25)(m2)
# 2
conv3=ZeroPadding2D(padding=(1, 1))(d2)
conv3=Convolution2D(64, 3, 3, border_mode='same',init='glorot_uniform')(conv3)
#model.add(Activation('relu'))
l3=LeakyReLU(alpha=0.33)(conv3)
conv4=ZeroPadding2D(padding=(1, 1))(l3)
conv4=Convolution2D(64, 3, 3, border_mode='same',init='glorot_uniform')(conv4)
#model.add(Activation('relu'))
l4=LeakyReLU(alpha=0.33)(conv4)
m4=MaxPooling2D((3, 3), strides=(3, 3))(