Stop training if high enough accuracy isn’t reached
Hi, I know that there is EarlyStopping if validation metrics are deteriorating. But I was wondering if it was possible to stop training if after say epoch 10, the accuracy hasn’t reached say 20%. If such a callback doesn’t exist, any thoughts on how I can get started on the implementation of it?
For context I am running a distributed hyper-parameter optimizer and I know that the “good” hyper-parameter set will get me to 50% accuracy by epoch 5.
You could write a callback similar to early stopping which checks your metric for the target value by whatever epoch. if the metric isn't good enough, you can signal to the trainer to stop, like this: 
  
    
      pytorch-lightning/pytorch_lightning/callbacks/early_stopping.py
    
    
        Lines 194 to 196
      in
      490cc57
    
  
  
    

        
          
           # stop every ddp process if any world process decides to stop 
        

        
          
           should_stop = trainer.training_type_plugin.reduce_boolean_decision(should_stop) 
        

        
          
           trainer.should_stop = trainer.should_stop or should_stop