In this blog post, I present how to use multi-dimensional index arrays for indexing tensors.
First, I will show multi-dimensional array indexing with numpy. Then I will show two approaches in tensorflow:
I will conclude that tf.gather_nd is much more effective than tf.while_loop.
This blog discusses how to calculate Mahalanobis distance using tensorflow. I will consider full variance approach, i.e., each cluster has its own general covariance matrix, so I do not assume common variance accross clusters unlike the previous post. Calculation of Mahalanobis distance is important for classification when each cluster has different covariance structure. Let's take a lookt at this situation using toy data.
I noticed that tensorflow does not have functions to compute Mahalanobis distance between two groups of samples. So here I go and provide the code with explanation. The blog is organized and explain the following topics
- Euclidean distance with Scipy
- Euclidean distance with Tensorflow v2
- Mahalanobis distance with Scipy
- Mahalanobis distance with Tensorflow v2
Deep neural networks (DNN) have become increasingly effective at many difficult machine-learning tasks. However, DNNs are vulnerable to adversarial examples that are maliciously made to misguide the DNN's performance. The vulnerability may make it difficult to apply the DNNs to security sensitive usecases. In this blog, we learn one of the most successful adversarial attack proposed in the paper "Toward Evaluating the Robustness of Neural Network".
Gradient Class Activation Map (Grad-CAM) for a particular category indicates the discriminative image regions used by the CNN to identify that category.
The goal of this blog is to:
- understand concept of Grad-CAM
- understand Grad-CAM is generalization of CAM
- understand how to use it using keras-vis
- implement it using Keras's backend functions.
Image Specific Class Saliency Visualization allows better understanding of why a model makes a classification decision. The goal of this blog is to understand its concept and how to interpret the Saliency Map.
- Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps
Reference in this blog¶
In the next few blog posts, I will review visualization techiniques.
Image Specific Visualization¶
Create condo environment¶
conda create -n explainableAI python=3.5 source activate explainableAI conda install tensorflow conda install keras conda install jupyter pip install git+https://github.com/raghakot/keras-vis.git --upgrade --no-deps pip install opencv-python==126.96.36.199 $CONDA_PREFIX/bin/jupyter notebook --no-browser
Download a json file containing ImageNet class names.¶
This is the seventh and final blog post of Object Detection with YOLO blog series. This blog performs inference using the model in trained in Part 5 Object Detection with Yolo using VOC 2012 data - training. I will use PASCAL VOC2012 data. This blog assumes that the readers have read the previous blog posts - Part 1
This is the sixth blog post of Object Detection with YOLO blog series. This blog performs inference using the model in trained in Part 5 Object Detection with Yolo using VOC 2012 data - training. I will use PASCAL VOC2012 data. This blog assumes that the readers have read the previous blog posts - Part 1