From bda59ed59d1cb8ecc14d88da1f732a8d422ead30 Mon Sep 17 00:00:00 2001 From: Charles Dickens Date: Sat, 30 Sep 2023 08:03:44 -0700 Subject: [PATCH] Get JSON object before reference to result key. --- .../src/main/java/org/linqs/psl/model/deep/DeepModel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/psl-core/src/main/java/org/linqs/psl/model/deep/DeepModel.java b/psl-core/src/main/java/org/linqs/psl/model/deep/DeepModel.java index 4c29b30bb..67037728c 100644 --- a/psl-core/src/main/java/org/linqs/psl/model/deep/DeepModel.java +++ b/psl-core/src/main/java/org/linqs/psl/model/deep/DeepModel.java @@ -196,7 +196,7 @@ public boolean isEpochComplete() { String resultString = getResultString(response); log.debug("Epoch end deep model results for {} : {}", this, resultString); - return response.getBoolean("is_epoch_complete"); + return response.getJSONObject("result").getBoolean("is_epoch_complete"); } public void predictDeepModel(Boolean learning) { @@ -240,8 +240,8 @@ public float evalDeepModel() { String resultString = getResultString(response); log.debug("Eval deep model result for {} : {}", this, resultString); - - return response.getFloat("loss"); + + return response.getJSONObject("result").getFloat("loss"); } public void saveDeepModel() {