# Multidimensional indexing with tensorflow

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:

• tf.while_loop
• tf.gather_nd

I will conclude that tf.gather_nd is much more effective than tf.while_loop.

numpy indexing

# Classification with Mahalanobis distance + full covariance using tensorflow

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.

# Calculate Mahalanobis distance with tensorflow 2.0

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

# Learn the Carlini and Wagner's adversarial attack - MNIST 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".

# Grad-CAM with keras-vis

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.

# Visualization of deep learning classification model using keras-vis

In the next few blog posts, I will review visualization techiniques.

## 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==3.3.0.10
\$CONDA_PREFIX/bin/jupyter notebook --no-browser``````

# Part 5 Object Detection using YOLOv2 on Pascal VOC2012 - training

This is the fifth blog post of Object Detection with YOLO blog series. This blog finally train the model using the scripts that are developed in the previous blog posts. I will use PASCAL VOC2012 data. This blog assumes that the readers have read the previous blog posts - Part 1