Exemplo n.º 1
0
    def configure(self, view_model):
        # type: (BalloonModelAdapterModel) -> None
        """
        Store the input shape to be later used to estimate memory usage. Also
        create the algorithm instance.
        """
        self.input_time_series_index = self.load_entity_by_gid(
            view_model.time_series)
        self.input_shape = (self.input_time_series_index.data_length_1d,
                            self.input_time_series_index.data_length_2d,
                            self.input_time_series_index.data_length_3d,
                            self.input_time_series_index.data_length_4d)

        self.log.debug("time_series shape is %s" % str(self.input_shape))
        # -------------------- Fill Algorithm for Analysis -------------------##
        algorithm = BalloonModel()

        if view_model.dt is not None:
            algorithm.dt = view_model.dt
        else:
            algorithm.dt = self.input_time_series_index.sample_period / 1000.

        if view_model.tau_s is not None:
            algorithm.tau_s = view_model.tau_s
        if view_model.tau_f is not None:
            algorithm.tau_f = view_model.tau_f
        if view_model.bold_model is not None:
            algorithm.bold_model = view_model.bold_model
        if view_model.RBM is not None:
            algorithm.RBM = view_model.RBM
        if view_model.neural_input_transformation is not None:
            algorithm.neural_input_transformation = view_model.neural_input_transformation

        self.algorithm = algorithm
Exemplo n.º 2
0
    def configure(self, time_series, dt=None, bold_model=None, RBM=None, neural_input_transformation=None):
        """
        Store the input shape to be later used to estimate memory usage. Also
        create the algorithm instance.
        """
        self.input_time_series_index = time_series
        self.input_shape = (self.input_time_series_index.data_length_1d,
                            self.input_time_series_index.data_length_2d,
                            self.input_time_series_index.data_length_3d,
                            self.input_time_series_index.data_length_4d)

        LOG.debug("time_series shape is %s" % str(self.input_shape))
        # -------------------- Fill Algorithm for Analysis -------------------##
        algorithm = BalloonModel()

        if dt is not None:
            algorithm.dt = dt
        else:
            algorithm.dt = time_series.sample_period / 1000.

        if bold_model is not None:
            algorithm.bold_model = bold_model
        if RBM is not None:
            algorithm.RBM = RBM
        if neural_input_transformation is not None:
            algorithm.neural_input_transformation = neural_input_transformation

        self.algorithm = algorithm
Exemplo n.º 3
0
    def configure(self,
                  time_series,
                  dt=None,
                  bold_model=None,
                  RBM=None,
                  neural_input_transformation=None):
        """
        Store the input shape to be later used to estimate memory usage. Also
        create the algorithm instance.
        """
        self.input_shape = time_series.read_data_shape()
        log_debug_array(LOG, time_series, "time_series")

        ##-------------------- Fill Algorithm for Analysis -------------------##
        algorithm = BalloonModel()

        if dt is not None:
            algorithm.dt = dt
        else:
            algorithm.dt = time_series.sample_period / 1000.

        if bold_model is not None:
            algorithm.bold_model = bold_model
        if RBM is not None:
            algorithm.RBM = RBM
        if neural_input_transformation is not None:
            algorithm.neural_input_transformation = neural_input_transformation

        self.algorithm = algorithm
        self.algorithm.time_series = time_series
    def configure(self, time_series, dt=None, bold_model=None, RBM=None, neural_input_transformation=None):
        """
        Store the input shape to be later used to estimate memory usage. Also
        create the algorithm instance.
        """
        self.input_shape = time_series.read_data_shape()
        log_debug_array(LOG, time_series, "time_series")
        
        ##-------------------- Fill Algorithm for Analysis -------------------##
        algorithm = BalloonModel()
        
        if dt is not None:
            algorithm.dt = dt
        else:
            algorithm.dt = time_series.sample_period / 1000.

        if bold_model is not None:
            algorithm.bold_model = bold_model
        if RBM is not None:
            algorithm.RBM = RBM
        if neural_input_transformation is not None:
            algorithm.neural_input_transformation = neural_input_transformation
        
        self.algorithm = algorithm
        self.algorithm.time_series = time_series
Exemplo n.º 5
0
 def get_input_tree(self):
     """
     Return a list of lists describing the interface to the analyzer. This
     is used by the GUI to generate the menus and fields necessary for
     defining current analysis.
     """
     algorithm = BalloonModel()
     algorithm.trait.bound = self.INTERFACE_ATTRIBUTES_ONLY
     tree = algorithm.interface[self.INTERFACE_ATTRIBUTES]
     for node in tree:
         if node['name'] == 'time_series':
             node['conditions'] = FilterChain(fields=[FilterChain.datatype + '._nr_dimensions'],
                                              operations=["=="], values=[4])
     return tree
Exemplo n.º 6
0
 def get_traited_datatype(self):
     return BalloonModel()