Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is a 'layer' in a neural network

Below I've drawn a typical feed forward neural network:

Typical Feed Forward Neural Network

Now my question is, as far as lingo goes, what is a layer?

Could each individual process (rectangle) be considered a layer? or is a layer the combination a single row of the flow diagram? I sometimes see the Multiply + Add as a single layer, and the nonlinear function (relu) as a separate layer. But I would really appreciate a definitive answer.

I often find on online videos teaching people about Neural Networks, the instructors themselves mix up the number of layers within a single example.

like image 565
kmace Avatar asked Feb 11 '16 16:02

kmace


1 Answers

With your diagram, each row is essentially a layer. But as @beaker states it is not the best way to visualize a neural network.

Taking an image from here will help make this clear.

enter image description here

Layer is a general term that applies to a collection of 'nodes' operating together at a specific depth within a neural network.

The input layer is contains your raw data (you can think of each variable as a 'node').

The hidden layer(s) are where the black magic happens in neural networks. Each layer is trying to learn different aspects about the data by minimizing an error/cost function. The most intuitive way to understand these layers is in the context of 'image recognition' such as a face. The first layer may learn edge detection, the second may detect eyes, third a nose, etc. This is not exactly what is happening but the idea is to break the problem up in to components that different levels of abstraction can piece together much like our own brains work (hence the name 'neural networks').

The output layer is the simplest, usually consisting of a single output for classification problems. Although it is a single 'node' it is still considered a layer in a neural network as it could contain multiple nodes.

like image 179
cdeterman Avatar answered Sep 22 '22 12:09

cdeterman