Getting Started

A zoomed-in view of random pixels. Image by the author.

Introduction

This article will look at information theory with the goal of developing useful intuition for some concepts and their applications. It will stay away from technical details, but there are references linked at the bottom for further reading. To begin, I’d like to start with a simple question:

Can any file be compressed?

The answer…


The built-in Python collections library is a treasure trove of useful tools. I will focus on the two structures that I find the most useful: Counter and defaultdict. Understanding these data structures will help you make your code more concise, readable, and easy to debug.

Counter

The Counter object takes an…


Tips and Tricks

Photo by Kaitlyn Baker on Unsplash

Do you do research that involves coding? Research in many scientific fields, from neuroscience to machine learning to economics, now requires at least some ability to write code and analyze data. While coding, researchers can run into problems with code readability, reproducibility, and productivity if they are not careful. I’m…


Tokyo, circa 1999 (Family photograph)

For me, the sentence “I’m Asian and American” is true in the simplest sense: I am from Asia and I am also from America. Despite being Asian and American, I am not Asian-American.

The phrase “Asian-American” may bring to mind the image of families from across Asia journeying to the…


Photo by Museums Victoria on Unsplash

0. Introduction

You’ve probably played, or at least seen, the game of Snake before. The player controls a snake by pressing the arrow keys, and the snake has to maneuver around the screen, eating apples. With each apple eaten, the tail’s snake grows one unit. …


Hands-on Tutorials

Photo by Scott Graham on Unsplash

Having been a teacher for a few years, I understand the frustration of educators who work hard to impart knowledge and meaningful feedback to their students, only for a small number of cheaters to circumvent the system by passing off plagiarized work as their own. Thanks to the Internet, cheating…


Getting Started

Photo by Alexandre Valdivia on Unsplash

In my first five years of coding in Python, I had almost never used the built-in set data structure. Recently I have gained an appreciation for sets, thanks to a project that required lots of text processing and checking if certain words occur in certain texts. I wish I had…


As you might expect in an election year, social media these days is awash in political discourse — some of it reasonable and productive, much of it incendiary. Plenty of articles have been written on the polarizing “echo chamber” effects of social media, as well as targeted disinformation campaigns and…


In this article, I will explain the Universal Approximation Theorem and showcase two quick examples with PyTorch code to demonstrate neural networks learning to approximate functions. Feel free to skip straight to the code and visualizations if you already know the basics of how a neural network works!

When a…


Photo by Sara Kurfeß on Unsplash

Let’s use machine learning to generate fake tweets that emulate Donald Trump’s language and style! A lot of introductory machine learning tutorials focus on classification tasks such as MNIST, so I hope you enjoy this article about generative models.

We will first use a relatively simple approach for this task…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store