MCPcopy Create free account
hub / github.com/dhbloo/rapfi / validateConfig

Function validateConfig

Rapfi/command/tuning.cpp:59–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void validateConfig(size_t epochs, const TuningConfig &cfg)
60{
61 if (epochs < 1)
62 throw std::invalid_argument("epochs must be greater than 0");
63 if (!(cfg.tuneRule[FREESTYLE] || cfg.tuneRule[STANDARD] || cfg.tuneRule[RENJU]))
64 throw std::invalid_argument("there must be at least one rule to tune");
65 if (cfg.batchSize < 1)
66 throw std::invalid_argument("batchsize must be greater than 0");
67 if (cfg.moveScoreLossGamma < 0)
68 throw std::invalid_argument("move-score-loss-gamma must be not less than 0");
69 if (cfg.boardSizeMin > cfg.boardSizeMax)
70 throw std::invalid_argument("max-boardsize must be greater than min-boardsize");
71 if (!cfg.usePreviousScalingFactor) {
72 if (cfg.nIterations < 1 || cfg.nStepsPerIteration < 1)
73 throw std::invalid_argument(
74 "num-iteration and num-steps-per-iteration must be greater than 0");
75 if (cfg.scalingFactorMin > cfg.scalingFactorMax)
76 throw std::invalid_argument(
77 "scaling-factor-lower-bound must be not less than scaling-factor-upper-bound");
78 }
79}
80
81std::unique_ptr<Dataset> createDataset(Command::DatasetType datasetType,
82 const std::vector<std::string> &pathList)

Callers 1

tuningMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected