Lei Mao bio photo

Lei Mao

Machine Learning, Artificial Intelligence, Computer Science.

Twitter Facebook LinkedIn GitHub   G. Scholar E-Mail RSS

Blog

2020

CMake: Public VS Private VS Interface

Posted: August 8, 2020 Updated: August 9, 2020

CMake Include and Link Keywords from the Perspective of Inheritance

Encrypted Credentials for Docker Login

Posted: August 6, 2020 Updated: August 6, 2020

Safe Docker Login

C/C++ Documentation Using Sphinx

Posted: August 5, 2020 Updated: August 5, 2020

Create Documentations for C/C++ Development Using Sphinx

C/C++ Documentation Using Doxygen

Posted: August 4, 2020 Updated: August 4, 2020

Create Documentations for C/C++ Development Using Doxygen

Python Documentation Using Sphinx

Posted: August 2, 2020 Updated: August 2, 2020

Fill a Key Missing Piece in Python Development

Simon's Algorithm

Posted: July 26, 2020 Updated: August 7, 2020

Our First Quantum Computing Algorithm that Requires Running Multiple Times

Cross Entropy Loss VS Log Loss VS Sum of Log Loss

Posted: July 18, 2020 Updated: July 18, 2020

Conventional Classification Loss Functions Elucidated

Control Python AsyncIO Coroutine Interactively

Posted: July 15, 2020 Updated: July 15, 2020

A Python Multithread Trick

Multiprocessing VS Threading VS AsyncIO in Python

Posted: July 11, 2020 Updated: July 11, 2020

Understand Python Concurrency from High-Level

Parallel Gzip - Pigz

Posted: July 8, 2020 Updated: July 8, 2020

Make Compression and Decompression Faster

Deutsch-Jozsa Algorithm

Posted: July 3, 2020 Updated: August 7, 2020

An Extended Quantum Computing Algorithm Based on the Deutsch Algorithm

Running X Client Using Virtual X Server Xvfb

Posted: July 1, 2020 Updated: July 1, 2020

A Convenient Virtual Display Tool

Fixing Language Display Problems in Ubuntu Games

Posted: June 28, 2020 Updated: June 28, 2020

Taking "The Escapists 2" as an Example

Population Based Training

Posted: June 28, 2020 Updated: June 28, 2020

Model Optimization with Genetically Evolved Hyperparameters

Deutsch's Algorithm

Posted: June 23, 2020 Updated: June 23, 2020

The Simplest Quantum Computing Algorithm

No-Cloning Theorem

Posted: June 19, 2020 Updated: June 19, 2020

No Copying in Quantum World

Quantum Bit and Bloch Sphere

Posted: June 14, 2020 Updated: June 14, 2020

Understand the Bloch Sphere Representation of Qubit

Kronecker Product In Circuits

Posted: June 10, 2020 Updated: June 10, 2020

Application of Kronecker Product to Circuits

Almost Commutative Kronecker Product

Posted: June 7, 2020 Updated: June 7, 2020

Some Fun Math for Kronecker Product

VS Code Development Using Docker Containers on Remote Host

Posted: June 6, 2020 Updated: June 6, 2020

Protocols for Developing Programs on Remote Host

Quantum System States

Posted: June 1, 2020 Updated: June 1, 2020

Mathematical Explanation to Quantum System States

Progress Bars for Python Multiprocessing Tasks

Posted: May 31, 2020 Updated: May 31, 2020

Use tqdm for Python Multiprocessing

Matter Cannot Travel Faster Than Light

Posted: May 11, 2020 Updated: May 11, 2020

Mathematical Explanation to the Speed Limit of Matter Traveling

Quantum Entanglement

Posted: May 10, 2020 Updated: May 10, 2020

Mathematical Explanation to Quantum Entanglement

Heisenberg's Uncertainty Principle

Posted: May 4, 2020 Updated: May 4, 2020

We Can't Have Everything We Want

Expected Value and Variance from the Perspective of Quantum Theory

Posted: May 2, 2020 Updated: May 2, 2020

Quantum Theory Justifies Observations

PyTorch Distributed Training

Posted: April 26, 2020 Updated: August 3, 2020

PyTorch Distributed Training for Dummies

Kill PyTorch Distributed Training Processes

Posted: April 25, 2020 Updated: April 25, 2020

Fully Release the Resource Used in PyTorch Distributed Training

Ownership Inheritance for Docker Generated Files

Posted: April 17, 2020 Updated: April 17, 2020

Resolve Permission Issues for Files Generated in Docker Containers

Inner Product and Inner Product Space

Posted: April 8, 2020 Updated: April 8, 2020

Resolve an Inner Product Definition Discrepancy

Complex Number Representations

Posted: April 1, 2020 Updated: April 1, 2020

A Quick Refreshment on Complex Number Algebra

Mass-Energy Equivalence Derivation

Posted: March 28, 2020 Updated: March 28, 2020

The Derivation of Einstein's Most Famous Equation

C++ Iterator

Posted: March 15, 2020 Updated: March 15, 2020

Iterator for Generic Programming

C++ Nested Class

Posted: March 14, 2020 Updated: March 14, 2020

Get Familiar with C++ Nested Classes

Gated Linear Units (GLU) and Gated CNN

Posted: March 9, 2020 Updated: March 9, 2020

Gated Linear Units and Gated CNN Explained

C++ Const Overloading

Posted: March 8, 2020 Updated: March 8, 2020

Use C++ Const Overloading When Necessary

Evolved Transformer Explained

Posted: March 7, 2020 Updated: March 7, 2020

Evolution Search on Transformer Neural Network Architectures

C++ Explicit Constructor

Posted: March 5, 2020 Updated: March 5, 2020

Use C++ Explicit Constructor to Remove Initialization Ambiguity

C++ Casts

Posted: March 4, 2020 Updated: March 4, 2020

Use C++ Casts Correctly

C/C++ Array Size

Posted: March 2, 2020 Updated: March 2, 2020

Understand sizeof Operator

Dummy Pharmaceutical Economics

Posted: March 1, 2020 Updated: August 7, 2020

Dummy Models to Describe Healthcare Prices

Relativistic Momentum and Relativistic Mass

Posted: February 28, 2020 Updated: February 28, 2020

It is All About Definition and Conservation

Relativistic Velocity Transformation

Posted: February 25, 2020 Updated: February 25, 2020

A Natural Extension from Lorentz Transformation

lvalue VS rvalue, rvalue Reference, and Move Semantics in C++

Posted: February 23, 2020 Updated: February 23, 2020

Purpose and Motivations of lvalue and rvalue Concepts and Usages in C++

C++ Closure

Posted: February 19, 2020 Updated: February 19, 2020

Resolve Some Ambiguity on C++ Lambda Expression

Lorentz Transformation Derivation

Posted: February 16, 2020 Updated: February 16, 2020

Foundations to Special Relativity

C++ HashMaps

Posted: February 15, 2020 Updated: February 15, 2020

std::unordered_map and std::unordered_set

C++ Lambda Expressions

Posted: February 14, 2020 Updated: February 14, 2020

Understand C++ Lambda Expressions

Group Lasso

Posted: February 13, 2020 Updated: February 13, 2020

Understand the Sparsity Introduced by Group Lasso

C++ Function Template

Posted: February 12, 2020 Updated: February 12, 2020

Understand C++ Function Template

C++ General-Purpose Polymorphic Function Wrapper

Posted: February 11, 2020 Updated: February 11, 2020

Understand C++ std::function

C++ Function Object

Posted: February 10, 2020 Updated: February 10, 2020

Understand C++ Functor

C/C++ Function Pointer

Posted: February 9, 2020 Updated: February 9, 2020

Understand C/C++ Function Pointer

Special Relativity Explained

Posted: February 8, 2020 Updated: February 8, 2020

A Refreshment for Special Relativity

Inline Specifier Compilation in C/C++

Posted: February 5, 2020 Updated: February 5, 2020

Some Caveats for Compilation with Inline Specifier

CUDA Stream

Posted: February 2, 2020 Updated: February 2, 2020

Understand CUDA Stream Based Concurrency from High Level

C++ Polymorphisms

Posted: January 30, 2020 Updated: January 30, 2020

Understand C++ Polymorphisms Thoroughly

Debug C/C++ Programs in Docker Container

Posted: January 11, 2020 Updated: January 11, 2020

Moving Works to Docker Container

Save, Load and Inference From TensorFlow 2.x Frozen Graph

Posted: January 9, 2020 Updated: January 9, 2020

Continuing to Support Frozen Graph for TensorFlow 2.x

Simple Proof to the Container With Most Water Problem

Posted: January 4, 2020 Updated: January 4, 2020

A Proof to Gut Feelings

C++ Offline Documentation

Posted: January 1, 2020 Updated: January 1, 2020

