class_docstr: Best model selection strategy.
  
  :param dump_file: Specifies the file path to dump the policy state for the best reward.
  :param model: The model to be dumped.
  :param dump_interval: Update count interval between regularly dumping the model parameters.
  :param verbose: If true status messages get printed to the command line.
class_docstr_tok: ["Best","model","selection","strategy",".",":","param","dump_file",":","Specifies","the","file","path","to","dump","the","policy","state","for","the","best","reward",".",":","param","model",":","The","model","to","be","dumped",".",":","param","dump_interval",":","Update","count","interval","between","regularly","dumping","the","model","parameters",".",":","param","verbose",":","If","true","status","messages","get","printed","to","the","command","line","."]
code: def __init__(
      self,
      dump_file: Optional[str],
      model: Optional[TorchModel],
      dump_interval: Optional[int] = None,
      verbose: bool = False,
  ):
      self.dump_file = dump_file
      self.model = model
      self.dump_interval = dump_interval
      self.verbose = verbose
  
      self.last_improvement = 0
      self.best_reward = -np.inf
      self.best_state_dict = None
      self.update_count = 0
  
file_path: maze/maze/train/trainers/common/model_selection/best_model_selection.py
imports: import os
  from typing import Optional
  import numpy
  import torch
  from maze.core.agent.torch_model import TorchModel
  from maze.core.annotations import override
  from maze.train.trainers.common.model_selection.model_selection_base import ModelSelectionBase
  from maze.utils.bcolors import BColors
label_desc: Use image node_id 1 to create a new BestModelSelection object from inherited base classes: ModelSelectionBase with example: obj = BestModelSelection(dump_file, model, dump_interval, verbose)