Tensorflow: Difference between revisions

From bradwiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 14: Line 14:




How did that single neuron do on the task?
How'd it do? Does one neuron, with a single feature input (the value of each dot in the first dimension, the x-axis) perform well in the separation task? If it did well, an orange background should have formed behind the orange dots, and a blue background behind the blue dots.
 
The color gradient along the surface (under the dots) can be understood as the neural net's prediction 'confidence' at that given coordinate. More directly, it is the value spit-out by the activation function of the 'output layer'. Here, since we only have a single layer, our hidden 'hidden layer' and 'output layer' are one in the same. The output function of our neuron is known as the '''tanh''' function.
 
The tanh function is an extremely common choice for an output function in artificial neural network machine learning frameworks because it yields a nice sigmoid shape, and no matter the magnitude of its inputs, the output from the tanh function is bounded between { 0 : 1}. These are very desirable properties for neural net nodes. Here you see the tanh function evaluated across various x-dim inputs...
 
 
[[File: Tanh.png|600px|Tanh produces a sigmoid output over the range -2 and 2. It automatically evaluates to exact values when its argument is the natural logarithm of a rational number. When given exact numeric expressions as arguments, Tanh may be evaluated to arbitrary numeric precision.]]
 
 




Continue to [[TensorFlow Tutorial Page 2]]
Continue to [[TensorFlow Tutorial Page 2]]

Revision as of 05:46, 20 January 2018

Below I've embedded a neural network classifier rendered in a Tensorflow playground. There are a variety of knobs, buttons, numbers, and pictures on the interface; I will explain what they all mean as we go along. For now though, let's define our primary goal throughout this tutorial...

Our primary task is to train neural nets to classify items into 1 of 2 categories. Here we represent those categories as either an orange dot or blue dot. You can think of these dots as CASE and CTRL participants in an Alzheimer's Disease (AD) study. For the heck of it, say blue dots represent CASE and orange dots represent CTRL.

In this first example, let's say...

  • dim-1 (x-axis): braak score
  • dim-2 (y-axis): age

Notice the dots form clusters. If you were asked to draw a line on this plane, to separate these two clusters, it could be easily done. Our brain's neural nets have already solved the the spatial problem. Now let's see if an artificial neural net can solve the same problem.

Go ahead and click the blue start button below; let it run for about 500 epochs (~5 seconds), then click pause.

{{#widget:Tensorflow1}}


How'd it do? Does one neuron, with a single feature input (the value of each dot in the first dimension, the x-axis) perform well in the separation task? If it did well, an orange background should have formed behind the orange dots, and a blue background behind the blue dots.

The color gradient along the surface (under the dots) can be understood as the neural net's prediction 'confidence' at that given coordinate. More directly, it is the value spit-out by the activation function of the 'output layer'. Here, since we only have a single layer, our hidden 'hidden layer' and 'output layer' are one in the same. The output function of our neuron is known as the tanh function.

The tanh function is an extremely common choice for an output function in artificial neural network machine learning frameworks because it yields a nice sigmoid shape, and no matter the magnitude of its inputs, the output from the tanh function is bounded between { 0 : 1}. These are very desirable properties for neural net nodes. Here you see the tanh function evaluated across various x-dim inputs...


Error creating thumbnail: File missing



Continue to TensorFlow Tutorial Page 2