paint-brush
Putting the D in Deep Learningby@dubeya
430 reads
430 reads

Putting the D in Deep Learning

by March 23rd, 2016
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Warning: Things are gonna get really un-technical now.
featured image - Putting the D in Deep Learning
 HackerNoon profile picture

Warning: Things are gonna get really un-technical now.

Nerds all over the world are going crazy over the AlphaGo wins, so it’s natural that someone who’s done more than read Wikipedia on the topic would feel like reminding everyone how there’s more to the story than the sensationalism, and here goes.

As you might’ve read, deep learning has been all the rage recently — right from calling black people gorillas and imitating a horny anti-semitic millennial to winning Go matches and also judging your posts on social media. The increased availability of data and processing power enable these algorithms to create really powerful models. But I’m getting ahead of myself. Before you scroll down furiously to rage comment ‘A.I. IS SATAN FEAR GOD’, let me explain to you what exactly is going on, and why a robot uprising is one of the last things you should be worried about, despite what these people have to say.

Let’s take a basic skill based task, a game to keep it interesting, that most of us can relate to — Chess. A two-player turn-by-turn game involving players moving one piece at a time till the King gets killed or whatever (I also find the whole arrangement antiquated, there was a change that did happen for playing cards, BTW). At every step in the game, you have a set of possible moves that you can make, of which you choose one that would be the move most likely to make you succeed, and the game progresses. This creates a tree-like structure of steps that you can take, evaluating your current situation till it results in a brutal loss because you really don’t know s**t about Chess.

