bst-mug / n2c2

Support code for participation at the 2018 n2c2 Shared-Task Track 1
https://n2c2.dbmi.hms.harvard.edu
Apache License 2.0
6 stars 4 forks source link

Save models at each epoch (fixes #87) #93

Closed michelole closed 5 years ago

michelole commented 5 years ago

Previous code would save a model only after converging, which was not the original intent. Move the saveModel(epoch) call to inner training loop. As a consequence, save in a properties file the epoch of the best model and use it when loading the network from file.

Also, as character trigram maps do not change per epoch, save them in a new saveParams method called only once.

Finally, remove the trainCounter variable, which seemed unused.

Add tests to ensure variables and prediction are working as expected.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+1.4%) to 74.932% when pulling dafc7dde166e46828599bf51386b20696a881340 on michelole:issue-87 into 228b886082bc78b61ec9102a34ca65e45bd10095 on bst-mug:master.