【发布时间】:2018-06-28 23:15:58
【问题描述】:
我正在 Keras 中开发自定义损失函数,我需要第一层输出。
我怎样才能找回它?
def custom_loss(y_true, y_pred):
cross = K.mean(K.binary_crossentropy(y_true, y_pred), axis = 1)
layer_output = model.get_layer_output(1) # this is what i'd like to use
return cross + perturb
【问题讨论】:
标签: python neural-network keras layer