Python Package A to Z

(Incomplete) Python Package A to Z

In this article, I will highlight some useful packages for ML/AI practitioners from A to Z. It is also a useful starting point for Python programmer learners to sharpen their practical skills after learning the language itself.

Read more…

How to write reusable (but not usable) code

How to write reusable (but not usable) code

Python is an easy and powerful language for machine learning practitioner like me. A good style makes the code easy to read and reuse. A lengthy one comes from Google. Here, I want to share with you some tips to create troubles when others want to use your code.

Actually, I want you to avoid them.

To keep things tight, a short list followed by detailed examples in below.

  • Write out-dated (and misleading) comment
  • Mix controllable parameter and hard-coded parameters
  • Save parameters in configuration file and never share it
  • Access variables, functions, classes via string in the name of dynamic
  • Give the same name to similar (but different) functions
  • Mis-spell function name

    Read more…

PocketFlow unofficial guide

PocketFlow unofficial guide

PocketFlow is a model compression framework open-sourced by Tencent. After a close look, I find it should be a fairly handy tool. However, there are three caveats:

  1. The [tutorial] is not very helpful if you want to build your own model;
  2. The repo is not actively maintained (sadly to see no support from Tencent);
  3. There are some problems with TF versions.

I am trying to address the above problems, and in the article, I am trying to provide a userful guidance to compress your own model.

Read more…

TensorFlow Lite Conversion

TF Lite Conversion Comparison

This page provide a guidance of using TFLite to convert and deploy models.

We use LeNet-like CNN model on MNIST dataset. The workflow is general, however the performance of TF Lite model (compression, accuracy) would be different based your models and datasets.

Read more…