mlpack-testing

Logo

mlpack features I am working on.

View the Project on GitHub iamshnoo/mlpack-testing

Spatial Dropout

Contains all the work done on the Spatial Dropout layer.

#2564

Blog post

Comparing regular Dropout with Spatial Dropout.

What’s in this folder

  1. Spatial_Dropout Visualisation.ipynb - to recreate the visuals in blog post 1.
  2. Spatial_Dropout_demo.ipynb - comparison between PyTorch/numpy and mlpack/armadillo implementations of the layer.
  3. test.cpp - The final implementation chosen where the layer is created as a wrapper of the BatchNorm class.

How to run

To run the .cpp file, you need to have armadillo and mlpack installed in your system.

g++ -std=c++11 -stdlib=libc++ test.cpp -o test -larmadillo -lmlpack && ./test

To run Spatial_Dropout Visualisation.ipynb, you would need pytorch, matplotlib, seaborn, numpy python libraries.

To run Spatial_Dropout_demo.ipynb, you would need pytorch, numpy and armadillo. To avoid issues with linking the libraries correctly, it is better to run the notebook in Google Colab.