/Optimized-Sentiment-Classification-using-Numpy

A highly optimized version of Andrew Trask's Sentiment Classification from Deep Learning ND on Udacity

Primary LanguageJupyter Notebook

Optimized Sentiment Classification using Numpy

A highly optimized version of Andrew Trask's Sentiment Classification from Deep Learning ND on Udacity


I have taken Andrew Trask's notebook on Sentiment Classification and have tried to hyper optimize a number of routines following a set of two rules,

  1. Use vectorization as much as possible
  2. Avoid loops at all costs


To search for the optimizations directly, do a Ctrl+F and look for the My Implementation tag.


You would use such techniques in writing production ready code in Python. My optimizations are on an average 25% faster than the default solution, with over 250% (2.5x!) performance gain in a few places.


~2.5x performance improvement!


PS - I think Andrew Trask didn't use the complicated expressions in order to keep the whole tutorial beginner friendly - Kudos to him!