docstr: Configure the model for training.
  
  Parameters
  ----------
  optimizer : str or optimizer object, optional
      Name of optimizer or optimizer object.
  loss : str or objective function, optional
      Name of objective function or objective function itself.
      If 'None', the model will be compiled without any loss function
      and can only be used to predict output.
  metrics : list of metrics, optional
      List of metrics to be evaluated by the model during training
      and testing.
  loss_weights : list or dict, optional
      Optional list or dictionary specifying scalar coefficients(floats)
      to weight the loss contributions of different model outputs.
      The loss value that will be minimized by the model will then be
      the weighted sum of all individual losses. If a list, it is
      expected to have a 1:1 mapping to the model's outputs. If a dict,
      it is expected to map output names (strings) to scalar
      coefficients.
docstr_tok: ["Configure","the","model","for","training",".","Parameters","--","--","--","--","--","optimizer",":","str","or","optimizer","object",",","optional","Name","of","optimizer","or","optimizer","object",".","loss",":","str","or","objective","function",",","optional","Name","of","objective","function","or","objective","function","itself",".","If","'None","'",",","the","model","will","be","compiled","without","any","loss","function","and","can","only","be","used","to","predict","output",".","metrics",":","list","of","metrics",",","optional","List","of","metrics","to","be","evaluated","by","the","model","during","training","and","testing",".","loss_weights",":","list","or","dict",",","optional","Optional","list","or","dictionary","specifying","scalar","coefficients","(","floats",")","to","weight","the","loss","contributions","of","different","model","outputs",".","The","loss","value","that","will","be","minimized","by","the","model","will","then","be","the","weighted","sum","of","all","individual","losses",".","If","a","list",",","it","is","expected","to","have","a","1:1","mapping","to","the","model","'s","outputs",".","If","a","dict",",","it","is","expected","to","map","output","names","(","strings",")","to","scalar","coefficients","."]
code: def compile(
      self, optimizer="adam", loss=None, metrics=None, loss_weights=None
  ):
      """Configure the model for training.
  
      Parameters
      ----------
      optimizer : str or optimizer object, optional
          Name of optimizer or optimizer object.
      loss : str or objective function, optional
          Name of objective function or objective function itself.
          If 'None', the model will be compiled without any loss function
          and can only be used to predict output.
      metrics : list of metrics, optional
          List of metrics to be evaluated by the model during training
          and testing.
      loss_weights : list or dict, optional
          Optional list or dictionary specifying scalar coefficients(floats)
          to weight the loss contributions of different model outputs.
          The loss value that will be minimized by the model will then be
          the weighted sum of all individual losses. If a list, it is
          expected to have a 1:1 mapping to the model's outputs. If a dict,
          it is expected to map output names (strings) to scalar
          coefficients.
  
      """
      self.model.compile(
          optimizer=optimizer,
          loss=loss,
          metrics=metrics,
          loss_weights=loss_weights,
      )
  
file_path: dipy/dipy/nn/cnn_1d_denoising.py
imports: from dipy.utils.optpkg import optional_package
  import numpy
label_desc: Use image node_id 2 for calling the Cnn1DDenoiser obj's underlying member method code with example usage: obj.compile(optimizer, loss, metrics, loss_weights) without return types