From b4eaa7a709c75ad4547ab54c13cb53134f9d966e Mon Sep 17 00:00:00 2001 From: seven Date: Wed, 3 Jun 2020 16:31:09 +0800 Subject: [PATCH] tutorial: interpret one image --- tutorials/interpret/normlime.py | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/tutorials/interpret/normlime.py b/tutorials/interpret/normlime.py index afb0630..305a3fa 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)) -- GitLab