Programming Without Using Internet

2019

Use noexcept for Exception Handling in C++ Programs

Posted: December 31, 2019 Updated: December 31, 2019

Understand Why We Would Use noexcept Sometimes

Exception Handling in C++ Programs

Posted: December 30, 2019 Updated: December 30, 2019

Some C++ Exception and Error Basics

Use constexpr to Accelerate C++ Programs

Posted: December 24, 2019 Updated: December 24, 2019

Create Compile-Time Constants

Parsing Argument Using Getopt in C/C++

Posted: December 24, 2019 Updated: December 24, 2019

A Survey for C/C++ Argument Parsers

Binary VS Text Mode for File I/O Operations

Posted: December 22, 2019 Updated: December 22, 2019

Some Fundamental Concepts for Reading and Writing Files

Docker Building Arguments

Posted: December 20, 2019 Updated: December 19, 2019

Its Conveniences and Caveats

Python-Like Dictionary in C++

Posted: December 17, 2019 Updated: December 17, 2019

Employ the Convenience of std::any from C++ Standard 17

FFmpeg Video Processing and Conversion

Posted: December 16, 2019 Updated: December 16, 2019

A Quick Start Guide for Non-Professional Usages

Solving TensorFlow cuDNN Initialization Failure Problem

Posted: December 13, 2019 Updated: December 13, 2019

Solutions for TensorFlow 1.x and 2.x

Correlation VS Causation

Posted: November 28, 2019 Updated: November 28, 2019

A Simple Example Reveals a Lot of Flaws in Current Researches

Bilingual Evaluation Understudy (BLEU)

Posted: November 17, 2019 Updated: November 17, 2019

Elucidating the Machine Translation BLEU Scoring Mechanism

Public-Key Cryptosystems and Digital Signatures

Posted: November 6, 2019 Updated: November 6, 2019

Unveil Modern Cryptosystems Using Simple Math

Number of Alignments in Connectionist Temporal Classification (CTC)

Posted: November 2, 2019 Updated: November 2, 2019

A Fun Statistical Combination Counting Problem

Fixing a Bad PC Power Button Problem

Posted: October 27, 2019 Updated: October 27, 2019

An Electric Engineering Experiment from Noobs

Python String Format

Posted: October 26, 2019 Updated: October 26, 2019

Printing Beautiful Python Strings to Console for Machine Learning and Data Science

Reasons Not to Study Life Science or Anything Related

Posted: October 19, 2019 Updated: October 19, 2019

What's Wrong with Life Science?

Setting Locale in Docker

Posted: October 2, 2019 Updated: October 2, 2019

Resolve Some UTF-8 Issues in Docker Container

Git Branch Upstream

Posted: October 1, 2019 Updated: October 1, 2019

Understand the Difference Between `git push` and `git push -u`

Tmux Tutorial

Posted: September 22, 2019 Updated: September 22, 2019

Setting Up Tmux for Daily Usages

Introduction to Dirichlet Distribution

Posted: September 10, 2019 Updated: September 10, 2019

Mathematical Foundations to Dirichlet Distribution

TensorFlow Inference for Estimator

Posted: August 29, 2019 Updated: August 29, 2019

Guidance for Fast TensorFlow Inference

Gnome Terminator

Posted: August 27, 2019 Updated: August 27, 2019

Setting Up the Local Multi-Window Terminal Emulator

Ubuntu Fan Throttling Noise Removal

Posted: August 18, 2019 Updated: August 18, 2019

Kill the Weird Noise from PC Case

Fcitx Chinese Input Setup on Ubuntu for Gaming

Posted: August 15, 2019 Updated: August 15, 2019

Supporting Chinese Inputs in Ubuntu Gaming

Label Smoothing

Posted: August 11, 2019 Updated: August 10, 2019

Regularization for Classification Models

Cross Entropy, KL Divergence, and Maximum Likelihood Estimation

Posted: August 10, 2019 Updated: August 10, 2019

Some Theories to Machine Learning Optimization

Ubuntu Gaming Guide

Posted: August 7, 2019 Updated: February 23, 2020

Ubuntu Now Has Become the Best OS for Both Development and Gaming

Google Cloud Kubernetes Tutorial

Posted: August 6, 2019 Updated: August 6, 2019

Deploying Containerized Applications on Google Cloud

Matthews Correlation Coefficient

Posted: August 4, 2019 Updated: June 14, 2019

An Archaeological Investigation on Matthews Correlation Coefficient

