How would you have a machine recognize a cat?

Wednesday, May 16, 2018

I wrote my first computer program in college. It was, surprisingly, not “Hello World”, but typing the number “6” into a Scheme interpreter prompt. You can see how Scheme responded below.

> 6
6

This may seem uninspiring but it was the first time I spoke to a computer, using a language we both could commonly understand. In fact, even though I was dutifully copying examples from my textbook, I distinctly remember feeling like I was having a conversation with my computer. I believe this feeling belies the core of what programming is: communicating and delegating to a machine.

At the time, I thought what needed to be communicated was a precise set of instructions on how I wanted the machine to complete a task. And before I could write the instructions, I had to thoroughly understand how I would personally complete the task. It was only then that I could tell a machine how to complete it. After all, machines were drones, they didn’t have their own minds, they just followed orders. Machines were an extension of myself, just with greater calculating power over a shorter time frame.

Fast forward to today, some things are changing.

I still write plenty of programs that specifically codify exactly how I want a machine to complete a task. To be frank it’s quite belittling toward machines. Imagine you walked into work every morning to your boss handing you a many paged document describing exactly how they want your day to go.

You are to write up a presentation with exactly 12 slides, don’t use Google Docs use that new software we just bought that you hate, if Steve from Sales walks by your cubicle and wants to talk about fantasy football you are to ignore him, oh and make sure you clock out exactly at 5PM because the company doesn’t want to pay any more overtime.

It’d be a nightmare to work for such a boss, I’m certain I’d quit within the first week. We all want to work with a boss that’s better at delegating tasks, one that lets us exercise our creativity on how to best complete a task without assuming we are incompetent. Why don’t we give machines a similar courtesy?

Of course, we still need to provide clear and exact instructions to machines. But instead of telling them how to complete a task, we can tell them how to approach a task.

We need to reach our quarterly profit goals. Here is a manual describing the experiments we ran in past quarters and how our profit changed. Figure out what to do with the data from our current quarter. And I’ll be honest with you, I have no idea what need to do to reach this goal, but I know you are efficient and calculating, I believe in you.

This approach to programming is machine learning in a nutshell (specifically supervised learning). The programmer can push the responsibility of domain knowledge to the machine, and instead focus on providing tools (data) and instructions on how to use these tools. This is a powerful idea because it means we’ll be able to leverage machines to accomplish tasks we don’t have the resources/training to do ourselves.

My first machine learning program was a cat classifier (this is the “Hello World” equivalent for machine learning). Essentially the program receives possible cat images and, using nothing but the RGB values of each pixel of it image, the program decides whether the photo contains a cat. It ended up having an 80% success rate on a test data set I used. Now, while it’s true that I could probably get at least a 99% success rate in classifying cat photos (accounting for some misclicks), I’m certain any explicit program I might write would operate at much worse than 80% accuracy. I wouldn’t even know where to start. A cat has pointy ears, but what are pointy ears, in fact, how do I describe what an ear looks like? How are pointy cat ears different from pointy mouse ears? Imagine having to describe what a cat looks like to a baby. You’d probably end up pointing out cats in real life until the baby learned itself through recognizing the patterns, a remarkably similar strategy to how we implement machine learning :).

Now, you might be wondering how exactly a machine learns without a human explicitly teaching it how to do the task. Stick around, that’ll be the topic of an upcoming post :).

.

[machine-learning] [deep-learning]

Artificial Intelligence, Machine Learning, and Deep Learning - What's the difference?

Tuesday, May 08, 2018

This is the first question I had when I first started exploring these subjects a month ago. I have a better grasp on the terms now, so let's delve in.

Artificial Intelligence

I think generally when people think about Artificial Intelligence (AI), they think of Artificial General Intelligence (AGI), or the ability of a non-biological entity to be able to successfully perform a wide variety of tasks at a human level (or better) proficiency. This contrasts with narrow AI, which can perform specific tasks at human proficiency. We already have examples of narrow AI in everyday life, like in our personal phone or home assistants, self driving cars, or AlphaGo. We don’t, however, have any examples of AGI yet and there is no consensus as to when that might occur, but the holy grail of AI research is toward the development of human level AGI, with the possibility that super intelligent AI wouldn’t be very far behind.

Machine Learning

Machine learning is a field in which machines are trained to develop algorithms to perform a task. This field flies in the face of traditional programming, in which humans assemble the algorithms and program machines to compute them. In machine learning, humans provide the training data (inputs that lead to certain outcomes) and program machines to determine how certain inputs will lead to certain outcomes. This is a powerful paradigm because it frees humans from needing to know how to get to the outcomes themselves, they just need to provide enough training data for a machine to figure out how a certain combination of inputs can lead to an outcome. For instance, if the task at hand is to catch a fish, traditional programming would teach a machine how to use a fishing rod - how to hold the rod, how to release the spool, how to cast a line. Machine learning would give a machine a library of videos showing people succeeding or failing to catch fish, leaving it up to the machine to go through each video and determine/learn how to catch a fish . Perhaps certain casting techniques are better than others, or maybe the weather plays a big role, the machine might pick up on patterns a human doesn't even think consider.

