d9aec7b8c8424e4392320358dfd30b25b13f992a,innvestigate/tools/perturbate.py,Perturbation,compute_perturbation_mask,#Any#Any#,68

Before Change


    @staticmethod
    def compute_perturbation_mask(aggregated_regions, ratio):
        // Get indices and values
        thresholds = np.percentile(aggregated_regions, math.ceil(100.0 * (1.0 - ratio)), axis=(1, 2, 3), keepdims=True)
        perturbation_mask_regions = aggregated_regions >= thresholds

        return perturbation_mask_regions

    def expand_regions_to_pixels(self, regions):

After Change


    @staticmethod
    def compute_perturbation_mask(aggregated_regions, num_perturbated_regions):
        // 0 means highest scoring region
        order = np.argsort(-aggregated_regions.reshape((*aggregated_regions.shape[:2], -1)), axis=-1)
        ranks = order.argsort().reshape(aggregated_regions.shape)
        perturbation_mask_regions = ranks <= num_perturbated_regions - 1
        return perturbation_mask_regions

    def expand_regions_to_pixels(self, regions):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: albermax/innvestigate
Commit Name: d9aec7b8c8424e4392320358dfd30b25b13f992a
Time: 2018-10-21
Author: philipp.seegerer@tu-berlin.de
File Name: innvestigate/tools/perturbate.py
Class Name: Perturbation
Method Name: compute_perturbation_mask


Project Name: albermax/innvestigate
Commit Name: 2b42c95e4fa7c4d4e61cdf4f64655efb7667b757
Time: 2018-10-11
Author: philipp.seegerer@tu-berlin.de
File Name: innvestigate/tools/perturbate.py
Class Name: Perturbation
Method Name: compute_perturbation_mask


Project Name: idaholab/raven
Commit Name: b9aceef70e8f8f2de03f5052dae272c8c2422113
Time: 2020-10-09
Author: Jia.Zhou@inl.gov
File Name: framework/PostProcessors/BasicStatistics.py
Class Name: BasicStatistics
Method Name: _computeWeightedPercentile