Decision tree (courtesy https://garabedyan.wordpress.com/)

Now since at each point in this ‘tree’, there are so many ‘branches’ you can take (corresponding to each move that you could make at any instant), it requires a lot of refined intuition and plain intellect to know which ‘branch’ to choose. For a computer that doesn’t give a rat’s ass about Chess, one way to solve this conundrum would be to evaluate every possible move that you make and it makes at every step, and figure out which one would result in a higher chance of winning and then choose a move. Computer scientists have, over time, put in a lot of effort to create algorithms that would simplify this task by selecting only a few branches that make the most sense, and saving a lot of time, and eventually making the genius Kasparov cry like a little bitch.

Since Go as a game is way too complicated to be evaluated in a decision tree-based approach (the number of branches at each step was too damn high for one), scientists at that time weren’t very hopeful about AI beating us at that, especially using the same approach — back in 1997. But guess what? DeepMind got 2016's AI money shot by winning against the who’s who of the Go world, although they did in a very different way. Which brings us to the big D in artificial intelligence — deep learning.

Every tutorial that you will find on deep learning will begin explaining the concept to you assuming you’re familiar with what neural networks are, so naturally I’m going to do something a little different. Let’s come back to our Chess problem for a minute. Remember how I was talking about selecting a few branches which make the most sense? How that’s done is using some practical ideas which we assume to have a strong correlation with the outcome of a game, otherwise known as heuristics.

For example, in the case of judging how stupid a person is, a good heuristic would be the number of times the person says the word “like” in their sentences, or the number of times they talk about this. In the game of Chess, heuristics can include the number of pieces left, where exactly the King is, and so on. These heuristics are used to get a sense of how probable a win is without playing through the whole game, and this technique is applicable to a lot of games (a lot of other problems are also modeled as games).

Imagine a traditional office which supplies artsy boxes to clients, who specify their needs through different people the client works with. Except here the workers are really, really stupid — almost as smart as those stupid pigeons who keep flying into windows. This will come in handy later. We have cubicles which have workers who get buttloads of menial work from their bosses. Now, like every haphazardly collaborative company, a worker reports to multiple bosses who have overlapping subordinates. Also, each boss wants the worker in question to work on something else. So all in all, you have this office where each employee gets multiple tasks from multiple bosses, who in turn report to multiple bosses and so on — this place is basically a nightmare and has terrible working conditions, but since it’s a simile I don’t really give a s**t.

Now, this place is organized according to seniority. All the clerks are on the ground floor, interacting with the client, passing reports on to their bosses, the managers, who work on the first floor and receive reports from their subordinates, work on them according to what their bosses want, and pass them to the next floor. This goes on till the suit-wearing Audi-driving boss gets the final report and loses their chill over the stupidity of it, and calls each of their subordinates and cuts their salaries in proportion to their mistakes.

These frustrated managers then go to the lower floor and scream their asses off at their subordinates while cutting their salaries in a similar fashion, and yeah, the same people get shouted at by each of the bosses they work for, and then go and do the same to their juniors. This goes on and on till the ground floor, where the employees just take all the crap from their bosses, clutch at the bottle of sleeping pills in their drawers and mutter ‘not today’ under their breaths.

But then these people are human after all, and they learn from their mistakes — some quicker than the others, and try to not make the same mistakes again, and the process continues. Eventually, over thousands of different clients (since these people are especially dim-witted, like I mentioned earlier), this office starts getting some things right, and then, over millions of clients, begins to get a lot more things right, and eventually the office as a whole knows exactly what to do, what to look for in every client to create the proper artsy box that the client would love (probably way too much).

A 3-layer(floor) neural network (this is the building laid down horizontally, every different color is one floor)

This is, in essence, how a neural network works (the more experienced and judgemental readers from this area might’ve realized that my analogy omitted a lot of details, but well, it still makes sense). This model isn’t all new — the first paper describing the exact algorithm for the ‘salary cuts’ as I so succinctly described dates back to the 1960s, and people have been working on them ever since.

With the invention and availability of more processing power and enormous amounts of data through the Internet (remember how I said that these workers are really really dumb — that’s why they need copious amounts of information to learn), computer scientists have revived the concept of deeper networks (buildings with more floors), after they realized that adding more layers (hiring more people at different, incremental positions) was helping the algorithms perform better.

With the parallelization that GPUs could provide (yeah, you can do more with that 12 GB behemoth than sit on your couch, eat chips and play CoD), these networks became easier to create and train, and gradually they’ve been used for all sorts of complicated AI decision-making. One very important aspect of deep networks that most people (even some beginners in machine learning) fail to understand is that the real novelty in deep networks is they are capable of learning what to look for and not just making the final decisions. Each layer (I’m just going to call it layer and not provide floor in brackets now) learns exactly what it’s required to learn, to make the correct decision for a particular task.

For example, consider the case of recognizing the object present in an image. Remember, to a computer, the information in an image is like an Excel sheet, with every cell specifying the color present in it. If we give a lot of images to a deep network, specifying what is present in each image, the network learns things that are surprising. For example, it can figure out, on its own, that the first things it has to look for are edges — because edges discriminate parts of an image from other parts. Then it begins identifying shapes like squares, circles etc. which it later learns to combine in different ways in order to identify parts of objects — handles, legs etc., and finally figures out what the object is.

Something like this happens in the human brain as well (no s**t, they’re called artificial neural networks for a reason) and that’s perhaps why these networks do so well at things humans are good at , and just add the inability to be tired, hungry or emotional, and you have yourself a super machine that does all these tasks well — identifying what objects are present in images, identifying what language is made up of, answering questions, identifying faces and guess what — playing Go.

So yeah, back to the Go scene — the algorithm behind it learns directly from observing millions of games, looking at the moves top players made, and identifying common moves and strategies all on its own. Then they made it play against tweaked versions of itself in order to perfect these strategies and eventually create a player almost at par with the best in the world. Again, the fact here is that the network figures out what to look for in each game it sees gradually all by itself, and not carefully curated heuristics unlike previous approaches.

This has led to some healthy criticism and incredibly stupid reporting of the same, mainly regarding the obvious inefficiency of this albeit remarkable method of problem solving — something that AI and Machine Learning researchers are already thinking about. Deep networks learn far too little from every match compared to us humans (yeah, feel good about yourself), and this has been elaborated in much detail by people way smarter and way more experienced than I am (check the links, goddamnit), so I wouldn’t elaborate on it much here, but this makes for a good segue into the next thing I’m going to talk(write? type?) about.

AI isn’t gonna take over the world — at least not now, it’s still too stupid for f**k’s sake. But yeah, more on that later.