docstr: Train the model on train dataset.
  
  The fit method will train the model for a fixed number of epochs
  (iterations) on a dataset. If given data is  4D it will convert
  it into 1D.
  
  Parameters
  ----------
  x : ndarray
      The input data, as an ndarray.
  y : ndarray
      The target data, as an ndarray.
  batch_size : int or None, optional
      Number of samples per batch of computation.
  epochs : int, optional
      The number of epochs.
  verbose : 'auto', 0, 1, or 2, optional
      Verbosity mode. 0 = silent, 1 = progress bar, 2 = one line
      per epoch.
  callbacks : list of keras.callbacks.Callback instances, optional
      List of callbacks to apply during training.
  validation_split : float between 0 and 1, optional
      Fraction of the training data to be used as validation data.
  validation_data : tuple (x_val, y_val) or None, optional
      Data on which to evaluate the loss and any model metrics at
      the end of each epoch.
  shuffle : boolean, optional
      This argument is ignored when x is a generator or an object of
      tf.data.Dataset.
  initial_epoch : int, optional
      Epoch at which to start training.
  steps_per_epoch : int or None, optional
      Total number of steps (batches of samples) before declaring one
      epoch finished and starting the next epoch.
  validation_batch_size : int or None, optional
      Number of samples per validation batch.
  validation_steps : int or None, optional
      Only relevant if validation_data is provided and is a
      tf.data dataset.
  validation_freq : int or list/tuple/set, optional
      Only relevant if validation data is provided. If an integer,
      specifies how many training epochs to run before a new validation
      run is performed. If a list, tuple, or set, specifies the epochs
      on which to run validation.
  max_queue_size : int, optional
      Used for generator or keras.utils.Sequence input only.
  workers : integer, optional
      Used for generator or keras.utils.Sequence input only.
  use_multiprocessing : boolean, optional
      Used for generator or keras.utils.Sequence input only.
  
  Returns
  -------
  hist : object
      A History object. Its History.history attribute is a record of
      training loss values and metrics values at successive epochs.
