Commit b9cd4b4e authored by Franck Dary's avatar Franck Dary
Browse files

Fixed min float value

parent e253ffad
......@@ -1061,7 +1061,7 @@ Action Action::writeScore(const std::string & colName, Config::Object object, in
int lineIndex = config.getRelativeWordIndex(object, relativeIndex);
float score = config.getChosenActionScore();
if (score != std::numeric_limits<float>::min())
if (-score != std::numeric_limits<float>::max())
return addHypothesis(colName, lineIndex, fmt::format("{}", score)).apply(config, a);
else
return addHypothesis(colName, lineIndex, config.getConst(colName, lineIndex, 0)).apply(config, a);
......
......@@ -167,7 +167,8 @@ int MacaonTrain::main()
Trainer trainer(machine, batchSize);
Decoder decoder(machine);
float bestDevScore = computeDevScore ? std::numeric_limits<float>::min() : std::numeric_limits<float>::max();
float bestDevScore = computeDevScore ? -std::numeric_limits<float>::max() : std::numeric_limits<float>::max();
fmt::print("best = {}\n", bestDevScore);
auto trainInfos = machinePath.parent_path() / "train.info";
......
......@@ -82,7 +82,7 @@ void Trainer::extractExamples(SubConfig & config, bool debug, std::filesystem::p
int nbClasses = machine.getTransitionSet(config.getState()).size();
float bestScore = std::numeric_limits<float>::min();
float bestScore = -std::numeric_limits<float>::max();
if (dynamicOracle and util::choiceWithProbability(1.0) and config.getState() != "tokenizer" and config.getState() != "segmenter")
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment