Make EarlyStopping throw an error on unknown modes
🚀 Feature
Right now, passing in a nonsense mode to pl.callbacks.EarlyStopping passes silently
>>> import pytorch_lightning as pl
>>> pl.callbacks.EarlyStopping("val_f1", mode="werwer")
In the code, it looks  this is deliberate: in this case, we only raise a warning when the verbosity is >0

  
    
      pytorch-lightning/pytorch_lightning/callbacks/early_stopping.py
    
    
        Lines 104 to 110
      in
      6adc1b3
    
  
  
    

        
          
           if self.mode not in self.mode_dict and self.mode != 'auto': 
        

        
          
               if self.verbose > 0: 
        

        
          
                   rank_zero_warn( 
        

        
          
                       f'EarlyStopping mode={self.mode} is unknown, fallback to auto mode.', 
        

        
          
                       RuntimeWarning, 
        

        
          
                   ) 
        

        
          
               self.mode = 'auto' 
        
    
  


I think this is undesirable behavior -- if you make a typo when passing in a parameter to mode, EarlyStopping should fail with an exception, not just produce a warning about potentially incorrect behavior.  Worse, EarlyStopping only outputs a warning when the verbosity > 0 -- that means by default, EarlyStopping will just silently just produce incorrect behavior.