def test_precommit__BaseReverseNetwork_reverse_check_minmax(): def method(model): return Gradient(model, reverse_verbose=True, reverse_check_min_max_values=True) dryrun.test_analyzer(method, "mnist.*")
def test_fast__BaseReverseNetwork_reverse_check_minmax(): def method(model): return Gradient(model, reverse_verbose=True, reverse_check_min_max_values=True) dryrun.test_analyzer(method, "trivia.*:mnist.log_reg")
def test_imagenet__PatternAttribution(): def method(model): # enough for test purposes, only pattern application is tested here # pattern computation is tested separately. # assume that one dim weights are biases, drop them. patterns = [x for x in model.get_weights() if len(x.shape) > 1] return PatternAttribution(model, patterns=patterns) dryrun.test_analyzer(method, "imagenet.vgg16:imagenet.vgg19")
def test_fast__PatternNet(): def method(model): # enough for test purposes, only pattern application is tested here # pattern computation is tested separately. # assume that one dim weights are biases, drop them. patterns = [x for x in model.get_weights() if len(x.shape) > 1] return PatternNet(model, patterns=patterns) dryrun.test_analyzer(method, "mnist.log_reg")
def test_fast__AnalyzerNetworkBase_neuron_selection_index(): class CustomAnalyzer(Gradient): def analyze(self, X): index = 0 return super(CustomAnalyzer, self).analyze(X, index) def method(model): return CustomAnalyzer(model, neuron_selection_mode="index") dryrun.test_analyzer(method, "trivia.*:mnist.log_reg")
def test_precommit__AnalyzerNetworkBase_neuron_selection_index(): class CustomAnalyzer(Gradient): def analyze(self, X): index = 3 return super(CustomAnalyzer, self).analyze(X, index) def method(model): return CustomAnalyzer(model, neuron_selection_mode="index") dryrun.test_analyzer(method, "mnist.*")
def test_fast__DryRunAnalyzerTestCase(): """ Sanity test for the TestCase. """ def method(output_layer): class TestAnalyzer(object): def analyze(self, X): return X return TestAnalyzer() dryrun.test_analyzer(method, "trivia.*:mnist.log_reg")
def test_precommit__Gradient(): def method(model): return Gradient(model) dryrun.test_analyzer(method, "mnist.*")
def test_imagenet__Gradient(): def method(model): return Gradient(model) dryrun.test_analyzer(method, "imagenet.*")
def test_precommit__BaselineGradient_pp_square(): def method(model): return BaselineGradient(model, postprocess="square") dryrun.test_analyzer(method, "mnist.*")
def test_fast__Gradient(): def method(model): return Gradient(model) dryrun.test_analyzer(method, "trivia.*:mnist.log_reg")
def test_imagenet__SmoothGrad(): def method(model): return SmoothGrad(model, augment_by_n=2) dryrun.test_analyzer(method, "imagenet.*")
def test_fast__BaselineGradient_pp_square(): def method(model): return BaselineGradient(model, postprocess="square") dryrun.test_analyzer(method, "trivia.*:mnist.log_reg")
def test_precommit__BoundedDeepTaylor(): def method(model): return BoundedDeepTaylor(model, low=-1, high=1) dryrun.test_analyzer(method, "mnist.*")
def test_fast__GuidedBackprop(): def method(model): return GuidedBackprop(model) dryrun.test_analyzer(method, "trivia.*:mnist.log_reg")
def test_fast__DeepTaylor(): def method(model): return DeepTaylor(model) dryrun.test_analyzer(method, "trivia.*:mnist.log_reg")
def test_imagenet__DeepTaylor(): def method(model): return DeepTaylor(model) dryrun.test_analyzer(method, "imagenet.*")
def test_fast__IntegratedGradients(): def method(model): return IntegratedGradients(model) dryrun.test_analyzer(method, "trivia.*:mnist.log_reg")
def test_imagenet__GuidedBackprop(): def method(model): return GuidedBackprop(model) dryrun.test_analyzer(method, "imagenet.*")
def test_precommit__GuidedBackprop(): def method(model): return GuidedBackprop(model) dryrun.test_analyzer(method, "mnist.*")
def test_precommit__Gradient_pp_None(): def method(model): return Gradient(model, postprocess=None) dryrun.test_analyzer(method, "mnist.*")
def test_precommit__Deconvnet(): def method(model): return Deconvnet(model) dryrun.test_analyzer(method, "mnist.*")
def test_precommit__IntegratedGradients(): def method(model): return IntegratedGradients(model) dryrun.test_analyzer(method, "mnist.*")
def test_imagenet__Deconvnet(): def method(model): return Deconvnet(model) dryrun.test_analyzer(method, "imagenet.*")
def test_precommit__DeepTaylor(): def method(model): return DeepTaylor(model) dryrun.test_analyzer(method, "mnist.*")
def test_imagenet__IntegratedGradients(): def method(model): return IntegratedGradients(model, steps=2) dryrun.test_analyzer(method, "imagenet.*")
def test_fast__BoundedDeepTaylor(): def method(model): return BoundedDeepTaylor(model, low=-1, high=1) dryrun.test_analyzer(method, "trivia.*:mnist.log_reg")
def test_fast__SmoothGrad(): def method(model): return SmoothGrad(model) dryrun.test_analyzer(method, "trivia.*:mnist.log_reg")
def test_imagenet__BoundedDeepTaylor(): def method(model): return BoundedDeepTaylor(model, low=-1, high=1) dryrun.test_analyzer(method, "imagenet.*")
def test_precommit__SmoothGrad(): def method(model): return SmoothGrad(model) dryrun.test_analyzer(method, "mnist.*")