Skip to content

pytorch implementation of the paper "Training Over-parameterised Models with Non-Decomposable Objectives"

Notifications You must be signed in to change notification settings

stablegradients/TrainingOverParametrisedModels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrainingOverParametrisedModels

pytorch implementation of the paper "Training Over-parameterised Models with Non-Decomposable Objectives" Harikrishan Narasimhan et al.

import numpy as np
from losses import MinRecall

# prior  : a list of prior
# val_lr : validation learning rate
# device : str, "cuda:x" where x is device id
criterion = MinRecall(prior, val_lr, device='cuda:0')

for epoch in range(num_epochs):
  # generate your model metrics
  # CM :confusion_matrix consider a 10 class classification
  criterion.update(CM)
  for x, targets in dataloader:
    # N steps of SGD
    preds = model(x)
    loss = criterion(preds, targets, redution)
    loss.backward()
    model.zero_grad()

About

pytorch implementation of the paper "Training Over-parameterised Models with Non-Decomposable Objectives"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published