Skip to content

Commit 5f35a12

Browse files
authored
release 0.0.6 (#46)
* update docs due to text example; cleanup code * version up to 0.0.6
1 parent cf9a24e commit 5f35a12

File tree

6 files changed

+37
-17
lines changed

6 files changed

+37
-17
lines changed

darkon/gradcam/gradcam.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def gradcam(self, sess, input_data, target_index=None, feed_options=dict()):
171171
return ret
172172

173173
@staticmethod
174-
def candidate_featuremap_op_names(sess, graph=None, feed_options=dict()):
174+
def candidate_featuremap_op_names(sess, graph=None, feed_options=None):
175175
""" Returns the list of candidates for operation names of CNN feature map layer
176176
177177
Parameters
@@ -189,10 +189,11 @@ def candidate_featuremap_op_names(sess, graph=None, feed_options=dict()):
189189
190190
"""
191191
graph = graph if graph is not None else tf.get_default_graph()
192+
feed_options = feed_options if feed_options is not None else {}
192193
return candidate_featuremap_op_names(sess, graph, feed_options)
193194

194195
@staticmethod
195-
def candidate_predict_op_names(sess, num_classes, graph=None, feed_options=dict()):
196+
def candidate_predict_op_names(sess, num_classes, graph=None, feed_options=None):
196197
""" Returns the list of candidate for operation names of prediction layer
197198
198199
Parameters
@@ -212,6 +213,7 @@ def candidate_predict_op_names(sess, num_classes, graph=None, feed_options=dict(
212213
213214
"""
214215
graph = graph if graph is not None else tf.get_default_graph()
216+
feed_options = feed_options if feed_options is not None else {}
215217
return candidate_predict_op_names(sess, num_classes, graph, feed_options)
216218

217219
@staticmethod

darkon/influence/influence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def _get_inverse_hvp_lissa(self, sess, test_grad_loss):
306306
print_iter = ihvp_config['recursion_depth'] / 10
307307

308308
inverse_hvp = None
309-
for sample_idx in range(ihvp_config['num_repeats']):
309+
for _ in range(ihvp_config['num_repeats']):
310310
cur_estimate = test_grad_loss
311311
# debug_diffs_estimation = []
312312
# prev_estimation_norm = np.linalg.norm(np.concatenate([a.reshape(-1) for a in cur_estimate]))

docs/src/example.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ All of examples in `here`_
99

1010
darkon.Influence
1111
----------------
12-
Used Cifar-10, ResNet
12+
Cifar-10, ResNet
1313

1414
- `Upweighting Influence`_
15-
1615
- `Mislabel detection with all of layers`_
17-
1816
- `Mislabel detection with one top layer`_
1917

2018
.. _`Upweighting Influence`: http://nbviewer.jupyter.org/github/darkonhub/darkon-examples/blob/master/cifar10-resnet/influence_cifar10_resnet.ipynb
@@ -25,8 +23,15 @@ Used Cifar-10, ResNet
2523

2624
darkon.Gradcam
2725
--------------
28-
Used ImageNet, ResNet
26+
ImageNet, ResNet
27+
28+
- `Gradcam & Guided Gradcam for image`_
29+
30+
Sentence polarity dataset, cnn text classification
31+
32+
- `Heatmap for text`_
33+
34+
.. _`Gradcam & Guided Gradcam for image`: http://nbviewer.jupyter.org/github/darkonhub/darkon-examples/blob/master/gradcam/GradcamDemo.ipynb
2935

30-
- `Gradcam & Guided Gradcam`_
36+
.. _`Heatmap for text`: http://nbviewer.jupyter.org/github/darkonhub/darkon-examples/blob/master/gradcam/GradcamDemoSequence.ipynb
3137

32-
.. _`Gradcam & Guided Gradcam`: http://nbviewer.jupyter.org/github/darkonhub/darkon-examples/blob/master/gradcam/GradcamDemo.ipynb

docs/src/version.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Version Link
66
=========== =============================================
77
All History https://github.com/darkonhub/darkon/releases
88
Latest https://github.com/darkonhub/darkon/releases/latest
9+
0.0.6 https://github.com/darkonhub/darkon/releases/tag/v0.0.6
910
0.0.5 https://github.com/darkonhub/darkon/releases/tag/v0.0.5
1011
0.0.4 https://github.com/darkonhub/darkon/releases/tag/v0.0.4
1112
0.0.3 https://github.com/darkonhub/darkon/releases/tag/v0.0.3

download-models.sh

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1+
#!/bin/bash
12
test_model_dir="./test/data"
23

3-
wget http://download.tensorflow.org/models/resnet_v1_50_2016_08_28.tar.gz
4-
wget http://download.tensorflow.org/models/vgg_16_2016_08_28.tar.gz
5-
wget https://raw.githubusercontent.com/darkonhub/darkon-examples/master/gradcam/sequence.tar
6-
74
mkdir -p $test_model_dir
8-
tar -xf resnet_v1_50_2016_08_28.tar.gz -C $test_model_dir
9-
tar -xf vgg_16_2016_08_28.tar.gz -C $test_model_dir
10-
tar -xf sequence.tar -C $test_model_dir
5+
6+
resnet_file="resnet_v1_50_2016_08_28.tar.gz"
7+
if ! [ -f $resnet_file ]; then
8+
wget http://download.tensorflow.org/models/$resnet_file
9+
tar -xf $resnet_file -C $test_model_dir
10+
fi
11+
12+
vgg_file="vgg_16_2016_08_28.tar.gz"
13+
if ! [ -f $vgg_file ]; then
14+
wget http://download.tensorflow.org/models/$vgg_file
15+
tar -xf $vgg_file -C $test_model_dir
16+
fi
17+
18+
text_sequence_file="sequence.tar"
19+
if ! [ -f $text_sequence_file ]; then
20+
wget https://raw.githubusercontent.com/darkonhub/darkon-examples/master/gradcam/$text_sequence_file
21+
tar -xf $text_sequence_file -C $test_model_dir
22+
fi
1123

info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "darkon",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"authors": "Neosapience, Inc.",
55
"github_url": "https://github.com/darkonhub/darkon",
66
"copyright": "<a href='http://www.neosapience.com'>2017 Neosapience, Inc</a>"

0 commit comments

Comments
 (0)