package com.kamco.cd.training.train.dto;

import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class TrainRunRequest {

  // ========================
  // 기본
  // ========================
  private String datasetFolder;
  private UUID outputFolder;
  private String inputSize;
  private String cropSize;
  private Integer batchSize;
  private String gpuIds;
  private Integer gpus;
  private Double learningRate;
  private String backbone;
  private Integer epochs;

  // ========================
  // Data
  // ========================
  private Integer trainNumWorkers;
  private Integer valNumWorkers;
  private Integer testNumWorkers;
  private Boolean trainShuffle;
  private Boolean trainPersistent;
  private Boolean valPersistent;

  // ========================
  // Model Architecture
  // ========================
  private Double dropPathRate;
  private Integer frozenStages;
  private String neckPolicy;
  private String classWeight;
  private String decoderChannels;

  // ========================
  // Loss & Optimization
  // ========================
  private Double weightDecay;
  private Double layerDecayRate;
  private Integer ignoreIndex;
  private Boolean ddpFindUnusedParams;
  private Integer numLayers;

  // ========================
  // Evaluation
  // ========================
  private String metrics;
  private String saveBest;
  private String saveBestRule;
  private Integer valInterval;
  private Integer logInterval;
  private Integer visInterval;

  // ========================
  // Augmentation
  // ========================
  private Double rotProb;
  private String rotDegree;
  private Double flipProb;
  private Double exchangeProb;
  private Integer brightnessDelta;
  private String contrastRange;
  private String saturationRange;
  private Integer hueDelta;

  // ========================
  // 실행 타임아웃
  // ========================
  private Integer timeoutSeconds;
  private String resumeFrom;

  private UUID uuid;

  private Boolean reqTmpYn; // tmp 심볼릭 링크를 쓰는지 아닌지 여부

  private String trainType; // 일반 : GENERAL, 전이 : TRANSFER

  private UUID beforeModelUUID;
  private Integer
      beforeBestEpoch; // 전이학습인 경우, before 모델 베스트 pth 경로를 보내야 해서 before 모델의 bestEpoch 을 조회하기

  public String getOutputFolder() {
    return String.valueOf(this.outputFolder);
  }

  public String getUuid() {
    return String.valueOf(this.uuid);
  }
}
