Implementing Beam Search - Part 1

Photo Credit As hinted in the previous post “Building a Summary System in Minutes”, I’ll try do some source code analysis of OpenNMT-py project in this post. I’d like to start with its Beam Search implementation. It is widely used in seq2seq models, but I haven’t yet had a good grasp on its details. The translator/predictor of OpenNMT-py is also one of the most powerful I’ve seen, coming with a wide range of parameters and options. ...

November 5, 2018 · Ceshine Lee

Use Visual Studio Code To Develop Python Programs

Photo Credit Joel Grus offered his critique of Jupyter Notebook in a recent talk. I think most of his points are valid and recommend you to read the slides or watch the talk. However, one thing that caught my attention is Mr. Grus’s Python IDE(Visual Studio Code). It looks so good that I decided to give it a try, which led to this blog post. (I Don’t Like Notebooks - Joel Grus - #JupyterCon 2018) ...

September 25, 2018 · Ceshine Lee

Feature Importance Measures for Tree Models — Part I

Photo Credit 2018–02–20 Update: Adds two images (random forest and gradient boosting). 2019–05–25 Update: I’ve published a post covering another importance measure — SHAP values — on my personal blog and on Medium. This post is inspired by a Kaggle kernel and its discussions [1]. I’d like to do a brief review of common algorithms to measure feature importance with tree-based models. We can interpret the results to check intuition(no surprisingly important features), do feature selection, and guide the direction of feature engineering. ...

October 28, 2017 · Ceshine Lee

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

(Reminder: The SSD paper and the Pytorch implementation used in this post. Also, the first and second part of the series.) Training Objective / Loss Function Every deep learning / neural network needs a differentiable objective function to learn from. After pairing ground truths and default boxes, and marking the remaining default boxes as background, we’re ready to formulate the objective function of SSD: Overall Objective — Formula (1) from the original paper ...

July 27, 2017 · Ceshine Lee

[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