Merge pull request 'feat/training_260202' (#3) from feat/training_260202 into develop
Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
@@ -16,7 +16,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@Tag(name = "데이터셋 관리", description = "어드민 홈 > 학습데이터관리 > 전체데이터 API")
|
@Tag(name = "학습데이터 관리", description = "어드민 홈 > 학습데이터관리 > 전체데이터 API")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/datasets")
|
@RequestMapping("/api/datasets")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -24,7 +24,7 @@ public class DatasetApiController {
|
|||||||
|
|
||||||
private final DatasetService datasetService;
|
private final DatasetService datasetService;
|
||||||
|
|
||||||
@Operation(summary = "데이터셋 목록 조회", description = "데이터셋(회차) 목록을 조회합니다.")
|
@Operation(summary = "학습데이터 관리 목록 조회", description = "학습데이터 목록을 조회합니다.")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
@ApiResponse(
|
@ApiResponse(
|
||||||
@@ -55,7 +55,7 @@ public class DatasetApiController {
|
|||||||
return ApiResponseDto.ok(datasetService.searchDatasets(searchReq));
|
return ApiResponseDto.ok(datasetService.searchDatasets(searchReq));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "데이터셋 상세 조회", description = "데이터셋 상세 정보를 조회합니다.")
|
@Operation(summary = "학습데이터관리 상세 조회", description = "학습데이터관리 상세 정보를 조회합니다.")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
@ApiResponse(
|
@ApiResponse(
|
||||||
@@ -73,7 +73,7 @@ public class DatasetApiController {
|
|||||||
return ApiResponseDto.ok(datasetService.getDatasetDetail(uuid));
|
return ApiResponseDto.ok(datasetService.getDatasetDetail(uuid));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "데이터셋 등록", description = "신규 데이터셋(회차)을 생성합니다.")
|
@Operation(summary = "학습데이터 등록", description = "학습데이터 파일 업로드")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
@ApiResponse(
|
@ApiResponse(
|
||||||
@@ -93,7 +93,7 @@ public class DatasetApiController {
|
|||||||
return ApiResponseDto.createOK(id);
|
return ApiResponseDto.createOK(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "데이터셋 수정", description = "데이터셋 정보를 수정합니다.")
|
@Operation(summary = "학습데이터 수정", description = "학습데이터 제목, 메모 수정")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
@ApiResponse(
|
@ApiResponse(
|
||||||
@@ -114,7 +114,7 @@ public class DatasetApiController {
|
|||||||
return ApiResponseDto.ok(uuid);
|
return ApiResponseDto.ok(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "데이터셋 삭제", description = "데이터셋을 삭제합니다.")
|
@Operation(summary = "학습데이터 삭제", description = "학습데이터를 삭제합니다.(납품 데이터는 삭제 불가)")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
@ApiResponse(responseCode = "201", description = "삭제 성공", content = @Content),
|
@ApiResponse(responseCode = "201", description = "삭제 성공", content = @Content),
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Tag(name = "모델관리", description = "모델관리 (학습 모델, 하이퍼파라미터, 메모)")
|
@Tag(name = "모델관리", description = "어드민 홈 > 모델학습관리 > 모델관리 > 목록")
|
||||||
@RequestMapping("/api/models")
|
@RequestMapping("/api/models")
|
||||||
public class ModelMngApiController {
|
public class ModelMngApiController {
|
||||||
private final ModelMngService modelMngService;
|
private final ModelMngService modelMngService;
|
||||||
|
|||||||
@@ -138,7 +138,6 @@ public class HyperParamDto {
|
|||||||
this.hueDelta = entity.getHueDelta();
|
this.hueDelta = entity.getHueDelta();
|
||||||
|
|
||||||
// Legacy
|
// Legacy
|
||||||
this.dropoutRatio = entity.getDropoutRatio();
|
|
||||||
this.cnnFilterCnt = entity.getCnnFilterCnt();
|
this.cnnFilterCnt = entity.getCnnFilterCnt();
|
||||||
|
|
||||||
// Common
|
// Common
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import jakarta.validation.constraints.NotNull;
|
|||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -27,14 +28,16 @@ public class ModelMngDto {
|
|||||||
public static class Basic {
|
public static class Basic {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private String modelNm;
|
private UUID uuid;
|
||||||
|
private String modelVer;
|
||||||
@JsonFormatDttm private ZonedDateTime startDttm;
|
@JsonFormatDttm private ZonedDateTime startDttm;
|
||||||
@JsonFormatDttm private ZonedDateTime trainingEndDttm;
|
@JsonFormatDttm private ZonedDateTime step1EndDttm;
|
||||||
@JsonFormatDttm private ZonedDateTime testEndDttm;
|
@JsonFormatDttm private ZonedDateTime step1Duration;
|
||||||
private String durationDttm;
|
@JsonFormatDttm private ZonedDateTime step2EndDttm;
|
||||||
private String processStage;
|
@JsonFormatDttm private ZonedDateTime step2Duration;
|
||||||
private String statusCd;
|
private String step1Status;
|
||||||
private String status;
|
private String step2Status;
|
||||||
|
private String transferStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Schema(name = "searchReq", description = "모델 관리 목록조회 파라미터")
|
@Schema(name = "searchReq", description = "모델 관리 목록조회 파라미터")
|
||||||
@@ -75,11 +78,11 @@ public class ModelMngDto {
|
|||||||
|
|
||||||
@JsonFormatDttm private ZonedDateTime step1EndDttm;
|
@JsonFormatDttm private ZonedDateTime step1EndDttm;
|
||||||
|
|
||||||
private String step1Duration;
|
private ZonedDateTime step1Duration;
|
||||||
|
|
||||||
@JsonFormatDttm private ZonedDateTime step2EndDttm;
|
@JsonFormatDttm private ZonedDateTime step2EndDttm;
|
||||||
|
|
||||||
private String step2Duration;
|
private ZonedDateTime step2Duration;
|
||||||
private Integer progressRate;
|
private Integer progressRate;
|
||||||
|
|
||||||
@JsonFormatDttm private ZonedDateTime createdDttm;
|
@JsonFormatDttm private ZonedDateTime createdDttm;
|
||||||
@@ -109,11 +112,11 @@ public class ModelMngDto {
|
|||||||
|
|
||||||
@JsonFormatDttm private ZonedDateTime step1EndDttm;
|
@JsonFormatDttm private ZonedDateTime step1EndDttm;
|
||||||
|
|
||||||
private String step1Duration;
|
private ZonedDateTime step1Duration;
|
||||||
|
|
||||||
@JsonFormatDttm private ZonedDateTime step2EndDttm;
|
@JsonFormatDttm private ZonedDateTime step2EndDttm;
|
||||||
|
|
||||||
private String step2Duration;
|
private ZonedDateTime step2Duration;
|
||||||
|
|
||||||
@JsonFormatDttm private ZonedDateTime createdDttm;
|
@JsonFormatDttm private ZonedDateTime createdDttm;
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ public class HyperParamCoreService {
|
|||||||
.saturationRange(entity.getSaturationRange())
|
.saturationRange(entity.getSaturationRange())
|
||||||
.hueDelta(entity.getHueDelta())
|
.hueDelta(entity.getHueDelta())
|
||||||
// Legacy
|
// Legacy
|
||||||
.dropoutRatio(entity.getDropoutRatio())
|
|
||||||
.cnnFilterCnt(entity.getCnnFilterCnt())
|
.cnnFilterCnt(entity.getCnnFilterCnt())
|
||||||
// Common
|
// Common
|
||||||
.memo(entity.getMemo())
|
.memo(entity.getMemo())
|
||||||
@@ -247,10 +246,6 @@ public class HyperParamCoreService {
|
|||||||
createReq.getHueDelta() != null ? createReq.getHueDelta() : baseEntity.getHueDelta());
|
createReq.getHueDelta() != null ? createReq.getHueDelta() : baseEntity.getHueDelta());
|
||||||
|
|
||||||
// Legacy
|
// Legacy
|
||||||
entity.setDropoutRatio(
|
|
||||||
createReq.getDropoutRatio() != null
|
|
||||||
? createReq.getDropoutRatio()
|
|
||||||
: baseEntity.getDropoutRatio());
|
|
||||||
entity.setCnnFilterCnt(
|
entity.setCnnFilterCnt(
|
||||||
createReq.getCnnFilterCnt() != null
|
createReq.getCnnFilterCnt() != null
|
||||||
? createReq.getCnnFilterCnt()
|
? createReq.getCnnFilterCnt()
|
||||||
|
|||||||
@@ -50,10 +50,8 @@ public class ModelMngCoreService {
|
|||||||
return ModelMngDto.Detail.builder()
|
return ModelMngDto.Detail.builder()
|
||||||
.uuid(entity.getUuid().toString())
|
.uuid(entity.getUuid().toString())
|
||||||
.modelVer(entity.getModelVer())
|
.modelVer(entity.getModelVer())
|
||||||
.hyperVer(entity.getHyperVer())
|
|
||||||
.epochVer(entity.getEpochVer())
|
.epochVer(entity.getEpochVer())
|
||||||
.processStep(entity.getProcessStep())
|
.processStep(entity.getProcessStep())
|
||||||
.statusCd(entity.getStatusCd())
|
|
||||||
.trainStartDttm(entity.getTrainStartDttm())
|
.trainStartDttm(entity.getTrainStartDttm())
|
||||||
.epochCnt(entity.getEpochCnt())
|
.epochCnt(entity.getEpochCnt())
|
||||||
.datasetRatio(entity.getDatasetRatio())
|
.datasetRatio(entity.getDatasetRatio())
|
||||||
@@ -97,7 +95,6 @@ public class ModelMngCoreService {
|
|||||||
ModelMngDto.TrainListRes.builder()
|
ModelMngDto.TrainListRes.builder()
|
||||||
.uuid(entity.getUuid().toString())
|
.uuid(entity.getUuid().toString())
|
||||||
.modelVer(entity.getModelVer())
|
.modelVer(entity.getModelVer())
|
||||||
.status(entity.getStatusCd())
|
|
||||||
.processStep(entity.getProcessStep())
|
.processStep(entity.getProcessStep())
|
||||||
.trainStartDttm(entity.getTrainStartDttm())
|
.trainStartDttm(entity.getTrainStartDttm())
|
||||||
.progressRate(entity.getProgressRate())
|
.progressRate(entity.getProgressRate())
|
||||||
@@ -135,10 +132,8 @@ public class ModelMngCoreService {
|
|||||||
public ModelTrainMasterEntity createTrainMaster(ModelMngDto.TrainStartReq trainReq) {
|
public ModelTrainMasterEntity createTrainMaster(ModelMngDto.TrainStartReq trainReq) {
|
||||||
ModelTrainMasterEntity entity = new ModelTrainMasterEntity();
|
ModelTrainMasterEntity entity = new ModelTrainMasterEntity();
|
||||||
entity.setModelVer(trainReq.getHyperVer());
|
entity.setModelVer(trainReq.getHyperVer());
|
||||||
entity.setHyperVer(trainReq.getHyperVer());
|
|
||||||
entity.setEpochVer(String.valueOf(trainReq.getEpoch()));
|
entity.setEpochVer(String.valueOf(trainReq.getEpoch()));
|
||||||
entity.setProcessStep("STEP1");
|
entity.setProcessStep("STEP1");
|
||||||
entity.setStatusCd("READY");
|
|
||||||
entity.setTrainStartDttm(ZonedDateTime.now());
|
entity.setTrainStartDttm(ZonedDateTime.now());
|
||||||
entity.setEpochCnt(trainReq.getEpoch());
|
entity.setEpochCnt(trainReq.getEpoch());
|
||||||
entity.setDatasetRatio(trainReq.getDatasetRatio());
|
entity.setDatasetRatio(trainReq.getDatasetRatio());
|
||||||
@@ -191,9 +186,9 @@ public class ModelMngCoreService {
|
|||||||
ModelTrainMasterEntity entity = findByUuid(uuid);
|
ModelTrainMasterEntity entity = findByUuid(uuid);
|
||||||
|
|
||||||
// 진행 중인 모델은 삭제 불가
|
// 진행 중인 모델은 삭제 불가
|
||||||
if ("RUNNING".equals(entity.getStatusCd())) {
|
// if ("RUNNING".equals(entity.getStatusCd())) {
|
||||||
throw new BadRequestException("진행 중인 모델은 삭제할 수 없습니다.");
|
// throw new BadRequestException("진행 중인 모델은 삭제할 수 없습니다.");
|
||||||
}
|
// }
|
||||||
|
|
||||||
entity.setDelYn(true);
|
entity.setDelYn(true);
|
||||||
entity.setUpdatedDttm(ZonedDateTime.now());
|
entity.setUpdatedDttm(ZonedDateTime.now());
|
||||||
|
|||||||
@@ -2,231 +2,219 @@ package com.kamco.cd.training.postgres.entity;
|
|||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import lombok.AllArgsConstructor;
|
import java.util.UUID;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Entity
|
@Entity
|
||||||
@NoArgsConstructor
|
@Table(name = "tb_model_hyper_params")
|
||||||
@AllArgsConstructor
|
|
||||||
@Table(name = "tb_model_hyper_param")
|
|
||||||
public class ModelHyperParamEntity {
|
public class ModelHyperParamEntity {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "hyper_param_id", nullable = false)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@ColumnDefault("gen_random_uuid()")
|
||||||
|
@Column(name = "uuid", nullable = false)
|
||||||
|
private UUID uuid = UUID.randomUUID();
|
||||||
|
|
||||||
@Size(max = 50)
|
@Size(max = 50)
|
||||||
|
@NotNull
|
||||||
@Column(name = "hyper_ver", nullable = false, length = 50)
|
@Column(name = "hyper_ver", nullable = false, length = 50)
|
||||||
private String hyperVer;
|
private String hyperVer;
|
||||||
|
|
||||||
// ==================== Important Parameters ====================
|
@Size(max = 20)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "backbone", nullable = false, length = 20)
|
||||||
|
private String backbone;
|
||||||
|
|
||||||
|
@Size(max = 15)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "input_size", nullable = false, length = 15)
|
||||||
|
private String inputSize;
|
||||||
|
|
||||||
|
@Size(max = 15)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "crop_size", nullable = false, length = 15)
|
||||||
|
private String cropSize;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "epoch_cnt", nullable = false)
|
||||||
|
private Integer epochCnt;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "batch_size", nullable = false)
|
||||||
|
private Integer batchSize;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "drop_path_rate", nullable = false)
|
||||||
|
private Double dropPathRate;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "frozen_stages", nullable = false)
|
||||||
|
private Integer frozenStages;
|
||||||
|
|
||||||
@Size(max = 20)
|
@Size(max = 20)
|
||||||
@ColumnDefault("'large'")
|
@NotNull
|
||||||
@Column(name = "backbone", length = 20)
|
@Column(name = "neck_policy", nullable = false, length = 20)
|
||||||
private String backbone = "large";
|
private String neckPolicy;
|
||||||
|
|
||||||
@Size(max = 20)
|
|
||||||
@ColumnDefault("'256,256'")
|
|
||||||
@Column(name = "input_size", length = 20)
|
|
||||||
private String inputSize = "256,256";
|
|
||||||
|
|
||||||
@Size(max = 20)
|
|
||||||
@ColumnDefault("'256,256'")
|
|
||||||
@Column(name = "crop_size", length = 20)
|
|
||||||
private String cropSize = "256,256";
|
|
||||||
|
|
||||||
@ColumnDefault("200")
|
|
||||||
@Column(name = "epoch_cnt")
|
|
||||||
private Integer epochCnt = 200;
|
|
||||||
|
|
||||||
@ColumnDefault("16")
|
|
||||||
@Column(name = "batch_size")
|
|
||||||
private Integer batchSize = 16;
|
|
||||||
|
|
||||||
// ==================== Model Architecture ====================
|
|
||||||
|
|
||||||
@ColumnDefault("0.3")
|
|
||||||
@Column(name = "drop_path_rate")
|
|
||||||
private Double dropPathRate = 0.3;
|
|
||||||
|
|
||||||
@ColumnDefault("-1")
|
|
||||||
@Column(name = "frozen_stages")
|
|
||||||
private Integer frozenStages = -1;
|
|
||||||
|
|
||||||
@Size(max = 20)
|
|
||||||
@ColumnDefault("'abs_diff'")
|
|
||||||
@Column(name = "neck_policy", length = 20)
|
|
||||||
private String neckPolicy = "abs_diff";
|
|
||||||
|
|
||||||
@Size(max = 255)
|
|
||||||
@ColumnDefault("'512,256,128,64'")
|
|
||||||
@Column(name = "decoder_channels", length = 255)
|
|
||||||
private String decoderChannels = "512,256,128,64";
|
|
||||||
|
|
||||||
@Size(max = 500)
|
|
||||||
@Column(name = "class_weight", length = 500)
|
|
||||||
private String classWeight;
|
|
||||||
|
|
||||||
@Column(name = "num_layers")
|
|
||||||
private Integer numLayers;
|
|
||||||
|
|
||||||
// ==================== Loss & Optimization ====================
|
|
||||||
|
|
||||||
@ColumnDefault("0.00006")
|
|
||||||
@Column(name = "learning_rate")
|
|
||||||
private Double learningRate = 0.00006;
|
|
||||||
|
|
||||||
@ColumnDefault("0.05")
|
|
||||||
@Column(name = "weight_decay")
|
|
||||||
private Double weightDecay = 0.05;
|
|
||||||
|
|
||||||
@ColumnDefault("0.9")
|
|
||||||
@Column(name = "layer_decay_rate")
|
|
||||||
private Double layerDecayRate = 0.9;
|
|
||||||
|
|
||||||
@ColumnDefault("true")
|
|
||||||
@Column(name = "ddp_find_unused_params")
|
|
||||||
private Boolean ddpFindUnusedParams = true;
|
|
||||||
|
|
||||||
@ColumnDefault("255")
|
|
||||||
@Column(name = "ignore_index")
|
|
||||||
private Integer ignoreIndex = 255;
|
|
||||||
|
|
||||||
// ==================== Data ====================
|
|
||||||
|
|
||||||
@ColumnDefault("16")
|
|
||||||
@Column(name = "train_num_workers")
|
|
||||||
private Integer trainNumWorkers = 16;
|
|
||||||
|
|
||||||
@ColumnDefault("8")
|
|
||||||
@Column(name = "val_num_workers")
|
|
||||||
private Integer valNumWorkers = 8;
|
|
||||||
|
|
||||||
@ColumnDefault("8")
|
|
||||||
@Column(name = "test_num_workers")
|
|
||||||
private Integer testNumWorkers = 8;
|
|
||||||
|
|
||||||
@ColumnDefault("true")
|
|
||||||
@Column(name = "train_shuffle")
|
|
||||||
private Boolean trainShuffle = true;
|
|
||||||
|
|
||||||
@ColumnDefault("true")
|
|
||||||
@Column(name = "train_persistent")
|
|
||||||
private Boolean trainPersistent = true;
|
|
||||||
|
|
||||||
@ColumnDefault("true")
|
|
||||||
@Column(name = "val_persistent")
|
|
||||||
private Boolean valPersistent = true;
|
|
||||||
|
|
||||||
// ==================== Evaluation ====================
|
|
||||||
|
|
||||||
@Size(max = 255)
|
|
||||||
@ColumnDefault("'mFscore,mIoU'")
|
|
||||||
@Column(name = "metrics", length = 255)
|
|
||||||
private String metrics = "mFscore,mIoU";
|
|
||||||
|
|
||||||
@Size(max = 50)
|
@Size(max = 50)
|
||||||
@ColumnDefault("'changed_fscore'")
|
@NotNull
|
||||||
@Column(name = "save_best", length = 50)
|
@Column(name = "decoder_channels", nullable = false, length = 50)
|
||||||
private String saveBest = "changed_fscore";
|
private String decoderChannels;
|
||||||
|
|
||||||
@Size(max = 20)
|
@Size(max = 50)
|
||||||
@ColumnDefault("'greater'")
|
@NotNull
|
||||||
@Column(name = "save_best_rule", length = 20)
|
@Column(name = "class_weight", nullable = false, length = 50)
|
||||||
private String saveBestRule = "greater";
|
private String classWeight;
|
||||||
|
|
||||||
@ColumnDefault("10")
|
@NotNull
|
||||||
@Column(name = "val_interval")
|
@Column(name = "num_layers", nullable = false)
|
||||||
private Integer valInterval = 10;
|
private Integer numLayers;
|
||||||
|
|
||||||
@ColumnDefault("400")
|
@NotNull
|
||||||
@Column(name = "log_interval")
|
@Column(name = "learning_rate", nullable = false)
|
||||||
private Integer logInterval = 400;
|
private Double learningRate;
|
||||||
|
|
||||||
@ColumnDefault("1")
|
@NotNull
|
||||||
@Column(name = "vis_interval")
|
@Column(name = "weight_decay", nullable = false)
|
||||||
private Integer visInterval = 1;
|
private Double weightDecay;
|
||||||
|
|
||||||
// ==================== Hardware ====================
|
@NotNull
|
||||||
|
@Column(name = "layer_decay_rate", nullable = false)
|
||||||
|
private Double layerDecayRate;
|
||||||
|
|
||||||
@ColumnDefault("4")
|
@NotNull
|
||||||
@Column(name = "gpu_cnt")
|
@Column(name = "ddp_find_unused_params", nullable = false)
|
||||||
private Integer gpuCnt = 4;
|
private Boolean ddpFindUnusedParams = false;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "ignore_index", nullable = false)
|
||||||
|
private Integer ignoreIndex;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "train_num_workers", nullable = false)
|
||||||
|
private Integer trainNumWorkers;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "val_num_workers", nullable = false)
|
||||||
|
private Integer valNumWorkers;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "test_num_workers", nullable = false)
|
||||||
|
private Integer testNumWorkers;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "train_shuffle", nullable = false)
|
||||||
|
private Boolean trainShuffle = false;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "train_persistent", nullable = false)
|
||||||
|
private Boolean trainPersistent = false;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "val_persistent", nullable = false)
|
||||||
|
private Boolean valPersistent = false;
|
||||||
|
|
||||||
@Size(max = 100)
|
@Size(max = 100)
|
||||||
@ColumnDefault("'0,1,2,3'")
|
@NotNull
|
||||||
@Column(name = "gpu_ids", length = 100)
|
@Column(name = "metrics", nullable = false, length = 100)
|
||||||
private String gpuIds = "0,1,2,3";
|
private String metrics;
|
||||||
|
|
||||||
|
@Size(max = 30)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "save_best", nullable = false, length = 30)
|
||||||
|
private String saveBest;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "save_best_rule", nullable = false, length = 10)
|
||||||
|
private String saveBestRule;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "val_interval", nullable = false)
|
||||||
|
private Integer valInterval;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "log_interval", nullable = false)
|
||||||
|
private Integer logInterval;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "vis_interval", nullable = false)
|
||||||
|
private Integer visInterval;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "rot_prob", nullable = false)
|
||||||
|
private Double rotProb;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "flip_prob", nullable = false)
|
||||||
|
private Double flipProb;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "rot_degree", nullable = false, length = 20)
|
||||||
|
private String rotDegree;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "exchange_prob", nullable = false)
|
||||||
|
private Double exchangeProb;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "brightness_delta", nullable = false)
|
||||||
|
private Integer brightnessDelta;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "contrast_range", nullable = false, length = 20)
|
||||||
|
private String contrastRange;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "saturation_range", nullable = false, length = 20)
|
||||||
|
private String saturationRange;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "hue_delta", nullable = false)
|
||||||
|
private Integer hueDelta;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "gpu_cnt", nullable = false)
|
||||||
|
private Integer gpuCnt;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "gpu_ids", length = 50)
|
||||||
|
private String gpuIds;
|
||||||
|
|
||||||
@ColumnDefault("1122")
|
|
||||||
@Column(name = "master_port")
|
@Column(name = "master_port")
|
||||||
private Integer masterPort = 1122;
|
private Integer masterPort;
|
||||||
|
|
||||||
// ==================== Augmentation ====================
|
|
||||||
|
|
||||||
@ColumnDefault("0.5")
|
|
||||||
@Column(name = "rot_prob")
|
|
||||||
private Double rotProb = 0.5;
|
|
||||||
|
|
||||||
@ColumnDefault("0.5")
|
|
||||||
@Column(name = "flip_prob")
|
|
||||||
private Double flipProb = 0.5;
|
|
||||||
|
|
||||||
@Size(max = 20)
|
|
||||||
@ColumnDefault("'-20,20'")
|
|
||||||
@Column(name = "rot_degree", length = 20)
|
|
||||||
private String rotDegree = "-20,20";
|
|
||||||
|
|
||||||
@ColumnDefault("0.5")
|
|
||||||
@Column(name = "exchange_prob")
|
|
||||||
private Double exchangeProb = 0.5;
|
|
||||||
|
|
||||||
@ColumnDefault("10")
|
|
||||||
@Column(name = "brightness_delta")
|
|
||||||
private Integer brightnessDelta = 10;
|
|
||||||
|
|
||||||
@Size(max = 20)
|
|
||||||
@ColumnDefault("'0.8,1.2'")
|
|
||||||
@Column(name = "contrast_range", length = 20)
|
|
||||||
private String contrastRange = "0.8,1.2";
|
|
||||||
|
|
||||||
@Size(max = 20)
|
|
||||||
@ColumnDefault("'0.8,1.2'")
|
|
||||||
@Column(name = "saturation_range", length = 20)
|
|
||||||
private String saturationRange = "0.8,1.2";
|
|
||||||
|
|
||||||
@ColumnDefault("10")
|
|
||||||
@Column(name = "hue_delta")
|
|
||||||
private Integer hueDelta = 10;
|
|
||||||
|
|
||||||
// ==================== Legacy (deprecated) ====================
|
|
||||||
|
|
||||||
@Column(name = "cnn_filter_cnt")
|
|
||||||
private Integer cnnFilterCnt;
|
|
||||||
|
|
||||||
@Column(name = "dropout_ratio")
|
|
||||||
private Double dropoutRatio;
|
|
||||||
|
|
||||||
// ==================== Common ====================
|
|
||||||
|
|
||||||
@Column(name = "memo", length = Integer.MAX_VALUE)
|
@Column(name = "memo", length = Integer.MAX_VALUE)
|
||||||
private String memo;
|
private String memo;
|
||||||
|
|
||||||
@Size(max = 255)
|
@NotNull
|
||||||
@ColumnDefault("'N'")
|
@ColumnDefault("'N'")
|
||||||
@Column(name = "del_yn", length = 255)
|
@Column(name = "del_yn", nullable = false, length = Integer.MAX_VALUE)
|
||||||
private String delYn = "N";
|
private String delYn;
|
||||||
|
|
||||||
@ColumnDefault("now()")
|
@NotNull
|
||||||
@Column(name = "created_dttm")
|
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||||
|
@Column(name = "created_dttm", nullable = false)
|
||||||
private ZonedDateTime createdDttm;
|
private ZonedDateTime createdDttm;
|
||||||
|
|
||||||
|
@Column(name = "cnn_filter_cnt")
|
||||||
|
private Integer cnnFilterCnt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,12 @@ package com.kamco.cd.training.postgres.entity;
|
|||||||
import com.kamco.cd.training.model.dto.ModelMngDto;
|
import com.kamco.cd.training.model.dto.ModelMngDto;
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.FetchType;
|
||||||
import jakarta.persistence.GeneratedValue;
|
import jakarta.persistence.GeneratedValue;
|
||||||
import jakarta.persistence.GenerationType;
|
import jakarta.persistence.GenerationType;
|
||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
import jakarta.persistence.PrePersist;
|
import jakarta.persistence.JoinColumn;
|
||||||
|
import jakarta.persistence.ManyToOne;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
@@ -16,6 +18,8 @@ import java.util.UUID;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
import org.hibernate.annotations.OnDelete;
|
||||||
|
import org.hibernate.annotations.OnDeleteAction;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -28,17 +32,14 @@ public class ModelTrainMasterEntity {
|
|||||||
@Column(name = "model_uid", nullable = false)
|
@Column(name = "model_uid", nullable = false)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Column(name = "uuid", columnDefinition = "uuid", nullable = false, updatable = false)
|
|
||||||
private UUID uuid;
|
|
||||||
|
|
||||||
@Size(max = 50)
|
@Size(max = 50)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "model_ver", nullable = false, length = 50)
|
@Column(name = "model_ver", nullable = false, length = 50)
|
||||||
private String modelVer;
|
private String modelVer;
|
||||||
|
|
||||||
@Size(max = 50)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@Column(name = "hyper_ver", length = 50)
|
@JoinColumn(name = "hyper_ver")
|
||||||
private String hyperVer;
|
private ModelHyperParamEntity hyperVer;
|
||||||
|
|
||||||
@Size(max = 50)
|
@Size(max = 50)
|
||||||
@Column(name = "epoch_ver", length = 50)
|
@Column(name = "epoch_ver", length = 50)
|
||||||
@@ -48,10 +49,6 @@ public class ModelTrainMasterEntity {
|
|||||||
@Column(name = "process_step", length = 50)
|
@Column(name = "process_step", length = 50)
|
||||||
private String processStep;
|
private String processStep;
|
||||||
|
|
||||||
@Size(max = 20)
|
|
||||||
@Column(name = "status_cd", length = 20)
|
|
||||||
private String statusCd;
|
|
||||||
|
|
||||||
@Column(name = "train_start_dttm")
|
@Column(name = "train_start_dttm")
|
||||||
private ZonedDateTime trainStartDttm;
|
private ZonedDateTime trainStartDttm;
|
||||||
|
|
||||||
@@ -68,19 +65,18 @@ public class ModelTrainMasterEntity {
|
|||||||
@Column(name = "step1_end_dttm")
|
@Column(name = "step1_end_dttm")
|
||||||
private ZonedDateTime step1EndDttm;
|
private ZonedDateTime step1EndDttm;
|
||||||
|
|
||||||
@Size(max = 50)
|
|
||||||
@Column(name = "step1_duration", length = 50)
|
@Column(name = "step1_duration", length = 50)
|
||||||
private String step1Duration;
|
private ZonedDateTime step1Duration;
|
||||||
|
|
||||||
@Column(name = "step2_end_dttm")
|
@Column(name = "step2_end_dttm")
|
||||||
private ZonedDateTime step2EndDttm;
|
private ZonedDateTime step2EndDttm;
|
||||||
|
|
||||||
@Size(max = 50)
|
|
||||||
@Column(name = "step2_duration", length = 50)
|
@Column(name = "step2_duration", length = 50)
|
||||||
private String step2Duration;
|
private ZonedDateTime step2Duration;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@ColumnDefault("false")
|
@ColumnDefault("false")
|
||||||
@Column(name = "del_yn")
|
@Column(name = "del_yn", nullable = false)
|
||||||
private Boolean delYn = false;
|
private Boolean delYn = false;
|
||||||
|
|
||||||
@Column(name = "created_uid")
|
@Column(name = "created_uid")
|
||||||
@@ -113,19 +109,6 @@ public class ModelTrainMasterEntity {
|
|||||||
@Column(name = "error_msg", length = Integer.MAX_VALUE)
|
@Column(name = "error_msg", length = Integer.MAX_VALUE)
|
||||||
private String errorMsg;
|
private String errorMsg;
|
||||||
|
|
||||||
// ==================== Resume Training (학습 재시작) ====================
|
|
||||||
|
|
||||||
@Column(name = "last_checkpoint_epoch")
|
|
||||||
private Integer lastCheckpointEpoch;
|
|
||||||
|
|
||||||
@Size(max = 500)
|
|
||||||
@Column(name = "checkpoint_path", length = 500)
|
|
||||||
private String checkpointPath;
|
|
||||||
|
|
||||||
@ColumnDefault("false")
|
|
||||||
@Column(name = "can_resume")
|
|
||||||
private Boolean canResume = false;
|
|
||||||
|
|
||||||
@Column(name = "step2_start_dttm")
|
@Column(name = "step2_start_dttm")
|
||||||
private Instant step2StartDttm;
|
private Instant step2StartDttm;
|
||||||
|
|
||||||
@@ -136,35 +119,60 @@ public class ModelTrainMasterEntity {
|
|||||||
@Column(name = "memo", length = Integer.MAX_VALUE)
|
@Column(name = "memo", length = Integer.MAX_VALUE)
|
||||||
private String memo;
|
private String memo;
|
||||||
|
|
||||||
@Column(name = "base_model_uid")
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
private Integer baseModelUid;
|
@OnDelete(action = OnDeleteAction.SET_NULL)
|
||||||
|
@JoinColumn(name = "base_model_uid")
|
||||||
|
private ModelTrainMasterEntity baseModelUid;
|
||||||
|
|
||||||
@Size(max = 1000)
|
@Size(max = 1000)
|
||||||
@Column(name = "pretrained_model_path", length = 1000)
|
@Column(name = "pretrained_model_path", length = 1000)
|
||||||
private String pretrainedModelPath;
|
private String pretrainedModelPath;
|
||||||
|
|
||||||
@PrePersist
|
@Column(name = "last_checkpoint_epoch")
|
||||||
public void prePersist() {
|
private Integer lastCheckpointEpoch;
|
||||||
if (this.uuid == null) {
|
|
||||||
this.uuid = UUID.randomUUID();
|
@Size(max = 500)
|
||||||
}
|
@ColumnDefault("NULL")
|
||||||
}
|
@Column(name = "checkpoint_path", length = 500)
|
||||||
|
private String checkpointPath;
|
||||||
|
|
||||||
|
@ColumnDefault("false")
|
||||||
|
@Column(name = "can_resume")
|
||||||
|
private Boolean canResume;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@ColumnDefault("uuid_generate_v4()")
|
||||||
|
@Column(name = "uuid", nullable = false)
|
||||||
|
private UUID uuid;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "step1_status", length = 10)
|
||||||
|
private String step1Status;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "step2_status", length = 10)
|
||||||
|
private String step2Status;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "transfer_status", length = 10)
|
||||||
|
private String transferStatus;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "status_cd", length = 10)
|
||||||
|
private String statusCd;
|
||||||
|
|
||||||
public ModelMngDto.Basic toDto() {
|
public ModelMngDto.Basic toDto() {
|
||||||
ModelMngDto.Basic dto = new ModelMngDto.Basic();
|
return new ModelMngDto.Basic(
|
||||||
dto.setId(this.id);
|
this.id,
|
||||||
dto.setModelNm(this.modelVer);
|
this.uuid,
|
||||||
dto.setStartDttm(this.trainStartDttm);
|
this.modelVer,
|
||||||
dto.setTrainingEndDttm(this.step1EndDttm);
|
this.trainStartDttm,
|
||||||
dto.setTestEndDttm(this.step2EndDttm);
|
this.step1EndDttm,
|
||||||
dto.setDurationDttm(this.step2Duration);
|
this.step1Duration,
|
||||||
dto.setProcessStage(this.processStep);
|
this.step2EndDttm,
|
||||||
dto.setStatusCd(this.statusCd);
|
this.step2Duration,
|
||||||
return dto;
|
this.step1Status,
|
||||||
}
|
this.step2Status,
|
||||||
|
this.transferStatus);
|
||||||
/** UUID 필드가 제대로 설정되었는지 확인 (디버그용) */
|
|
||||||
public String getUuidString() {
|
|
||||||
return this.uuid != null ? this.uuid.toString() : null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.querydsl.jpa.impl.JPAQueryFactory;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.PageImpl;
|
import org.springframework.data.domain.PageImpl;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@@ -31,10 +30,10 @@ public class ModelMngRepositoryImpl implements ModelMngRepositoryCustom {
|
|||||||
public Page<ModelTrainMasterEntity> findByModels(ModelMngDto.SearchReq searchReq) {
|
public Page<ModelTrainMasterEntity> findByModels(ModelMngDto.SearchReq searchReq) {
|
||||||
Pageable pageable = searchReq.toPageable();
|
Pageable pageable = searchReq.toPageable();
|
||||||
BooleanBuilder builder = new BooleanBuilder();
|
BooleanBuilder builder = new BooleanBuilder();
|
||||||
|
//
|
||||||
if (StringUtils.isNotBlank(searchReq.getStatus())) {
|
// if (StringUtils.isNotBlank(searchReq.getStatus())) {
|
||||||
builder.and(modelMng.statusCd.eq(searchReq.getStatus()));
|
// builder.and(modelMng.statusCd.eq(searchReq.getStatus()));
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Entity 직접 조회 (Projections 사용 지양)
|
// Entity 직접 조회 (Projections 사용 지양)
|
||||||
List<ModelTrainMasterEntity> content =
|
List<ModelTrainMasterEntity> content =
|
||||||
|
|||||||
Reference in New Issue
Block a user