Skip to content

Commit

Permalink
release 0.0.6 (#46)
Browse files Browse the repository at this point in the history
* update docs due to text example; cleanup code
* version up to 0.0.6
  • Loading branch information
zironycho committed Jan 19, 2018
1 parent cf9a24e commit 5f35a12
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
6 changes: 4 additions & 2 deletions darkon/gradcam/gradcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def gradcam(self, sess, input_data, target_index=None, feed_options=dict()):
return ret

@staticmethod
def candidate_featuremap_op_names(sess, graph=None, feed_options=dict()):
def candidate_featuremap_op_names(sess, graph=None, feed_options=None):
""" Returns the list of candidates for operation names of CNN feature map layer
Parameters
Expand All @@ -189,10 +189,11 @@ def candidate_featuremap_op_names(sess, graph=None, feed_options=dict()):
"""
graph = graph if graph is not None else tf.get_default_graph()
feed_options = feed_options if feed_options is not None else {}
return candidate_featuremap_op_names(sess, graph, feed_options)

@staticmethod
def candidate_predict_op_names(sess, num_classes, graph=None, feed_options=dict()):
def candidate_predict_op_names(sess, num_classes, graph=None, feed_options=None):
""" Returns the list of candidate for operation names of prediction layer
Parameters
Expand All @@ -212,6 +213,7 @@ def candidate_predict_op_names(sess, num_classes, graph=None, feed_options=dict(
"""
graph = graph if graph is not None else tf.get_default_graph()
feed_options = feed_options if feed_options is not None else {}
return candidate_predict_op_names(sess, num_classes, graph, feed_options)

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion darkon/influence/influence.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def _get_inverse_hvp_lissa(self, sess, test_grad_loss):
print_iter = ihvp_config['recursion_depth'] / 10

inverse_hvp = None
for sample_idx in range(ihvp_config['num_repeats']):
for _ in range(ihvp_config['num_repeats']):
cur_estimate = test_grad_loss
# debug_diffs_estimation = []
# prev_estimation_norm = np.linalg.norm(np.concatenate([a.reshape(-1) for a in cur_estimate]))
Expand Down
17 changes: 11 additions & 6 deletions docs/src/example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ All of examples in `here`_

darkon.Influence
----------------
Used Cifar-10, ResNet
Cifar-10, ResNet

- `Upweighting Influence`_

- `Mislabel detection with all of layers`_

- `Mislabel detection with one top layer`_

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

darkon.Gradcam
--------------
Used ImageNet, ResNet
ImageNet, ResNet

- `Gradcam & Guided Gradcam for image`_

Sentence polarity dataset, cnn text classification

- `Heatmap for text`_

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

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

.. _`Gradcam & Guided Gradcam`: http://nbviewer.jupyter.org/github/darkonhub/darkon-examples/blob/master/gradcam/GradcamDemo.ipynb
1 change: 1 addition & 0 deletions docs/src/version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Version Link
=========== =============================================
All History https://github.com/darkonhub/darkon/releases
Latest https://github.com/darkonhub/darkon/releases/latest
0.0.6 https://github.com/darkonhub/darkon/releases/tag/v0.0.6
0.0.5 https://github.com/darkonhub/darkon/releases/tag/v0.0.5
0.0.4 https://github.com/darkonhub/darkon/releases/tag/v0.0.4
0.0.3 https://github.com/darkonhub/darkon/releases/tag/v0.0.3
Expand Down
26 changes: 19 additions & 7 deletions download-models.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
#!/bin/bash
test_model_dir="./test/data"

wget http://download.tensorflow.org/models/resnet_v1_50_2016_08_28.tar.gz
wget http://download.tensorflow.org/models/vgg_16_2016_08_28.tar.gz
wget https://raw.githubusercontent.com/darkonhub/darkon-examples/master/gradcam/sequence.tar

mkdir -p $test_model_dir
tar -xf resnet_v1_50_2016_08_28.tar.gz -C $test_model_dir
tar -xf vgg_16_2016_08_28.tar.gz -C $test_model_dir
tar -xf sequence.tar -C $test_model_dir

resnet_file="resnet_v1_50_2016_08_28.tar.gz"
if ! [ -f $resnet_file ]; then
wget http://download.tensorflow.org/models/$resnet_file
tar -xf $resnet_file -C $test_model_dir
fi

vgg_file="vgg_16_2016_08_28.tar.gz"
if ! [ -f $vgg_file ]; then
wget http://download.tensorflow.org/models/$vgg_file
tar -xf $vgg_file -C $test_model_dir
fi

text_sequence_file="sequence.tar"
if ! [ -f $text_sequence_file ]; then
wget https://raw.githubusercontent.com/darkonhub/darkon-examples/master/gradcam/$text_sequence_file
tar -xf $text_sequence_file -C $test_model_dir
fi

2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "darkon",
"version": "0.0.5",
"version": "0.0.6",
"authors": "Neosapience, Inc.",
"github_url": "https://github.com/darkonhub/darkon",
"copyright": "<a href='http://www.neosapience.com'>2017 Neosapience, Inc</a>"
Expand Down

0 comments on commit 5f35a12

Please sign in to comment.