Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyhealth/interpret/methods/baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class RandomBaseline(BaseInterpreter):
Examples:
>>> import torch
>>> from pyhealth.datasets import create_sample_dataset, get_dataloader
>>> from pyhealth.interpret.methods.baseline import Random
>>> from pyhealth.interpret.methods import RandomBaseline
>>> from pyhealth.models import MLP
>>>
>>> samples = [
Expand All @@ -64,7 +64,7 @@ class RandomBaseline(BaseInterpreter):
>>> model.eval()
>>> test_loader = get_dataloader(dataset, batch_size=1, shuffle=False)
>>>
>>> rand_interp = Random(model, random_seed=42)
>>> rand_interp = RandomBaseline(model, random_seed=42)
>>> batch = next(iter(test_loader))
>>> attributions = rand_interp.attribute(**batch)
>>> print({k: v.shape for k, v in attributions.items()})
Expand Down
4 changes: 2 additions & 2 deletions pyhealth/interpret/methods/ensemble_crh.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class CrhEnsemble(BaseInterpreterEnsemble):
between successive iterations is below this value.

Example:
>>> from pyhealth.interpret.methods import GradientShap, IntegratedGradients, Saliency
>>> experts = [GradientShap(model), IntegratedGradients(model), Saliency(model)]
>>> from pyhealth.interpret.methods import DeepLift, IntegratedGradients, LimeExplainer
>>> experts = [IntegratedGradients(model), DeepLift(model), LimeExplainer(model)]
>>> ensemble = CrhEnsemble(model, experts, n_iter=30)
>>> attrs = ensemble.attribute(**batch)
"""
Expand Down
Loading