Live data from Hacker News

What does a neural network actually do?

moalquraishi.wordpress.com

21–30 of 39 posts

Re: What does a neural network actually do?

#21

Earlier quoted context omitted.

I can't find an example on Google right now, but I've seen demonstrations that it's possible to visualize the intermediate layers of a neural network - for example you can see how an image recognition network is first breaking down an image into horizontal and vertical lines, then combining those into more complex shapes, etc.

But visualizing is quite a ways from debugging. To debug a program you actually verify that it's logic is correct (at least the good kind of debugging). Consider a spectrum: 1. Natural language - we humans combine fragments of natural language easily and on an ad-hoc basis. We can get a fairly amount of use from reusing Shakespeare quotes and neologisms while spending rather little effort. 2. Trained programmers can…

Can you debug a human brain? I can't.

Is a human brain intelligent? I believe so.

Re: What does a neural network actually do?

#22
This is a pretty good article, but I'm seeing a lot of confusion in this thread because the article is maybe one step ahead of the basic intuition needed to understand why ANNs are not magical and are not artificial intelligence (at least not feed-forward networks).

Perhaps a simpler way to look at it is to understand that a feed-forward ANN is basically just a really fancy transformation matrix.

OK, so unless you know linear algebra, you're probably now asking what's a transformation matrix? Without the full explanation, the important understanding is why they are so important in 3D graphics: they can perform essentially arbitrary operations (translation, rotation, scaling) on points/vectors. Once you have set up your matrix, it will dutifully perform the same transformations on every point/vector you give it. In graphics programming, we use 4x4 matrices to perform these transformations on 3D points (vertices) but the same principle works in any number of dimensions - you just need a matrix that is one bigger than the number of dimensions in your data*.

Edit: For NNs the matrices don't always have to be square. For instance you might want your output space to have far fewer dimensions that your input. If you want a simple yes/no decision then your output space is one-dimensional. The only reason the matrices are square in 3D graphics is because the vertices are always 3-dimensional.

What a neural network does is take a bunch of "points" (the input data) in some arbitrary, high number of dimensions and performs the same transformation on all of them, so as to distort that space. The reason it does this is so that the points go from being some complex intertwining that might appear random or intractable, into something where the points are linearly separable: i.e., we can now draw a series of planes in between the data that segments it into the classifications we care about.

The only difference between a transformation matrix and a neural network is that a neural network has at least two layers. In other words, it is two (or more) transformation matrices bolted together. For reasons that are a bit too complex to get into here, allows an NN to perform more complex transformations than a single matrix can. In fact, it turns out that an arbitrarily large NN can perform any polynomial-based transformation on the data.

The reason this is often seen as somewhat magic is that although you can tell what transformations a neural network is doing in trivial cases, NNs are generally used where the number of dimensions is so large that reasoning about what it is doing is difficult. Different training methods can give wildly different networks that seemingly give much the same results, or fairly similar networks that give wildly different results. How easy it is to understand the various convolutions that are taking place rather depends on what the input data represents. In the case of computer vision it can be quite easy to visualise the features that each neuron in the hidden layer is looking for. In cases where the data is more arbitrary, it can be much harder to reason about, so if your training algorithm isn't performing as you'd like, it can be difficult to understand why it isn't working, even if you already understand that the basic principle of a feed-forward network is just a bunch of simple algebra.

Re: What does a neural network actually do?

#24
post #21

Earlier quoted context omitted.

But visualizing is quite a ways from debugging. To debug a program you actually verify that it's logic is correct (at least the good kind of debugging). Consider a spectrum: 1. Natural language - we humans combine fragments of natural language easily and on an ad-hoc basis. We can get a fairly amount of use from reusing Shakespeare quotes and neologisms while spending rather little effort. 2. Trained programmers can…

Can you debug a human brain? I can't. Is a human brain intelligent? I believe so.

Well,

Admittedly, all this is in manner of speaking but still, I would claim that most if not all the times you debug a program you are also debugging your mental concept of what the program does. By that fact that we can change our concepts, our minds are very "debuggable."

Re: What does a neural network actually do?

#25

This is a pretty good article, but I'm seeing a lot of confusion in this thread because the article is maybe one step ahead of the basic intuition needed to understand why ANNs are not magical and are not artificial intelligence (at least not feed-forward networks). Perhaps a simpler way to look at it is to understand that a feed-forward ANN is basically just a really fancy transformation matrix. OK, so unless you kn…

A nice, cogent explanation.

