Keras图层特征标签

时间:2019-06-12 09:39:04

标签: python-3.x deep-learning keras-layer

角膜模型层特征标签是否与原始标签相同

model.add(Flatten())
model.add(Dense(380,name = 'dense_1'))
model.add(Activation('relu'))

model.add(Dropout(0.1))
model.add(Dense(classes_num ))
model.add(Activation('softmax'))


model.compile(optimizer='rmsprop', loss='categorical_crossentropy',
                        metrics=['accuracy',mean_pred,recall,precision,fmeasure,                               matthews_correlation,kullback_leibler_divergence,
                                 binary_crossentropy])
model.summary()
print('model complied!!')

print('starting training....')

history = model.fit(X_train, Y_train, epochs=epochs, batch_size=64,validation_data=(X_test, Y_test))

extract =Model(model.input,[model.get_layer("dense_1").output,model.output])
test_feature,test_labels= extract.predict(X_test)

test_labels和y_test是否相同。如果我要使用图层特征,应该使用哪些标签

1 个答案:

答案 0 :(得分:0)

test_label是小数点,显示每个类中的成员资格概率,它与y_test不同。如果在softmax层的输出中获得最大值的索引,则将显示网络根据输入确定的类。