Python Keras:整个预测的自定义损失函数
我想知道Keras中是否有办法定义损失函数“损失(Yhat)” 在一个时代结束时,将预测数据作为一个整体接收。据我所知,Keras只允许计算每批的损失,但我想知道是否有任何人知道的解决方法Python Keras:整个预测的自定义损失函数,python,machine-learning,keras,loss-function,Python,Machine Learning,Keras,Loss Function,我想知道Keras中是否有办法定义损失函数“损失(Yhat)” 在一个时代结束时,将预测数据作为一个整体接收。据我所知,Keras只允许计算每批的损失,但我想知道是否有任何人知道的解决方法 谢谢 你不是在找打印(模型评估(x\u火车,y\u火车)) 如果确实希望看到“每个”历元,可以将其添加到回调中,但这会占用太多时间: printEvaluation(e,logs): print("evaluation for epoch: " + str(e)) print(model.e
谢谢 你不是在找
打印(模型评估(x\u火车,y\u火车))
如果确实希望看到“每个”历元,可以将其添加到回调中,但这会占用太多时间:
printEvaluation(e,logs):
print("evaluation for epoch: " + str(e))
print(model.evaluate(x_train,y_train))
callback = LambdaCallback(on_epoch_end= printEvaluation)
callbacks = [callback]
model.fit(........, callbacks = callbacks)
显然,如果可能的话,使批处理大小等于整个训练数据集。