[Learning Note] Single Shot MultiBox Detector with Pytorch — Part 2

In the previous post we discussed the network structure and the prediction scheme of SSD. Now we move on to combine default boxes and the ground truth, so the quality of the prediction can be determined (and be improved via training). (Reminder: The SSD paper and the Pytorch implementation used in this post) Map Default Boxes to Coordinates On Input Images Parameters of default boxes for each feature map are pre-calculated and hard-coded in data/config.py: ...

July 26, 2017 · Ceshine Lee

[Learning Note] Single Shot MultiBox Detector with PyTorch — Part 1

Recently I’m trying to pick up PyTorch as well as some object detection deep learning algorithms. So to kill two birds with one stone, I decided to read the Single Shot MultiBox Detector paper along with one of the PyTorch implementation written by Max deGroot. Admittedly, I have some trouble understanding some ideas in the paper. After reading the implementation and scratching my head for a while, I think I figured out at least some parts of them. So the following is my notes on some confusing concept after my first and second pass of reading. ...

July 24, 2017 · Ceshine Lee

The Power of PyPy

PyPy is an alternative Python implementation which emphasize on speed and memory usage. I didn’t take it seriously until I wrote a Python script for a kaggle competition that requires hours to run. I read someone on the kaggle forum suggesting everyone to give PyPy a try. I did. And it worked like a magic. A 2 to 5 times speed boost can be achieved just by substituting python with pypy when you run a python script. Don’t have a accurate number for that, but it was significantly faster. This is critical because now you have more time to try different models and hence get a better score in the competition. ...

November 29, 2014 · Ceshine Lee

Tip for using iPython Notebooks in virtualenv

When trying to install ipython and dependencies of its notebook feature via pip, I was stuck. Even I’d already installed pyzmq, I still got this message: ImportError: IPython.zmq requires pyzmq It was quite frustrating, until I found this post on StackOverflow. So it turns out this can be solved by just install pyzmq using an extra parameter: pip install pyzmq --install-option="--zmq=bundled"

April 29, 2014 · Ceshine Lee

Shortcuts for some common statistical functions

Here are some useful functions when performing statistical analysis: Confidence Interval from scipy import stats from numpy import mean, var from math import sqrt sample = [1, 2, 3, 4, 5] #95% confidence interval R = stats.t.interval(0.95, len(sample)-1, loc=mean(sample), scale=sqrt(var(sample)/len(sample))) >>> R (1.2440219338298311, 4.7559780661701687) SciPy documentation Correlation Coefficient from numpy import corrcoef x = [1, 2, 3, 4, 100] y = [6, 7, 8, 9, 10] r = corrcoef(x, y) >>> r array([[ 1., 0.72499943], [ 0.72499943, 1.]]) SciPy documentation Linear Regression from scipy import stats x = [1, 2, 3, 4, 5] y = [6, 7, 8, 9, 10] slope, intercept, r_value, p_value, std_err = stats.linregress(x,y) >>> slope, intercept (1.0, 5.0) SciPy documentation

February 25, 2014 · Ceshine Lee