docstr: Selects the checkpoints with the best metric values.
  The weights are the softmax of the metric values, i.e.,
  w_i = exp(v_i) / sum(exp(v_j)) if maximize=True
  w_i = exp(-v_i) / sum(exp(-v_j)) if maximize=False
  
  Parameters
  ----------
  checkpoints
      List of checkpoint information dictionaries.
  Returns
  -------
      List of selected checkpoint paths and list of corresponding
      weights.
docstr_tok: ["Selects","the","checkpoints","with","the","best","metric","values",".","The","weights","are","the","softmax","of","the","metric","values",",","i.e.",",","w_i","=","exp","(","v_i",")","\/","sum","(","exp","(","v_j",")",")","if","maximize=True","w_i","=","exp","(","-v_i",")","\/","sum","(","exp","(","-v_j",")",")","if","maximize=False","Parameters","--","--","--","--","--","checkpoints","List","of","checkpoint","information","dictionaries",".","Returns","--","--","--","-","List","of","selected","checkpoint","paths","and","list","of","corresponding","weights","."]
code: def select_checkpoints(
      self, checkpoints: List[Dict]
  ) -> Tuple[List[str], List[float]]:
      r"""
      Selects the checkpoints with the best metric values.
      The weights are the softmax of the metric values, i.e.,
      w_i = exp(v_i) / sum(exp(v_j)) if maximize=True
      w_i = exp(-v_i) / sum(exp(-v_j)) if maximize=False
  
      Parameters
      ----------
      checkpoints
          List of checkpoint information dictionaries.
      Returns
      -------
          List of selected checkpoint paths and list of corresponding
          weights.
      """
  
      metric_path_tuple = [
          (c[self.metric], c["params_path"]) for c in checkpoints
      ]
      top_checkpoints = sorted(
          metric_path_tuple, reverse=self.maximize
      )[: self.num_models]
  
      # weights of top checkpoints
      weights = [
          np.exp(c[0]) if self.maximize else np.exp(-c[0])
          for c in top_checkpoints
      ]
      weights = [x / sum(weights) for x in weights]
  
      # paths of top checkpoints
      checkpoint_paths = [c[1] for c in top_checkpoints]
  
      return checkpoint_paths, weights
  
imports: import glob
  import json
  import logging
  from typing import Dict, List, Tuple
  import mxnet
  import mxnet.gluon.nn
  import numpy
  from gluonts.core.component import validated
  from .callback import Callback
label_desc: Use image node_id 1 for calling the SelectNBestSoftmax obj's underlying member method code with example usage: obj.select_checkpoints(checkpoints) and returns: checkpoint_paths,  weights