Skip to content
Snippets Groups Projects

Cross validation

Merged
Anjith GEORGErequested to merge
cross_validation into master
1 open thread

This MR adds the following

  • Adds cross-validation using a validation set; the best model based on the lowest validation loss is saved automatically now
  • Adds trainer, extractor, training script and unit tests for FASNet architecture
  • Small change in MCCNN architecture; added a flag for selecting whether to use sigmoid in eval phase.
Edited by Anjith GEORGE

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
247 def __getitem__(self, idx):
248 data = numpy.random.rand(3, 224,224).astype("float32")
249 label = numpy.random.randint(2)
250 sample = data, label
251 return sample
252
253 def test_FASNettrainer():
254
255 from ..architectures import FASNet
256 net = FASNet()
257
258 dataloader={}
259 dataloader['train'] = torch.utils.data.DataLoader(DummyDataSetFASNet(), batch_size=32, shuffle=True)
260
261 from ..trainers import FASNetTrainer
262 trainer = FASNetTrainer(net, verbosity_level=3,do_crossvalidation=False)
  • Not considering the right comments from @amohammadi on simplifying things a little and having less script for everything, this MR is fine with me.

    Note that at the moment, the only script causing problem is train_network.py, which is very different from all the others. It's my plan to take care of this, see #15 (closed)

  • Anjith GEORGE added 1 commit

    added 1 commit

    • c8943f5d - Adds more unit tests for trainers with CV and fuixed a typo

    Compare with previous version

  • @heusch Can you merge it if it's ok with you. Actually I need one change in this MR for BATL tomorrow, I can make another MR with just that change if you prefer.

  • mentioned in commit 064ad286

  • mentioned in issue #11 (closed)

  • Please register or sign in to reply
    Loading