def test_update_values_no_validation(self): # GIVEN known value parameters params = [ "train_loss", "val_loss", "Loss", json.dumps(run_log_json_no_validation), ] # WHEN update_current_value is ran with that input result = update_current_value(*params) # THEN it should return proper name and value self.assertEqual(result[0].children, "Current Loss:") self.assertEqual(result[1].children, "Training: 2.2000")
def test_update_value_with_validation(self): # GIVEN known value parameters params = [ "train_loss", "val_loss", "Loss", json.dumps(run_log_json_with_validation), ] # WHEN update_current_value is ran with that input result = update_current_value(*params) # THEN it should return proper name and value self.assertEqual(result[0].children, "Current Loss:") self.assertEqual(result[1].children, "Training: 0.2021") self.assertEqual(" ".join(result[2].children.split()), "Validation: 0.4435")
def update_div_current_loss_value(run_log_json): return update_current_value("train_loss", "val_loss", "Loss", run_log_json)
def update_div_current_accuracy_value(run_log_json): return update_current_value( "train_accuracy", "val_accuracy", "Accuracy", run_log_json )