It's good to remember the ANN's input offset comes as vector data. The ANN isn't directly transforming those vectors directly, rather it is transforms these input to a higher dimensional "feature" space and performs the linear transform. If you take the separating plane that's drawn in the feature space and reverse the map, you'll the ANN has drawn complex surface between the points it want to recognize and those it rejects.

So it's basically a heuristic and no more intelligent than Taylor's series.

Re: What does a neural network actually do?

#26
post #20

Earlier quoted context omitted.

I think you have hit upon a problem of present day AI. Neural networks, Support Vector Machines, Hidden Markov Models and other stuff (Markov Networks, etc) do something like linear regression on some huge space - they draw a curve/plane between groups of things on this feature space. The tendency is for this division to make sense and to correspond to our common sense categorization of these things. The problem is t…

Your criticism is fair, but you fail to explain how an NN or SVM is any worse than how a human mind actually operates. In other words, the incomprehensibility of a modern AI model is not a failing of AI, it is a failing of (AI) psychology and (AI) neuroscience. The artificially constructed intelligence works whether or not we understand how. The frontier of AI science is now open to AI Psychology. Psychologists and N…

I could hardly contrast the operations of a NN to those of the human mind because we most definitely don't understand the later. I have already described apparent properties of human minds that NN and SVN definitely don't have. But I'll repeat and expand:

The artificially constructed intelligence works whether or not we understand how

The operation of human intelligence is very dependent on the fact that we human have operational understanding of each other's mental processes. Moreover, it is well known that human beings process language and can re-evaluate past experience in light of present understand.

Oppositely, we know enough about the properties of the various non-linear recognizers to know that constructs can't do and won't ever be able to do these things.

Re: What does a neural network actually do?

#28
Another limit they don't address is that the training normally used is purely local— just a gradient descent. So even when the network can model your function well, there is no guarantee that it will find the solution.

For me ANN's always seem to get stuck on not very helpful local minima— they're not one of the first tools in my bags of tricks by far.

Often I associate them as being the sort of thing that someone who doesn't really know what they're talking about talks about. (Esp. if its clear that in their minds NN have magical powers. :) maybe they'll also mention something about "genetic algorithms")

Re: What does a neural network actually do?

#29
post #28

Another limit they don't address is that the training normally used is purely local— just a gradient descent. So even when the network can model your function well, there is no guarantee that it will find the solution. For me ANN's always seem to get stuck on not very helpful local minima— they're not one of the first tools in my bags of tricks by far. Often I associate them as being the sort of thing that someone wh…

Well, you could use an EA to take a stab at finding better minima :)

And correct me if I'm wrong, but isn't the cost function for a feed forward neural networks that uses a sigmoid activation function convex wrt the parameters being trained, i.e. gradient descent is guaranteed to find the global minimum when small enough of a step size is used?

Re: What does a neural network actually do?

#30
post #28

Another limit they don't address is that the training normally used is purely local— just a gradient descent. So even when the network can model your function well, there is no guarantee that it will find the solution. For me ANN's always seem to get stuck on not very helpful local minima— they're not one of the first tools in my bags of tricks by far. Often I associate them as being the sort of thing that someone wh…

> So even when the network can model your function well, there is no guarantee that it will find the solution.

If it models the function over the input domain, then it is properly trained. If it is trained to a local minima then it doesn't model the underlying function well over the whole input domain. If you have good/representative training and validation sets you will be able to tell.

> Esp. if its clear that in their minds NN have magical powers

I know that type. When dealing with ANN's you realize quickly (just like in all data science) that all of the "magic" relies on the manual work and thought that goes into washing and adapting the data. Not very sexy work, and work that requires a fair bit of knowledge about the problem domain.

> For me ANN's always seem to get stuck on not very helpful local minima

That isn't the ANN that gets stuck, it's the training algorithm (using gradient descent) that gets stuck :) Training is orthogonal to the operation of the network itself (which is just a nonlinear function in the end!). Gradient descent via error backpropagation is the most common training method for MLP's, but you could imagine doing a random/brute force algorithm that is significantly simpler to implement, but slower. Since a network is often trained once and then used repeatedly, it is often plausible to train it for several weeks if needed! A pure random search is usually not feasible, but adding randomization to a gradient descent will help. There are many ways to avoid local minima for a gradient desccent, if you have time to wait.

> maybe they'll also mention something about "genetic algorithms"

The simple error backpropagation methods only work well for normal feed-forward networks. Other topologies e.g. recurrent networks require more exotic methods. In my (limited) experience genetic algorithms are rarely efficient as a training method though.

Post reply on HN