Skip to content
Snippets Groups Projects
Commit 91872079 authored by Franck Dary's avatar Franck Dary
Browse files

Set neural network to eval mode in decode

parent 5715dda9
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ Decoder::Decoder(ReadingMachine & machine) : machine(machine)
void Decoder::decode(BaseConfig & config, std::size_t beamSize, bool debug)
{
machine.getClassifier()->getNN()->train(false);
config.addPredicted(machine.getPredicted());
try
......@@ -63,6 +64,8 @@ void Decoder::decode(BaseConfig & config, std::size_t beamSize, bool debug)
if (debug)
fmt::print(stderr, "Forcing EOS transition\n");
}
machine.getClassifier()->getNN()->train(true);
}
float Decoder::getMetricScore(const std::string & metric, std::size_t scoreIndex) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment