diff --git a/tutorials/interpret/normlime.py b/tutorials/interpret/normlime.py index afb063043d2851dd36c011eb9d87da58ceebfa6d..305a3fa72ef9eb7351a81e4c5bbdf9effbf5102d 100644 --- a/tutorials/interpret/normlime.py +++ b/tutorials/interpret/normlime.py @@ -29,18 +29,11 @@ import numpy as np np.random.seed(5) perm = np.random.permutation(len(test_dataset.file_list)) -for i in range(len(test_dataset.file_list)): - - # 可解释性可视化 - pdx.interpret.normlime( - test_dataset.file_list[perm[i]][0], - model, - test_dataset, - save_dir='./', - normlime_weights_file='{}_{}.npy'.format( - dataset.split('/')[-1], model.model_name)) - - if i == 1: - # first iter will have an initialization process, followed by the interpretation. - # second iter will directly load the initialization process, followed by the interpretation. - break +# 可解释性可视化 +pdx.interpret.normlime( + test_dataset.file_list[0][0], + model, + test_dataset, + save_dir='./', + normlime_weights_file='{}_{}.npy'.format( + dataset.split('/')[-1], model.model_name))