The
model.evaluate function predicts the output for the given input and then computes the metrics function specified in the
model.compile and based on
y_true and
y_pred and returns the computed metric value as the output.
The
model.predict just returns back the
y_pred .
model.evaluate函數預測給定輸入的輸出,然后計算model.compile中指定的metrics函數,並基於y_true和y_pred,並返回計算的度量值作為輸出。
model.predict只返回y_pred。
model.evaluate 用於評估您訓練的模型。它的輸出是准確度或損失,而不是對輸入數據的預測。
model.predict 實際預測,其輸出是目標值,根據輸入數據預測。