Git Submodule Tutorial

Posted: July 30, 2019 Updated: December 15, 2019

Playing with Sumodules on Git

Ubuntu 18.04 Dock Disappearance Fix

Posted: July 28, 2019 Updated: July 28, 2019

A Temporarily Workaround Without Rebooting the Computer

Git Large File Storage Tutorial

Posted: July 22, 2019 Updated: July 22, 2019

Playing with Large Files on Git

Byte Pair Encoding

Posted: July 19, 2019 Updated: July 19, 2019

Common Tokenization Method for Natural Language Processing

Entropy, Perplexity and Its Applications

Posted: July 17, 2019 Updated: July 17, 2019

Foundations of Information Theory to Machine Learning

Format Python Code Using YAPF

Posted: July 16, 2019 Updated: November 22, 2019

YAPF Quick Tutorial

Installing Cisco Anyconnect VPN Client on Ubuntu

Posted: July 10, 2019 Updated: June 6, 2020

Make VPN a Friend to Linux

PyTorch Model Export to ONNX Failed Due to ATen

Posted: July 3, 2019 Updated: July 3, 2019

A Funny Story About PyTorch, ATen, and ONNX

gRPC Tutorial

Posted: June 22, 2019 Updated: June 22, 2019

State-of-the-Art High Performance Remote Procedure Call Using C++ and CMake

Creating Custom Images on Google Cloud

Posted: June 20, 2019 Updated: June 20, 2019

Accelerate Configurations for VM Instance

Introduction to Exponential Family

Posted: June 14, 2019 Updated: June 14, 2019

Setting Up Foundations to Variational Inference

Understand Proportional Symbol in Probability and Statistics

Posted: June 13, 2019 Updated: June 13, 2019

Some Math Conventions in Probability and Statistics

Installing TensorRT Python Components

Posted: June 11, 2019 Updated: June 11, 2019

Fill Some TensorRT Installation Holes

Conjugate Priors

Posted: June 10, 2019 Updated: September 12, 2019

Some Statistics Knowledge to Bayesian Inference

Google Protocol Buffer Tutorial

Posted: June 5, 2019 Updated: June 6, 2019

Modern Structured Data Serialization and a Stepping Stone to gRPC

Dropout Explained

Posted: June 4, 2019 Updated: June 4, 2019

The Math of Dropout You Know and Don't Know About

Transformer Explained in One Single Page

Posted: June 1, 2019 Updated: June 1, 2019

Attention is All You Need Mathematically

Layer Normalization Explained

Posted: May 31, 2019 Updated: May 31, 2019

Layer Normalization vs Batch Normalization vs Instance Normalization

Build CMake with SSL Support

Posted: May 30, 2019 Updated: May 30, 2019

Allow CMake to Use https Protocol

Data Parallelism VS Model Parallelism in Distributed Deep Learning Training

Posted: May 23, 2019 Updated: May 23, 2019

Some Simple Logic and Theory Behind

Used Shared Memory in Templated Kernels in CUDA Programming

Posted: May 4, 2019 Updated: May 4, 2019

A Trick to Work Around

Pass Function Pointers to Kernels in CUDA Programming

Posted: April 28, 2019 Updated: April 28, 2019

Some Alchemy in CUDA Programming

YOLO v2 Reorg Layer Explained

Posted: April 24, 2019 Updated: April 24, 2019

The Most Detailed Explanation on Reorg Layer

Format C/C++ Code Using Clang-Format

Posted: April 22, 2019 Updated: April 22, 2019

Clang-Format Quick Tutorial

PIC and PIE Toggles for Compiler

Posted: April 20, 2019 Updated: April 20, 2019

Quick Understanding of Position Independent Code and Excutables

Poolings in Deep Learning

Posted: April 19, 2019 Updated: April 19, 2019

Funny Relationships Between Max Pooling, SPP Pooling, and ROI Pooling

Tensor Physical Layouts on Memory

Posted: April 17, 2019 Updated: April 17, 2019

Know Your Tensor!

Introduction to YOLOs

Posted: April 15, 2019 Updated: April 15, 2019

Dig into Some of the Details in YOLO Models

Bounding Box Encoding and Decoding in Object Detection

Posted: April 8, 2019 Updated: April 8, 2019

Some Secret Recipies Hard to Find

Powerful Gaming and Deep Learning PC Build

Posted: April 6, 2019 Updated: April 6, 2019

Experience, Caveat and Issues

