From 15aa2fa04161f6deaf11f767359061da08e7c1de Mon Sep 17 00:00:00 2001 From: teddy Date: Tue, 3 Feb 2026 15:09:03 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=98=EC=9D=B4=ED=8D=BC=ED=8C=8C=EB=9D=BC?= =?UTF-8?q?=EB=AF=B8=ED=84=B0=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hyperparam/HyperParamApiController.java | 2 +- .../hyperparam/service/HyperParamService.java | 2 +- .../model/service/ModelTrainService.java | 21 ---- .../postgres/core/AnimalCoreService.java | 77 ------------- .../postgres/core/HyperParamCoreService.java | 104 +----------------- 5 files changed, 4 insertions(+), 202 deletions(-) delete mode 100644 src/main/java/com/kamco/cd/training/postgres/core/AnimalCoreService.java diff --git a/src/main/java/com/kamco/cd/training/hyperparam/HyperParamApiController.java b/src/main/java/com/kamco/cd/training/hyperparam/HyperParamApiController.java index 760cfae..2e02708 100644 --- a/src/main/java/com/kamco/cd/training/hyperparam/HyperParamApiController.java +++ b/src/main/java/com/kamco/cd/training/hyperparam/HyperParamApiController.java @@ -145,7 +145,7 @@ public class HyperParamApiController { return ApiResponseDto.ok(null); } - @Operation(summary = "하이퍼파라미터 단건 조회", description = "특정 버전의 하이퍼파라미터 상세 정보를 조회합니다") + @Operation(summary = "하이퍼파라미터 상세 조회", description = "특정 버전의 하이퍼파라미터 상세 정보를 조회합니다") @ApiResponses( value = { @ApiResponse( diff --git a/src/main/java/com/kamco/cd/training/hyperparam/service/HyperParamService.java b/src/main/java/com/kamco/cd/training/hyperparam/service/HyperParamService.java index 73235d9..da7a742 100644 --- a/src/main/java/com/kamco/cd/training/hyperparam/service/HyperParamService.java +++ b/src/main/java/com/kamco/cd/training/hyperparam/service/HyperParamService.java @@ -63,7 +63,7 @@ public class HyperParamService { } /** - * 하이퍼파라미터 단건 조회 + * 하이퍼파라미터 상세 조회 * * @param uuid * @return diff --git a/src/main/java/com/kamco/cd/training/model/service/ModelTrainService.java b/src/main/java/com/kamco/cd/training/model/service/ModelTrainService.java index 8c406ae..1b4c8e2 100644 --- a/src/main/java/com/kamco/cd/training/model/service/ModelTrainService.java +++ b/src/main/java/com/kamco/cd/training/model/service/ModelTrainService.java @@ -66,27 +66,6 @@ public class ModelTrainService { .build(); } - /** - * 하이퍼파라미터 단건 조회 - * - * @param hyperVer 하이퍼파라미터 버전 - * @return 하이퍼파라미터 정보 - */ - public ModelMngDto.HyperParamInfo getHyperParam(String hyperVer) { - return hyperParamCoreService.findByHyperVer(hyperVer); - } - - /** - * 하이퍼파라미터 삭제 - * - * @param hyperVer 하이퍼파라미터 버전 - */ - @Transactional - public void deleteHyperParam(String hyperVer) { - hyperParamCoreService.deleteHyperParam(hyperVer); - log.info("하이퍼파라미터 삭제 완료: {}", hyperVer); - } - /** * 학습 시작 * diff --git a/src/main/java/com/kamco/cd/training/postgres/core/AnimalCoreService.java b/src/main/java/com/kamco/cd/training/postgres/core/AnimalCoreService.java deleted file mode 100644 index 12c8782..0000000 --- a/src/main/java/com/kamco/cd/training/postgres/core/AnimalCoreService.java +++ /dev/null @@ -1,77 +0,0 @@ -// package com.kamco.cd.kamcoback.postgres.core; -// -// import com.kamco.cd.kamcoback.common.service.BaseCoreService; -// import com.kamco.cd.kamcoback.postgres.entity.AnimalEntity; -// import com.kamco.cd.kamcoback.postgres.entity.ZooEntity; -// import com.kamco.cd.kamcoback.postgres.repository.AnimalRepository; -// import com.kamco.cd.kamcoback.postgres.repository.ZooRepository; -// import com.kamco.cd.kamcoback.zoo.dto.AnimalDto; -// import jakarta.persistence.EntityNotFoundException; -// import lombok.RequiredArgsConstructor; -// import org.springframework.data.domain.Page; -// import org.springframework.stereotype.Service; -// import org.springframework.transaction.annotation.Transactional; -// -// @Service -// @RequiredArgsConstructor -// @Transactional(readOnly = true) -// public class AnimalCoreService -// implements BaseCoreService { -// -// private final AnimalRepository animalRepository; -// private final ZooRepository zooRepository; -// -// @Transactional(readOnly = true) -// public AnimalDto.Basic getDataByUuid(String uuid) { -// AnimalEntity getZoo = -// animalRepository -// .getAnimalByUuid(uuid) -// .orElseThrow(() -> new EntityNotFoundException("Zoo not found with uuid: " + uuid)); -// return getZoo.toDto(); -// } -// -// // AddReq를 받는 추가 메서드 -// @Transactional -// public AnimalDto.Basic create(AnimalDto.AddReq req) { -// ZooEntity zoo = null; -// if (req.getZooUuid() != null) { -// zoo = -// zooRepository -// .getZooByUuid(req.getZooUuid()) -// .orElseThrow( -// () -> -// new EntityNotFoundException("Zoo not found with uuid: " + -// req.getZooUuid())); -// } -// AnimalEntity entity = new AnimalEntity(req.getCategory(), req.getSpecies(), req.getName(), -// zoo); -// AnimalEntity saved = animalRepository.save(entity); -// return saved.toDto(); -// } -// -// @Override -// @Transactional -// public void remove(Long id) { -// AnimalEntity getAnimal = -// animalRepository -// .getAnimalByUid(id) -// .orElseThrow(() -> new EntityNotFoundException("getAnimal not found with id: " + id)); -// getAnimal.deleted(); -// } -// -// @Override -// public AnimalDto.Basic getOneById(Long id) { -// AnimalEntity getAnimal = -// animalRepository -// .getAnimalByUid(id) -// .orElseThrow(() -> new EntityNotFoundException("Zoo not found with id: " + id)); -// return getAnimal.toDto(); -// } -// -// @Override -// public Page search(AnimalDto.SearchReq searchReq) { -// -// Page animalEntities = animalRepository.listAnimal(searchReq); -// return animalEntities.map(AnimalEntity::toDto); -// } -// } diff --git a/src/main/java/com/kamco/cd/training/postgres/core/HyperParamCoreService.java b/src/main/java/com/kamco/cd/training/postgres/core/HyperParamCoreService.java index 17b252c..c034cd6 100644 --- a/src/main/java/com/kamco/cd/training/postgres/core/HyperParamCoreService.java +++ b/src/main/java/com/kamco/cd/training/postgres/core/HyperParamCoreService.java @@ -1,10 +1,8 @@ package com.kamco.cd.training.postgres.core; -import com.kamco.cd.training.common.exception.BadRequestException; import com.kamco.cd.training.common.exception.CustomApiException; import com.kamco.cd.training.common.utils.UserUtil; import com.kamco.cd.training.hyperparam.dto.HyperParamDto; -import com.kamco.cd.training.model.dto.ModelMngDto; import com.kamco.cd.training.postgres.entity.ModelHyperParamEntity; import com.kamco.cd.training.postgres.repository.hyperparam.HyperParamRepository; import java.time.ZonedDateTime; @@ -20,61 +18,6 @@ public class HyperParamCoreService { private final HyperParamRepository hyperParamRepository; private final UserUtil userUtil; - private ModelMngDto.HyperParamInfo mapToHyperParamInfo(ModelHyperParamEntity entity) { - return ModelMngDto.HyperParamInfo.builder() - .hyperVer(entity.getHyperVer()) - // Important - .backbone(entity.getBackbone()) - .inputSize(entity.getInputSize()) - .cropSize(entity.getCropSize()) - .epochCnt(entity.getEpochCnt()) - .batchSize(entity.getBatchSize()) - // Architecture - .dropPathRate(entity.getDropPathRate()) - .frozenStages(entity.getFrozenStages()) - .neckPolicy(entity.getNeckPolicy()) - .decoderChannels(entity.getDecoderChannels()) - .classWeight(entity.getClassWeight()) - .numLayers(entity.getNumLayers()) - // Optimization - .learningRate(entity.getLearningRate()) - .weightDecay(entity.getWeightDecay()) - .layerDecayRate(entity.getLayerDecayRate()) - .ddpFindUnusedParams(entity.getDdpFindUnusedParams()) - .ignoreIndex(entity.getIgnoreIndex()) - // Data - .trainNumWorkers(entity.getTrainNumWorkers()) - .valNumWorkers(entity.getValNumWorkers()) - .testNumWorkers(entity.getTestNumWorkers()) - .trainShuffle(entity.getTrainShuffle()) - .trainPersistent(entity.getTrainPersistent()) - .valPersistent(entity.getValPersistent()) - // Evaluation - .metrics(entity.getMetrics()) - .saveBest(entity.getSaveBest()) - .saveBestRule(entity.getSaveBestRule()) - .valInterval(entity.getValInterval()) - .logInterval(entity.getLogInterval()) - .visInterval(entity.getVisInterval()) - // Hardware - .gpuCnt(entity.getGpuCnt()) - .gpuIds(entity.getGpuIds()) - .masterPort(entity.getMasterPort()) - // Augmentation - .rotProb(entity.getRotProb()) - .flipProb(entity.getFlipProb()) - .rotDegree(entity.getRotDegree()) - .exchangeProb(entity.getExchangeProb()) - .brightnessDelta(entity.getBrightnessDelta()) - .contrastRange(entity.getContrastRange()) - .saturationRange(entity.getSaturationRange()) - .hueDelta(entity.getHueDelta()) - // Common - .memo(entity.getMemo()) - .createdDttm(entity.getCreatedDttm()) - .build(); - } - /** * 하이퍼파라미터 등록 * @@ -188,11 +131,12 @@ public class HyperParamCoreService { */ public HyperParamDto.Basic getInitHyperParam() { ModelHyperParamEntity entity = new ModelHyperParamEntity(); + entity.setUuid(null); return entity.toDto(); } /** - * 하이퍼파라미터 단건 조회 + * 하이퍼파라미터 상세 조회 * * @return */ @@ -204,50 +148,6 @@ public class HyperParamCoreService { return entity.toDto(); } - /** - * 하이퍼파라미터 단건 조회 - * - * @param hyperVer 하이퍼파라미터 버전 - * @return 하이퍼파라미터 정보 - */ - public ModelMngDto.HyperParamInfo findByHyperVer(String hyperVer) { - // ModelHyperParamEntity entity = - // hyperParamRepository - // .findById(hyperVer) - // .orElseThrow(() -> new NotFoundException("하이퍼파라미터를 찾을 수 없습니다: " + hyperVer)); - // - // if ("Y".equals(entity.getDelYn())) { - // throw new NotFoundException("삭제된 하이퍼파라미터입니다: " + hyperVer); - // } - - return mapToHyperParamInfo(null); - } - - /** - * 하이퍼파라미터 삭제 (논리 삭제) - * - * @param hyperVer 하이퍼파라미터 버전 - */ - public void deleteHyperParam(String hyperVer) { - // H1은 디폴트 버전이므로 삭제 불가 - if ("H1".equals(hyperVer)) { - throw new BadRequestException("H1은 디폴트 하이퍼파라미터 버전이므로 삭제할 수 없습니다."); - } - // - // ModelHyperParamEntity entity = - // hyperParamRepository - // .findById(hyperVer) - // .orElseThrow(() -> new NotFoundException("하이퍼파라미터를 찾을 수 없습니다: " + hyperVer)); - // - // if ("Y".equals(entity.getDelYn())) { - // throw new BadRequestException("이미 삭제된 하이퍼파라미터입니다: " + hyperVer); - // } - // - // // 논리 삭제 처리 - // entity.setDelYn("Y"); - // hyperParamRepository.save(entity); - } - /** * 하이퍼파라미터 목록 조회 *