Keras 添加自定义损耗函数后,精度大幅降低

Keras 添加自定义损耗函数后,精度大幅降低,keras,loss-function,loss,Keras,Loss Function,Loss,分类交叉熵的准确率约为90%,但现在即使在100个时代之后,准确率也降低到10%。您的新损失函数是什么?请添加更多解释。我的新损失函数是分类交叉项目。你的新损失函数是什么?请添加更多解释。我的新损失函数是分类交叉熵 def custom_loss(lmbda , regularizer_value): def loss(y_true , y_pred): return K.categorical_crossentropy(y_true ,y_pred) + lmbda * regul

分类交叉熵的准确率约为90%,但现在即使在100个时代之后,准确率也降低到10%。

您的新损失函数是什么?请添加更多解释。我的新损失函数是分类交叉项目。你的新损失函数是什么?请添加更多解释。我的新损失函数是分类交叉熵
def custom_loss(lmbda , regularizer_value):
  def loss(y_true , y_pred):
    return K.categorical_crossentropy(y_true ,y_pred) + lmbda * regularizer_value
  return loss


  model_loss = custom_loss(lmbda= 1 , regularizer_value=regularizer_value)

  model.compile(loss=model_loss,optimizer='adam',metrics=['categorical_accuracy'])