featuremapper/__init__.py
def _collate_results(self, p):
        """
        Collate responses into the results dictionary containing a
        ProjectionGrid for each measurement source.
        """
        results = Layout()

        timestamp = self.metadata.timestamp
        dimensions = [features.Time, features.Duration]
        pattern_dimensions = self.outer + self.inner
        pattern_dim_label = '_'.join(f.name.capitalize() for f in pattern_dimensions)

        grids, responses = {}, {}
        for labels in self.measurement_product:
            in_label, out_label, duration = labels
            input_metadata = self.metadata.inputs[in_label]
            output_metadata = self.metadata.outputs[out_label]
            rows, cols, scs = self._compute_roi(p, output_metadata)
            time_key = (timestamp, duration)

            grid_key = (in_label, out_label)
            if grid_key not in grids:
                if p.store_responses:
                    responses[in_label] = self._responses[in_label]
                    responses[out_label] = self._responses[out_label]
                grids[grid_key] = GridSpace(group='RFs', label=out_label)
            view = grids[grid_key]
            rc_response = self._featureresponses[in_label][out_label][duration]
            for i, ii in enumerate(rows):
                for j, jj in enumerate(cols):
                    coord = scs.matrixidx2sheet(ii, jj)
                    im = Image(rc_response[i, j], bounds=input_metadata['bounds'],
                               label=out_label, group='Receptive Field',
                               vdims=['Weight'])
                    im.metadata = AttrDict(timestamp=timestamp)

                    if coord in view:
                        view[coord][time_key] = im
                    else:
                        view[coord] = HoloMap((time_key, im), kdims=dimensions,
                                              label=out_label, group='Receptive Field')
                    view[coord].metadata = AttrDict(**input_metadata)
        for (in_label, out_label), view in grids.items():
            results.set_path(('%s_Reverse_Correlation' % in_label, out_label), view)
            if p.store_responses:
                info = (p.pattern_generator.__class__.__name__,
                        pattern_dim_label, 'Response')
                results.set_path(('%s_%s_%s' % info, in_label),
                                 responses[in_label])
                results.set_path(('%s_%s_%s' % info, out_label),
                                 responses[out_label])
        return results

        Collate responses into the results dictionary containing a
        ProjectionGrid for each measurement source.
        
Collate responses into the results dictionary containing a
ProjectionGrid for each measurement source.
Collate responses into the results dictionary containing a ProjectionGrid for each measurement source .
def _collate_results(self, p):
        results = Layout()
        timestamp = self.metadata.timestamp
        dimensions = [features.Time, features.Duration]
        pattern_dimensions = self.outer + self.inner
        pattern_dim_label = '_'.join(f.name.capitalize() for f in pattern_dimensions)
        grids, responses = {}, {}
        for labels in self.measurement_product:
            in_label, out_label, duration = labels
            input_metadata = self.metadata.inputs[in_label]
            output_metadata = self.metadata.outputs[out_label]
            rows, cols, scs = self._compute_roi(p, output_metadata)
            time_key = (timestamp, duration)
            grid_key = (in_label, out_label)
            if grid_key not in grids:
                if p.store_responses:
                    responses[in_label] = self._responses[in_label]
                    responses[out_label] = self._responses[out_label]
                grids[grid_key] = GridSpace(group='RFs', label=out_label)
            view = grids[grid_key]
            rc_response = self._featureresponses[in_label][out_label][duration]
            for i, ii in enumerate(rows):
                for j, jj in enumerate(cols):
                    coord = scs.matrixidx2sheet(ii, jj)
                    im = Image(rc_response[i, j], bounds=input_metadata['bounds'],
                               label=out_label, group='Receptive Field',
                               vdims=['Weight'])
                    im.metadata = AttrDict(timestamp=timestamp)
                    if coord in view:
                        view[coord][time_key] = im
                    else:
                        view[coord] = HoloMap((time_key, im), kdims=dimensions,
                                              label=out_label, group='Receptive Field')
                    view[coord].metadata = AttrDict(**input_metadata)
        for (in_label, out_label), view in grids.items():
            results.set_path(('%s_Reverse_Correlation' % in_label, out_label), view)
            if p.store_responses:
                info = (p.pattern_generator.__class__.__name__,
                        pattern_dim_label, 'Response')
                results.set_path(('%s_%s_%s' % info, in_label),
                                 responses[in_label])
                results.set_path(('%s_%s_%s' % info, out_label),
                                 responses[out_label])
        return results
def _collate_results ( self , p ) : results = Layout ( ) timestamp = self . metadata . timestamp dimensions = [ features . Time , features . Duration ] pattern_dimensions = self . outer + self . inner pattern_dim_label = '_' . join ( f . name . capitalize ( ) for f in pattern_dimensions ) grids , responses = { } , { } for labels in self . measurement_product : in_label , out_label , duration = labels input_metadata = self . metadata . inputs [ in_label ] output_metadata = self . metadata . outputs [ out_label ] rows , cols , scs = self . _compute_roi ( p , output_metadata ) time_key = ( timestamp , duration ) grid_key = ( in_label , out_label ) if grid_key not in grids : if p . store_responses : responses [ in_label ] = self . _responses [ in_label ] responses [ out_label ] = self . _responses [ out_label ] grids [ grid_key ] = GridSpace ( group = 'RFs' , label = out_label ) view = grids [ grid_key ] rc_response = self . _featureresponses [ in_label ] [ out_label ] [ duration ] for i , ii in enumerate ( rows ) : for j , jj in enumerate ( cols ) : coord = scs . matrixidx2sheet ( ii , jj ) im = Image ( rc_response [ i , j ] , bounds = input_metadata [ 'bounds' ] , label = out_label , group = 'Receptive Field' , vdims = [ 'Weight' ] ) im . metadata = AttrDict ( timestamp = timestamp ) if coord in view : view [ coord ] [ time_key ] = im else : view [ coord ] = HoloMap ( ( time_key , im ) , kdims = dimensions , label = out_label , group = 'Receptive Field' ) view [ coord ] . metadata = AttrDict ( ** input_metadata ) for ( in_label , out_label ) , view in grids . items ( ) : results . set_path ( ( '%s_Reverse_Correlation' % in_label , out_label ) , view ) if p . store_responses : info = ( p . pattern_generator . __class__ . __name__ , pattern_dim_label , 'Response' ) results . set_path ( ( '%s_%s_%s' % info , in_label ) , responses [ in_label ] ) results . set_path ( ( '%s_%s_%s' % info , out_label ) , responses [ out_label ] ) return results
Collate responses into the results dictionary containing a
ProjectionGrid for each measurement source.
Collate responses into the results dictionary containing a ProjectionGrid for each measurement source .
"""
        Collate responses into the results dictionary containing a
        ProjectionGrid for each measurement source.
        """
self
p