csv 파일 읽는 경로 읽어서 수정, train은 epoch + 1 해서 저장
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.kamco.cd.training.postgres.core;
|
||||
|
||||
import com.kamco.cd.training.postgres.repository.train.ModelTestMetricsJobRepository;
|
||||
import com.kamco.cd.training.train.dto.ModelTrainMetricsDto.ResponsePathDto;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -18,7 +19,7 @@ public class ModelTestMetricsJobCoreService {
|
||||
}
|
||||
|
||||
// Test 로직 시작
|
||||
public List<Long> getTestMetricSaveNotYetModelIds() {
|
||||
public List<ResponsePathDto> getTestMetricSaveNotYetModelIds() {
|
||||
return modelTestMetricsJobRepository.getTestMetricSaveNotYetModelIds();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kamco.cd.training.postgres.core;
|
||||
|
||||
import com.kamco.cd.training.postgres.repository.train.ModelTrainMetricsJobRepository;
|
||||
import com.kamco.cd.training.train.dto.ModelTrainMetricsDto.ResponsePathDto;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -12,7 +13,7 @@ public class ModelTrainMetricsJobCoreService {
|
||||
|
||||
private final ModelTrainMetricsJobRepository modelTrainMetricsJobRepository;
|
||||
|
||||
public List<Long> getTrainMetricSaveNotYetModelIds() {
|
||||
public List<ResponsePathDto> getTrainMetricSaveNotYetModelIds() {
|
||||
return modelTrainMetricsJobRepository.getTrainMetricSaveNotYetModelIds();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.kamco.cd.training.postgres.repository.train;
|
||||
|
||||
import com.kamco.cd.training.train.dto.ModelTrainMetricsDto.ResponsePathDto;
|
||||
import java.util.List;
|
||||
|
||||
public interface ModelTestMetricsJobRepositoryCustom {
|
||||
|
||||
void updateModelMetricsTrainSaveYn(Long modelId, String stepNo);
|
||||
|
||||
List<Long> getTestMetricSaveNotYetModelIds();
|
||||
List<ResponsePathDto> getTestMetricSaveNotYetModelIds();
|
||||
|
||||
void insertModelMetricsTest(List<Object[]> batchArgs);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import static com.kamco.cd.training.postgres.entity.QModelMasterEntity.modelMast
|
||||
|
||||
import com.kamco.cd.training.common.enums.TrainStatusType;
|
||||
import com.kamco.cd.training.postgres.entity.ModelMetricsTestEntity;
|
||||
import com.kamco.cd.training.train.dto.ModelTrainMetricsDto.ResponsePathDto;
|
||||
import com.querydsl.core.types.Projections;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import java.util.List;
|
||||
import org.springframework.data.jpa.repository.support.QuerydslRepositorySupport;
|
||||
@@ -36,9 +38,11 @@ public class ModelTestMetricsJobRepositoryImpl extends QuerydslRepositorySupport
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getTestMetricSaveNotYetModelIds() {
|
||||
public List<ResponsePathDto> getTestMetricSaveNotYetModelIds() {
|
||||
return queryFactory
|
||||
.select(modelMasterEntity.id)
|
||||
.select(
|
||||
Projections.constructor(
|
||||
ResponsePathDto.class, modelMasterEntity.id, modelMasterEntity.responsePath))
|
||||
.from(modelMasterEntity)
|
||||
.where(
|
||||
modelMasterEntity.step2EndDttm.isNotNull(),
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.kamco.cd.training.postgres.repository.train;
|
||||
|
||||
import com.kamco.cd.training.train.dto.ModelTrainMetricsDto.ResponsePathDto;
|
||||
import java.util.List;
|
||||
|
||||
public interface ModelTrainMetricsJobRepositoryCustom {
|
||||
|
||||
List<Long> getTrainMetricSaveNotYetModelIds();
|
||||
List<ResponsePathDto> getTrainMetricSaveNotYetModelIds();
|
||||
|
||||
void insertModelMetricsTrain(List<Object[]> batchArgs);
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import static com.kamco.cd.training.postgres.entity.QModelMasterEntity.modelMast
|
||||
|
||||
import com.kamco.cd.training.common.enums.TrainStatusType;
|
||||
import com.kamco.cd.training.postgres.entity.ModelMetricsTrainEntity;
|
||||
import com.kamco.cd.training.train.dto.ModelTrainMetricsDto.ResponsePathDto;
|
||||
import com.querydsl.core.types.Projections;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import java.util.List;
|
||||
import org.springframework.data.jpa.repository.support.QuerydslRepositorySupport;
|
||||
@@ -23,9 +25,11 @@ public class ModelTrainMetricsJobRepositoryImpl extends QuerydslRepositorySuppor
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getTrainMetricSaveNotYetModelIds() {
|
||||
public List<ResponsePathDto> getTrainMetricSaveNotYetModelIds() {
|
||||
return queryFactory
|
||||
.select(modelMasterEntity.id)
|
||||
.select(
|
||||
Projections.constructor(
|
||||
ResponsePathDto.class, modelMasterEntity.id, modelMasterEntity.responsePath))
|
||||
.from(modelMasterEntity)
|
||||
.where(
|
||||
modelMasterEntity.step1EndDttm.isNotNull(),
|
||||
@@ -41,7 +45,7 @@ public class ModelTrainMetricsJobRepositoryImpl extends QuerydslRepositorySuppor
|
||||
public void insertModelMetricsTrain(List<Object[]> batchArgs) {
|
||||
String sql =
|
||||
"""
|
||||
insert into tb_model_matrics_train
|
||||
insert into tb_model_metrics_train
|
||||
(model_id, epoch, iteration, loss, lr, duration_time)
|
||||
values (?, ?, ?, ?, ?, ?)
|
||||
""";
|
||||
@@ -66,7 +70,7 @@ public class ModelTrainMetricsJobRepositoryImpl extends QuerydslRepositorySuppor
|
||||
public void insertModelMetricsValidation(List<Object[]> batchArgs) {
|
||||
String sql =
|
||||
"""
|
||||
insert into tb_model_matrics_validation
|
||||
insert into tb_model_metrics_validation
|
||||
(model_id, epoch, a_acc, m_fscore, m_precision, m_recall, m_iou, m_acc, changed_fscore, changed_precision, changed_recall,
|
||||
unchanged_fscore, unchanged_precision, unchanged_recall
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user