本文共 8967 字,大约阅读时间需要 29 分钟。
model = Sequential()model.add(Conv2D(32, (3, 3), padding='same', input_shape=x_train.shape[1:]))model.add(Activation('relu'))model.add(Conv2D(32, (3, 3)))model.add(Activation('relu'))model.add(MaxPooling2D(pool_size=(2, 2)))model.add(Dropout(0.25))model.add(Conv2D(64, (3, 3), padding='same'))model.add(Activation('relu'))model.add(Conv2D(64, (3, 3)))model.add(Activation('relu'))model.add(MaxPooling2D(pool_size=(2, 2)))model.add(Dropout(0.25))model.add(Flatten())model.add(Dense(512))model.add(Activation('relu'))model.add(Dropout(0.5))model.add(Dense(num_classes))model.add(Activation('softmax'))model2 = Sequential()model2.add(Conv2D(32, (3, 3), padding='same', input_shape=x_train.shape[1:]))model2.add(Activation('relu'))model2.add(Conv2D(32, (3, 3)))model2.add(Activation('relu'))model2.add(MaxPooling2D(pool_size=(2, 2)))model2.add(Dropout(0.25))model2.add(Flatten())model2.add(Dense(512))model2.add(Activation('relu'))model2.add(Dropout(0.5))model2.add(Dense(num_classes))model2.add(Activation('softmax'))
转载地址:http://endgo.baihongyu.com/