docstr_tok: ["Train","the","model","on","train","dataset",".","The","fit","method","will","train","the","model","for","a","fixed","number","of","epochs","(","iterations",")","on","a","dataset",".","If","given","data","is","4D","it","will","convert","it","into","1D",".","Parameters","--","--","--","--","--","x",":","ndarray","The","input","data",",","as","an","ndarray",".","y",":","ndarray","The","target","data",",","as","an","ndarray",".","batch_size",":","int","or","None",",","optional","Number","of","samples","per","batch","of","computation",".","epochs",":","int",",","optional","The","number","of","epochs",".","verbose",":","'auto","'",",","0",",","1",",","or","2",",","optional","Verbosity","mode",".","0","=","silent",",","1","=","progress","bar",",","2","=","one","line","per","epoch",".","callbacks",":","list","of","keras.callbacks.Callback","instances",",","optional","List","of","callbacks","to","apply","during","training",".","validation_split",":","float","between","0","and","1",",","optional","Fraction","of","the","training","data","to","be","used","as","validation","data",".","validation_data",":","tuple","(","x_val",",","y_val",")","or","None",",","optional","Data","on","which","to","evaluate","the","loss","and","any","model","metrics","at","the","end","of","each","epoch",".","shuffle",":","boolean",",","optional","This","argument","is","ignored","when","x","is","a","generator","or","an","object","of","tf.data.Dataset",".","initial_epoch",":","int",",","optional","Epoch","at","which","to","start","training",".","steps_per_epoch",":","int","or","None",",","optional","Total","number","of","steps","(","batches","of","samples",")","before","declaring","one","epoch","finished","and","starting","the","next","epoch",".","validation_batch_size",":","int","or","None",",","optional","Number","of","samples","per","validation","batch",".","validation_steps",":","int","or","None",",","optional","Only","relevant","if","validation_data","is","provided","and","is","a","tf.data","dataset",".","validation_freq",":","int","or","list\/tuple\/set",",","optional","Only","relevant","if","validation","data","is","provided",".","If","an","integer",",","specifies","how","many","training","epochs","to","run","before","a","new","validation","run","is","performed",".","If","a","list",",","tuple",",","or","set",",","specifies","the","epochs","on","which","to","run","validation",".","max_queue_size",":","int",",","optional","Used","for","generator","or","keras.utils.Sequence","input","only",".","workers",":","integer",",","optional","Used","for","generator","or","keras.utils.Sequence","input","only",".","use_multiprocessing",":","boolean",",","optional","Used","for","generator","or","keras.utils.Sequence","input","only",".","Returns","--","--","--","-","hist",":","object","A","History","object",".","Its","History.history","attribute","is","a","record","of","training","loss","values","and","metrics","values","at","successive","epochs","."]
code: def fit(
      self,
      x,
      y,
      batch_size=None,
      epochs=1,
      verbose=1,
      callbacks=None,
      validation_split=0.0,
      validation_data=None,
      shuffle=True,
      initial_epoch=0,
      steps_per_epoch=None,
      validation_steps=None,
      validation_batch_size=None,
      validation_freq=1,
      max_queue_size=10,
      workers=1,
      use_multiprocessing=False,
  ):
      """Train the model on train dataset.
  
      The fit method will train the model for a fixed number of epochs
      (iterations) on a dataset. If given data is  4D it will convert
      it into 1D.
  
      Parameters
      ----------
      x : ndarray
          The input data, as an ndarray.
      y : ndarray
          The target data, as an ndarray.
      batch_size : int or None, optional
          Number of samples per batch of computation.
      epochs : int, optional
          The number of epochs.
      verbose : 'auto', 0, 1, or 2, optional
          Verbosity mode. 0 = silent, 1 = progress bar, 2 = one line
          per epoch.
      callbacks : list of keras.callbacks.Callback instances, optional
          List of callbacks to apply during training.
      validation_split : float between 0 and 1, optional
          Fraction of the training data to be used as validation data.
      validation_data : tuple (x_val, y_val) or None, optional
          Data on which to evaluate the loss and any model metrics at
          the end of each epoch.
      shuffle : boolean, optional
          This argument is ignored when x is a generator or an object of
          tf.data.Dataset.
      initial_epoch : int, optional
          Epoch at which to start training.
      steps_per_epoch : int or None, optional
          Total number of steps (batches of samples) before declaring one
          epoch finished and starting the next epoch.
      validation_batch_size : int or None, optional
          Number of samples per validation batch.
      validation_steps : int or None, optional
          Only relevant if validation_data is provided and is a
          tf.data dataset.
      validation_freq : int or list/tuple/set, optional
          Only relevant if validation data is provided. If an integer,
          specifies how many training epochs to run before a new validation
          run is performed. If a list, tuple, or set, specifies the epochs
          on which to run validation.
      max_queue_size : int, optional
          Used for generator or keras.utils.Sequence input only.
      workers : integer, optional
          Used for generator or keras.utils.Sequence input only.
      use_multiprocessing : boolean, optional
          Used for generator or keras.utils.Sequence input only.
  
      Returns
      -------
      hist : object
          A History object. Its History.history attribute is a record of
          training loss values and metrics values at successive epochs.
  
      """
      sz = x.shape
      if len(sz) == 4:
          x = np.reshape(x, (sz[0] * sz[1] * sz[2], sz[3]))
      sz = y.shape
      if len(sz) == 4:
          y = np.reshape(y, (sz[0] * sz[1] * sz[2], sz[3]))
      return self.model.fit(
          x=x,
          y=y,
          batch_size=batch_size,
          epochs=epochs,
          verbose=verbose,
          callbacks=callbacks,
          validation_split=validation_split,
          validation_data=validation_data,
          shuffle=shuffle,
          initial_epoch=initial_epoch,
          steps_per_epoch=steps_per_epoch,
          validation_steps=validation_steps,
          validation_batch_size=validation_batch_size,
          validation_freq=validation_freq,
          max_queue_size=max_queue_size,
          workers=workers,
          use_multiprocessing=use_multiprocessing,
      )
  
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 5 for calling the Cnn1DDenoiser obj's underlying member method code with example usage: obj.fit(x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, initial_epoch, steps_per_epoch, validation_steps, validation_batch_size, validation_freq, max_queue_size, workers, use_multiprocessing) and returns: self