class_docstr: SRM decomposition using a very low amount of memory and computational power thanks to the use of an atlas as described in [Richard2019]_.
  
  Given multi-subject data, factorize it as a shared response S among all subjects and an orthogonal transform (basis) W per subject:
  
  .. math:: X_i \approx W_i S, \forall i=1 \dots N
  
  Parameters
  ----------
  
  atlas :  array, shape=[n_supervoxels, n_voxels] or array,shape=[n_voxels] or str or None, default=None
      Probabilistic or deterministic atlas on which to project the data. Deterministic atlas is an array of shape [n_voxels,] where values range from 1 to n_supervoxels. Voxels labelled 0 will be ignored. If atlas is a str the corresponding array is loaded with numpy.load and expected shape is (n_voxels,) for a deterministic atlas and (n_supervoxels, n_voxels) for a probabilistic atlas.
  
  n_components : int
      Number of timecourses of the shared coordinates
  
  n_iter : int
      Number of iterations to perform
  
  temp_dir : str or None
      Path to dir where temporary results are stored. If None temporary results will be stored in memory. This can results in memory errors when the number of subjects and/or sessions is large
  
  low_ram : bool
      If True and temp_dir is not None, reduced_data will be saved on disk. This increases the number of IO but reduces memory complexity when the number of subject and/or sessions is large
  
  seed : int
      Seed used for random sampling.
  
  n_jobs : int, optional, default=1
      The number of CPUs to use to do the computation. -1 means all CPUs, -2 all CPUs but one, and so on.
  
  verbose : bool or "warn"
      If True, logs are enabled. If False, logs are disabled. If "warn" only warnings are printed.
  
  aggregate: str or None, default="mean"
      If "mean", shared_response is the mean shared response from all subjects. If None, shared_response contains all subject-specific responses in shared space
  
  Attributes
  ----------
  
  `basis_list`: list of array, element i has shape=[n_components, n_voxels] or list of str
      - if basis is a list of array, element i is the basis of subject i
      - if basis is a list of str, element i is the path to the basis of subject i that is loaded with np.load yielding an array of shape [n_components, n_voxels].
  
      Note that any call to the clean method erases this attribute
  
  Note
  -----
  
      **References:**
      H. Richard, L. Martin, A. Pinho, J. Pillow, B. Thirion, 2019: Fast shared response model for fMRI data (https://arxiv.org/pdf/1909.12537.pdf)
docstr: From shared response and basis from training data
  reconstruct subject's data
  
  Parameters
  ----------
  
  shared_response : list of arrays, list of list of arrays or array
      - if imgs is a list of array and self.aggregate="mean": shared response is an array of shape (n_components, n_timeframes)
      - if imgs is a list of array and self.aggregate=None: shared response is a list of array, element i is the projection of data of subject i in shared space.
      - if imgs is an array or a list of list of array and self.aggregate="mean": shared response is a list of array, element j is the shared response during session j
      - if imgs is an array or a list of list of array and self.aggregate=None: shared response is a list of list of array, element i, j is the projection of data of subject i collected during session j in shared space.
  
  subjects_indexes : list or None
      if None reconstructs data of all subjects used during train. Otherwise reconstructs data of subjects specified by subjects_indexes.
  
  sessions_indexes : list or None
      if None reconstructs data of all sessions. Otherwise uses reconstructs data of sessions specified by sessions_indexes.
  
  Returns
  -------
  reconstructed_data: list of list of arrays or list of arrays
      - if reconstructed_data is a list of list : element i, j is the reconstructed data for subject subjects_indexes[i] and session sessions_indexes[j] as an np array of shape n_voxels, n_timeframes
      - if reconstructed_data is a list : element i is the reconstructed data for subject subject_indexes[i] as an np array of shape n_voxels, n_timeframes
docstr_tok: ["From","shared","response","and","basis","from","training","data","reconstruct","subject","'s","data","Parameters","--","--","--","--","--","shared_response",":","list","of","arrays",",","list","of","list","of","arrays","or","array","-","if","imgs","is","a","list","of","array","and","self.aggregate=","''","mean","''",":","shared","response","is","an","array","of","shape","(","n_components",",","n_timeframes",")","-","if","imgs","is","a","list","of","array","and","self.aggregate=None",":","shared","response","is","a","list","of","array",",","element","i","is","the","projection","of","data","of","subject","i","in","shared","space",".","-","if","imgs","is","an","array","or","a","list","of","list","of","array","and","self.aggregate=","''","mean","''",":","shared","response","is","a","list","of","array",",","element","j","is","the","shared","response","during","session","j","-","if","imgs","is","an","array","or","a","list","of","list","of","array","and","self.aggregate=None",":","shared","response","is","a","list","of","list","of","array",",","element","i",",","j","is","the","projection","of","data","of","subject","i","collected","during","session","j","in","shared","space",".","subjects_indexes",":","list","or","None","if","None","reconstructs","data","of","all","subjects","used","during","train",".","Otherwise","reconstructs","data","of","subjects","specified","by","subjects_indexes",".","sessions_indexes",":","list","or","None","if","None","reconstructs","data","of","all","sessions",".","Otherwise","uses","reconstructs","data","of","sessions","specified","by","sessions_indexes",".","Returns","--","--","--","-","reconstructed_data",":","list","of","list","of","arrays","or","list","of","arrays","-","if","reconstructed_data","is","a","list","of","list",":","element","i",",","j","is","the","reconstructed","data","for","subject","subjects_indexes","[","i","]","and","session","sessions_indexes","[","j","]","as","an","np","array","of","shape","n_voxels",",","n_timeframes","-","if","reconstructed_data","is","a","list",":","element","i","is","the","reconstructed","data","for","subject","subject_indexes","[","i","]","as","an","np","array","of","shape","n_voxels",",","n_timeframes"]
code: def inverse_transform(
      self,
      shared_response,
      subjects_indexes=None,
      sessions_indexes=None,
  ):
      """From shared response and basis from training data
          reconstruct subject's data
  
          Parameters
          ----------
  
          shared_response : list of arrays, list of list of arrays or array
              - if imgs is a list of array and self.aggregate="mean": shared \
  response is an array of shape (n_components, n_timeframes)
              - if imgs is a list of array and self.aggregate=None: shared \
  response is a list of array, element i is the projection of data of \
  subject i in shared space.
              - if imgs is an array or a list of list of array and \
  self.aggregate="mean": shared response is a list of array, \
  element j is the shared response during session j
              - if imgs is an array or a list of list of array and \
  self.aggregate=None: shared response is a list of list of array, \
  element i, j is the projection of data of subject i collected \
  during session j in shared space.
  
          subjects_indexes : list or None
              if None reconstructs data of all subjects used during train. \
  Otherwise reconstructs data of subjects specified by subjects_indexes.
  
          sessions_indexes : list or None
              if None reconstructs data of all sessions. \
  Otherwise uses reconstructs data of sessions specified by sessions_indexes.
  
          Returns
          -------
          reconstructed_data: list of list of arrays or list of arrays
              - if reconstructed_data is a list of list : element i, j is \
  the reconstructed data for subject subjects_indexes[i] and \
  session sessions_indexes[j] as an np array of shape n_voxels, \
  n_timeframes
              - if reconstructed_data is a list : element i is the \
  reconstructed data for subject \
  subject_indexes[i] as an np array of shape n_voxels, n_timeframes
  
          """
      added_session, shared = check_shared_response(
          shared_response,
          self.aggregate,
          n_components=self.n_components,
      )
      n_subjects = len(self.basis_list)
      n_sessions = len(shared)
  
      for j in range(n_sessions):
          assert_array_2axis(shared[j], "shared_response[%i]" % j)
  
      check_indexes(subjects_indexes, "subjects_indexes")
      check_indexes(sessions_indexes, "sessions_indexes")
  
      if subjects_indexes is None:
          subjects_indexes = np.arange(n_subjects)
      else:
          subjects_indexes = np.array(subjects_indexes)
  
      assert_valid_index(
          subjects_indexes, n_subjects, "subjects_indexes"
      )
  
      if sessions_indexes is None:
          sessions_indexes = np.arange(len(shared))
      else:
          sessions_indexes = np.array(sessions_indexes)
  
      assert_valid_index(
          sessions_indexes, n_sessions, "sessions_indexes"
      )
  
      data = []
      for i in subjects_indexes:
          data_ = []
          basis_i = safe_load(self.basis_list[i])
          if added_session:
              data.append(basis_i.T.dot(shared[0]))
          else:
              for j in sessions_indexes:
                  data_.append(basis_i.T.dot(shared[j]))
              data.append(data_)
      return data
  
imports: import hashlib
  import logging
  import os
  import numpy
  import scipy
  from joblib import Parallel, delayed
  from brainiak.funcalign.srm import DetSRM
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.exceptions import NotFittedError
  import uuid
label_desc: Use image node_id 6 for calling the FastSRM obj's underlying member method code with example usage: obj.inverse_transform(shared_response, subjects_indexes, sessions_indexes) and returns: data