Deep Learning

Deep learning is subset of machine learning in which the machine’s learning style is loosely based on the neural wirings of a biological brain. That is, the machine is programmed to replicate how brains learn, via an artificial neural network. I’ll talk about that further in a subsequent post, but these neural networks will have many layers of "neurons" that explore many possible pathways for a set of inputs to end up as a set of outcomes. What's fascinating is that it's very hard to analyze these neural nets since they are essentially a jumble of weights that calculate patterns in input data. Take an artificial neural net (ANN) that can recognize if a cat is in a photo. For humans, we identify cats via features we deem catlike (pointed ear, furry bodies, whiskers). An ANN might notice that some group of pixels relates to some other group of pixels in a way that suggests a cat is there, but to a human this just looks like a bunch of math and data. For all we know, the ANN may come up with a more precise way to recognize cats that no human has ever thought of, some subtle pattern that renders simple feature recognition (it has a cheezburger?) obsolete.

Anyways it's all pretty exciting stuff and I'm looking forward to breaking past my surface level knowledge of deep learning, machine learning, and AI. One question answered, many more to go.

Spelling Bee Tldr;

Deep learning is a technique in the field of machine learning that advances us closer to creating artificial general intelligence.

.

[machine-learning] [ai] [deep-learning]

Back to the learning grind

Monday, May 07, 2018

It’s been a long time coming, but I’m finally getting around to learning about machine learning. I’m hoping to get a better idea of what artificial general intelligence (AGI) could look like in the future and how that might affect the life I know.

As a first step I’m currently working through Andrew Ng’s Deep Learning course to get my feet wet with some of the technical challenges of machine learning as well as reading Max Tegmark’s Life 3.0: Being Human in the Age of Artificial Intelligence to get a grasp on potential big picture ideas about machine learning.

It’s my plan to keep a weekly log of things I’m learning as a way of organizing my thoughts. Wish me luck!

.

[machine-learning]

What's coming up 2017

Tuesday, January 03, 2017

  1. Read 18 books, at least 3 nonfiction.
    I’ve always averaged 5 books/year but I’d like to make reading more of a priority this year.
  2. Commit to a longer side project (At least 3 months).
    I have at least one in mind :)
  3. Accomplish two physical milestones.
    Potential examples: train for another run or swim or bike race, complete a major hike/trek, do a muscle up, etc...
  4. Accomplish two creative milestones.
    Potential examples: getting better at freestyle hip hop, art, music, or even food composition/plating.

Can't wait.

.

[resolutions]

Resolving 2016

Monday, January 02, 2017

Torrey Pines State Beach

Let's go over my 2016 resolutions:

"Ship something in virtual reality"

I made a scene in VR but nothing worth sharing or shipping. This resolution fell to the wayside since I was waiting for the touch controllers to come out. I also started some work on a 2D project. I might prefer 2D.

"Write 8 posts worthy of reading"

Well, it sure is rough to have fallen short on the first two resolutions. This one was related to the first, as I was planning on writing about things I learned in VR.

"Hike at two national parks, preferably new"

Hiked at Arches, Joshua Tree, Banff, Mt. Rainier, Crater Lake. Each park was deeply inspiring in its own way and I continue to feel lucky and humbled upon every visit. To get a feel for what I saw, check out my instagram.

“Live in a foreign country that's new to me"

I spent March living in Budapest. I had an amazing time in that city. Solo travel has shown me how much I care about human relationships. So it's exceedingly ironic that where I expected to find independence, I instead found how I crave the vulnerability of dependence.

“Develop a fluidity in the kitchen so most dishes I make are served on time"

I prepared somewhere between one to two handfuls of multiple course dinner parties (~6 people each time). And most were ready to go by the time the last guest arrived!

Be able to name all common herbs & spices by sight & smell"

TBD, I need to test myself and get this on tape.

"Accomplish at least two physical goals for surfing, snowboarding, skiing, or weightlifting"

Surfing: After many youtube videos and lots of trial and error, I'm proud to say I can usually get up on the board, albeit sometimes only briefly before falling. I still need to work on my speed and foot placement.

Snowboarding: I definitely progressed from beginner/intermediate to intermediate/advanced levels. I’m good enough to mess around on jumps at the terrain park and I can get some good speed on downhill runs.

Bonus physical goal: I went from the couch to a half marathon this year :)

All in all: 4 to 5 resolutions of 7.

.

[resolutions]

Page 1 / 5 >>