Add current_model_score to ModelCheckpoint.on_save_checkpoint
🚀 Feature
Add current_model_score to ModelCheckpoint.on_save_checkpoint

  
    
      pytorch-lightning/pytorch_lightning/callbacks/model_checkpoint.py
    
    
        Lines 186 to 191
      in
      c208ac6
    
  
  
    

        
          
           def on_save_checkpoint(self, trainer, pl_module) -> Dict[str, Any]: 
        

        
          
               return { 
        

        
          
                   "monitor": self.monitor, 
        

        
          
                   "best_model_score": self.best_model_score, 
        

        
          
                   "best_model_path": self.best_model_path, 
        

        
          
               } 
        
    
  


Motivation
Say you have 3 checkpoints saved (1, 2, 3). You got your best score on (1). It is a minimization task.
This would be each checkpoint saved state:
[
    ('epoch=1.ckpt', {
        'monitor': 'foo',
        'best_model_score': tensor(0.1),
        'best_model_path': 'epoch=1.ckpt'
    }),
    ('epoch=2.ckpt', {
        'monitor': 'foo',
        'best_model_score': tensor(0.1),
        'best_model_path': 'epoch=1.ckpt'
    }),
    ('epoch=3.ckpt', {
        'monitor': 'foo',
        'best_model_score': tensor(0.1),
        'best_model_path': 'epoch=1.ckpt'
    })
]

Notice how there is no info about the actual score for that particular checkpoint.
Pitch
Add the actual score for each checkpoint state
[
    ('epoch=1.ckpt', {
        'monitor': 'foo',
        'best_model_score': tensor(0.1),
        'best_model_path': 'epoch=1.ckpt'
        'current_model_score': tensor(0.1),
    }),
    ('epoch=2.ckpt', {
        'monitor': 'foo',
        'best_model_score': tensor(0.1),
        'best_model_path': 'epoch=1.ckpt'
        'current_model_score': tensor(0.2),
    }),
    ('epoch=3.ckpt', {
        'monitor': 'foo',
        'best_model_score': tensor(0.1),
        'best_model_path': 'epoch=1.ckpt'
        'current_model_score': tensor(0.3),
    })
]

I can work on the PR