class_docstr: An epoch counter which can save and recall its state.
  
  Use this as the iterator for epochs.
  Note that this iterator gives you the numbers from [1 ... limit] not
  [0 ... limit-1] as range(limit) would.
  
  Example
  -------
  >>> from speechbrain.utils.checkpoints import Checkpointer
  >>> tmpdir = getfixture('tmpdir')
  >>> epoch_counter = EpochCounter(10)
  >>> recoverer = Checkpointer(tmpdir, {"epoch": epoch_counter})
  >>> recoverer.recover_if_possible()
  >>> # Now after recovery,
  >>> # the epoch starts from where it left off!
  >>> for epoch in epoch_counter:
  ...     # Run training...
  ...     ckpt = recoverer.save_checkpoint()
class_docstr_tok: ["An","epoch","counter","which","can","save","and","recall","its","state",".","Use","this","as","the","iterator","for","epochs",".","Note","that","this","iterator","gives","you","the","numbers","from","[","1","...","limit","]","not","[","0","...","limit-1","]","as","range","(","limit",")","would",".","Example","--","--","--","-",">",">",">","from","speechbrain.utils.checkpoints","import","Checkpointer",">",">",">","tmpdir","=","getfixture","(","'tmpdir","'",")",">",">",">","epoch_counter","=","EpochCounter","(","10",")",">",">",">","recoverer","=","Checkpointer","(","tmpdir",",","{","``","epoch","''",":","epoch_counter","}",")",">",">",">","recoverer.recover_if_possible","(",")",">",">",">","#","Now","after","recovery",",",">",">",">","#","the","epoch","starts","from","where","it","left","off","!",">",">",">","for","epoch","in","epoch_counter",":","...","#","Run","training","...","...","ckpt","=","recoverer.save_checkpoint","(",")"]
code: def __iter__(self):
      return self
  
file_path: speechbrain/speechbrain/utils/epoch_loop.py
imports: from .checkpoints import register_checkpoint_hooks
  from .checkpoints import mark_as_saver
  from .checkpoints import mark_as_loader
  import logging
  import yaml
label_desc: Use image node_id 2 for calling the EpochCounter obj's underlying member method code with example usage: obj.__iter__() and returns: self