Feat: AI 데이터 형식 맞추기 S11P21S002-224

This commit is contained in:
kimtaesoo7 2024-09-25 17:37:03 +09:00
parent b9b9e0d8b4
commit 7e78601906

View File

@ -5,13 +5,13 @@ import com.fasterxml.jackson.annotation.JsonValue;
public enum Optimizer { public enum Optimizer {
AUTO("AUTO"), AUTO("auto"),
SGD("SGD"), SGD("SGD"),
ADAM("ADAM"), ADAM("Adam"),
ADAMW("ADAMW"), ADAMW("AdamW"),
NADAM("NADAM"), NADAM("NAdam"),
RADAM("RADAM"), RADAM("RAdam"),
RMSPROP("RMSPROP"); RMSPROP("RMSProp");
private final String value; private final String value;
@ -22,11 +22,11 @@ public enum Optimizer {
@JsonCreator @JsonCreator
public static Optimizer from(String value) { public static Optimizer from(String value) {
for (Optimizer status : Optimizer.values()) { for (Optimizer status : Optimizer.values()) {
if (status.getValue().equals(value.toUpperCase())) { if (status.getValue().equalsIgnoreCase(value)) {
return status; return status;
} }
} }
return null; throw new IllegalArgumentException("Unknown optimizer: " + value);
} }
@JsonValue @JsonValue