class_docstr: Callback to save the Elegy model or model weights at some frequency.
  
  `ModelCheckpoint` callback is used in conjunction with training using
  `model.fit()` to save a model or weights at some
  interval, so the model or weights can be loaded later to continue the training
  from the state saved.
  
  A few options this callback provides include:
  
  - Whether to only keep the model that has achieved the "best performance" so
      far, or whether to save the model at the end of every epoch regardless of
      performance.
  - Definition of 'best'; which quantity to monitor and whether it should be
      maximized or minimized.
  - The frequency it should save at. Currently, the callback supports saving at
      the end of every epoch, or after a fixed number of training batches.
  
  Example:
  
  ```python
  EPOCHS = 10
  checkpoint_path = '/tmp/checkpoint'
  model_checkpoint_callback = elegy.callbacks.ModelCheckpoint(
      path=checkpoint_path,
      monitor='val_acc',
      mode='max',
      save_best_only=True)
  
  # Model is saved at the end of every epoch, if it's the best seen
  # so far.
  model.fit(epochs=EPOCHS, callbacks=[model_checkpoint_callback])
  
  # The model status (that are considered the best) are loaded into the model.
  model.load(checkpoint_path)
  ```
class_docstr_tok: ["Callback","to","save","the","Elegy","model","or","model","weights","at","some","frequency",".","`","ModelCheckpoint","`","callback","is","used","in","conjunction","with","training","using","`","model.fit","(",")","`","to","save","a","model","or","weights","at","some","interval",",","so","the","model","or","weights","can","be","loaded","later","to","continue","the","training","from","the","state","saved",".","A","few","options","this","callback","provides","include",":","-","Whether","to","only","keep","the","model","that","has","achieved","the","``","best","performance","''","so","far",",","or","whether","to","save","the","model","at","the","end","of","every","epoch","regardless","of","performance",".","-","Definition","of","'best","'",";","which","quantity","to","monitor","and","whether","it","should","be","maximized","or","minimized",".","-","The","frequency","it","should","save","at",".","Currently",",","the","callback","supports","saving","at","the","end","of","every","epoch",",","or","after","a","fixed","number","of","training","batches",".","Example",":","``","`","python","EPOCHS","=","10","checkpoint_path","=","'\/tmp\/checkpoint'","model_checkpoint_callback","=","elegy.callbacks.ModelCheckpoint","(","path=checkpoint_path",",","monitor='val_acc","'",",","mode='max","'",",","save_best_only=True",")","#","Model","is","saved","at","the","end","of","every","epoch",",","if","it","'s","the","best","seen","#","so","far",".","model.fit","(","epochs=EPOCHS",",","callbacks=","[","model_checkpoint_callback","]",")","#","The","model","status","(","that","are","considered","the","best",")","are","loaded","into","the","model",".","model.load","(","checkpoint_path",")","``","`"]
docstr: Returns the file path for checkpoint.
docstr_tok: ["Returns","the","file","path","for","checkpoint","."]
code: def _get_file_path(self, epoch, logs):
      """Returns the file path for checkpoint."""
      # pylint: disable=protected-access
      try:
          # `path` may contain placeholders such as `{epoch:02d}` and
          # `{mape:.2f}`. A mismatch between logged metrics and the path's
          # placeholders can cause formatting to fail.
          return self.path.format(epoch=epoch + 1, **logs)
      except KeyError as e:
          raise KeyError(
              'Failed to format this callback path: "{}". '
              "Reason: {}".format(self.path, e)
          )
  
file_path: elegy/elegy/callbacks/model_checkpoint.py
imports: import logging
  import numpy
  from .callback import Callback
label_desc: Use image node_id 7 for calling the ModelCheckpoint obj's underlying member method code with example usage: obj._get_file_path(epoch, logs) and returns: self