
from .base import *

from .gradient_based import *
from .misc import *
from .pattern_based import *
from .relevance_based import *


def create_explainer(name,
                     output_layer, patterns=None, to_layer=None, **kwargs):
    return {
        # Utility.
        "input": InputExplainer,
        "random": RandomExplainer,

        # Gradient based
        "gradient": GradientExplainer,
        "deconvnet": DeConvNetExplainer,
        "guided": GuidedBackpropExplainer,
        "gradient.alt": AlternativeGradientExplainer,

        # Relevance based
        "lrp.z": LRPZExplainer,
        "lrp.eps": LRPEpsExplainer,

        # Pattern based
        "patternnet": PatternNetExplainer,
        "patternnet.guided": GuidedPatternNetExplainer,
        "patternlrp": PatternLRPExplainer,
    }[name](output_layer, patterns=patterns, to_layer=to_layer, **kwargs)


from .base import *

from .gradient_based import *
from .misc import *
from .pattern_based import *
from .relevance_based import *


def create_explainer(name,
                     output_layer, patterns=None, **kwargs):
    return {
        # Utility.
        "input": InputExplainer,
        "random": RandomExplainer,

        # Gradient based
        "gradient": GradientExplainer,
        "deconvnet": DeConvNetExplainer,
        "guided": GuidedBackpropExplainer,
        "gradient.alt": AlternativeGradientExplainer,

        # Relevance based
        "lrp.z": LRPZExplainer,
        "lrp.eps": LRPEpsExplainer,

        # Pattern based
        "patternnet": PatternNetExplainer,
        "patternnet.guided": GuidedPatternNetExplainer,
        "patternlrp": PatternLRPExplainer,
    }[name](output_layer, patterns=patterns, **kwargs)

Fix interface. to_layer parameter is obsolete.
Fix interface. to_layer parameter is obsolete.

  
  from .base import *
  
  from .gradient_based import *
  from .misc import *
  from .pattern_based import *
  from .relevance_based import *
  
  
  def create_explainer(name,
-                      output_layer, patterns=None, to_layer=None, **kwargs):
+                      output_layer, patterns=None, **kwargs):
      return {
          # Utility.
          "input": InputExplainer,
          "random": RandomExplainer,
  
          # Gradient based
          "gradient": GradientExplainer,
          "deconvnet": DeConvNetExplainer,
          "guided": GuidedBackpropExplainer,
          "gradient.alt": AlternativeGradientExplainer,
  
          # Relevance based
          "lrp.z": LRPZExplainer,
          "lrp.eps": LRPEpsExplainer,
  
          # Pattern based
          "patternnet": PatternNetExplainer,
          "patternnet.guided": GuidedPatternNetExplainer,
          "patternlrp": PatternLRPExplainer,
-     }[name](output_layer, patterns=patterns, to_layer=to_layer, **kwargs)
+     }[name](output_layer, patterns=patterns, **kwargs)
  
Fix interface. to_layer parameter is obsolete.
## Code Before:

from .base import *

from .gradient_based import *
from .misc import *
from .pattern_based import *
from .relevance_based import *


def create_explainer(name,
                     output_layer, patterns=None, to_layer=None, **kwargs):
    return {
        # Utility.
        "input": InputExplainer,
        "random": RandomExplainer,

        # Gradient based
        "gradient": GradientExplainer,
        "deconvnet": DeConvNetExplainer,
        "guided": GuidedBackpropExplainer,
        "gradient.alt": AlternativeGradientExplainer,

        # Relevance based
        "lrp.z": LRPZExplainer,
        "lrp.eps": LRPEpsExplainer,

        # Pattern based
        "patternnet": PatternNetExplainer,
        "patternnet.guided": GuidedPatternNetExplainer,
        "patternlrp": PatternLRPExplainer,
    }[name](output_layer, patterns=patterns, to_layer=to_layer, **kwargs)

## Instruction:
Fix interface. to_layer parameter is obsolete.
## Code After:

from .base import *

from .gradient_based import *
from .misc import *
from .pattern_based import *
from .relevance_based import *


def create_explainer(name,
                     output_layer, patterns=None, **kwargs):
    return {
        # Utility.
        "input": InputExplainer,
        "random": RandomExplainer,

        # Gradient based
        "gradient": GradientExplainer,
        "deconvnet": DeConvNetExplainer,
        "guided": GuidedBackpropExplainer,
        "gradient.alt": AlternativeGradientExplainer,

        # Relevance based
        "lrp.z": LRPZExplainer,
        "lrp.eps": LRPEpsExplainer,

        # Pattern based
        "patternnet": PatternNetExplainer,
        "patternnet.guided": GuidedPatternNetExplainer,
        "patternlrp": PatternLRPExplainer,
    }[name](output_layer, patterns=patterns, **kwargs)