Unbiased Estimates in Policy Gradient

Posted: March 15, 2019 Updated: March 15, 2019

Some Refreshes on Probability and Calculus

On-Policy VS Off-Policy in Reinforcement Learning

Posted: March 14, 2019 Updated: March 14, 2019

A Reinforcement Learning Basic Concept Memo

CUDA Block and Grid

Posted: March 12, 2019 Updated: March 12, 2019

Understand the Concept of Block and Grid in CUDA Parallel Computing

Solve Text Editor Sublime 3 Scroll Lag Problem

Posted: March 10, 2019 Updated: March 10, 2019

Configure the Best of Your Favorite Text Editor

Save, Load and Inference From TensorFlow Frozen Graph

Posted: March 7, 2019 Updated: January 9, 2020

Filling a Missing Part in TensorFlow Inference

Use Focal Loss To Train Model Using Imbalanced Dataset

Posted: March 4, 2019 Updated: June 30, 2019

Understand the Advantages of Focal Loss in Object Detection

Ubuntu 18.04 LTS No Sound Fix

Posted: February 24, 2019 Updated: February 24, 2019

A 24-Hour Debug Experience

Simple GitHub Backup Tutorial

Posted: January 27, 2019 Updated: January 27, 2019

Clone All Your Repositories to Local Computer

Learn to Understand a Modern Graphic Card

Posted: January 26, 2019 Updated: January 26, 2019

My Learning Notes on NVIDIA GeForce RTX 20 Series Graphic Cards

2018

Batch Normalization Explained

Posted: September 7, 2018 Updated: May 31, 2019

Fill More Holes in Deep Learning

Guide to TensorFlow Dataset API

Posted: August 11, 2018 Updated: August 11, 2018

Harness TensorFlow Dataset API for Real Applications

Image Pyramids and Its Applications in Deep Learning

Posted: August 4, 2018 Updated: August 4, 2018

Traditional Computer Vision Techniques Boosted Deep Learning

Maximum Likelihood Estimation of N-Gram Model Parameters

Posted: June 9, 2018 Updated: June 9, 2018

Mathematical Proof of the Maximum Likelihood Estimation of N-Gram Model Parameters

Jupyter Notebook on Docker

Posted: May 21, 2018 Updated: May 15, 2018

Using Jupyter Notebook on Docker

TensorBoard on Docker

Posted: May 15, 2018 Updated: May 15, 2018

Visualization of Tensorboard on Docker

LogSumExp and Its Numerical Stability

Posted: May 4, 2018 Updated: May 4, 2018

Never Jump Out of Log Domain

Docker Beginner's Guide

Posted: April 12, 2018 Updated: April 12, 2018

My Docker Experience as a Newbie

Setting Up Jekyll Site Locally

Posted: April 1, 2018 Updated: June 7, 2020

Some Jekyll Notes

Multivariate Gaussian and Covariance Matrix

Posted: March 30, 2018 Updated: March 30, 2018

Fill Up Some Probability Holes

Prefix-Free Code and Huffman Coding

Posted: March 17, 2018 Updated: March 17, 2018

Understand Prefix-Free Code, Huffman Coding, and Try it Using Library Tools

Pseudolikelihood in Graphical Models

Posted: February 16, 2018 Updated: February 16, 2018

Understand How Pseudolikelihood Works in Graphical Models

2017

Duckie Town Experience

Posted: December 10, 2017 Updated: December 10, 2017

Experiencing Artificial Intelligence in Robotics

Configure MySQL Services on Windows

Posted: November 22, 2017 Updated: November 22, 2017

My First Touch to the Windows Services

Backpropagation Through Max-Pooling Layer

Posted: August 21, 2017 Updated: November 26, 2019

Ever Think of Backpropagation Through Max-Pooling Layer?

Mathematical Logics Behind The Weights Initialization

Posted: May 18, 2017 Updated: May 18, 2017

Understand Why We Initialize the Weights in This Way.

Simple Illustration of Programmable Backpropagation

Posted: May 17, 2017 Updated: May 17, 2017

We Understand Backpropagation. But Why It is Programmable?

Comprehensive Proof of Perceptron Convergence Theorem

Posted: May 15, 2017 Updated: May 15, 2017

Perceptron Learning Algorithm Always Converges.

Understand Bias-Variance Dilemma with Intuition and Math

Posted: May 13, 2017 Updated: May 13, 2017

Mathematical Derivation of Bias-Variance Relationship.