original_docstring: 
      Normalises cache across dimensions 0 and 1 so they fall
      into [-1,+1] range. Normalises train and test using the
      train data range only.
      Expected input has dimension 0 and 1 as augmentation and image index.
      Each dimension 2 is a different feature.
      
docstring: Normalises cache across dimensions 0 and 1 so they fall
  into [-1,+1] range. Normalises train and test using the
  train data range only.
  Expected input has dimension 0 and 1 as augmentation and image index.
  Each dimension 2 is a different feature.
docstring_tokens: Normalises cache across dimensions 0 and 1 so they fall into [ - 1 + 1 ] range . Normalises train and test using the train data range only . Expected input has dimension 0 and 1 as augmentation and image index . Each dimension 2 is a different feature .
code: def normalise_cache_range(X_train, X_test=None):
      """
      Normalises cache across dimensions 0 and 1 so they fall
      into [-1,+1] range. Normalises train and test using the
      train data range only.
      Expected input has dimension 0 and 1 as augmentation and image index.
      Each dimension 2 is a different feature.
      """
      # Get the dim0 and dim1 absolute maxima
      X_max = np.amax(np.absolute(X_train.reshape((X_train.shape[0]*X_train.shape[1],X_train.shape[2]))),0)
      # Normalise both arrays
      X_train = X_train / X_max
      if X_test is not None:
          X_test  = X_test / X_max
      
      return X_train, X_test
code_tokens: def normalise_cache_range ( X_train , X_test = None ) : X_max = np . amax ( np . absolute ( X_train . reshape ( ( X_train . shape [ 0 ] * X_train . shape [ 1 ] , X_train . shape [ 2 ] ) ) ) , 0 ) X_train = X_train / X_max if X_test is not None : X_test = X_test / X_max return X_train , X_test
short_docstring: Normalises cache across dimensions 0 and 1 so they fall
  into [-1,+1] range.
short_docstring_tokens: Normalises cache across dimensions 0 and 1 so they fall into [ - 1 + 1 ] range .
comment: """
      Normalises cache across dimensions 0 and 1 so they fall
      into [-1,+1] range. Normalises train and test using the
      train data range only.
      Expected input has dimension 0 and 1 as augmentation and image index.
      Each dimension 2 is a different feature.
      """$SEP$# Get the dim0 and dim1 absolute maxima$SEP$# Normalise both arrays