Neural Nets 2: Difference between revisions
Bradley Monk (talk | contribs) No edit summary |
Bradley Monk (talk | contribs) No edit summary |
||
Line 5: | Line 5: | ||
4. [[Neural Nets 4|Network Outputs]]<br> | 4. [[Neural Nets 4|Network Outputs]]<br> | ||
}} | }} | ||
<br> | |||
The previous page ended by mentioning that neural net classifiers can fail for two independent reasons: | The previous page ended by mentioning that neural net classifiers can fail for two independent reasons: | ||
Line 11: | Line 11: | ||
# The neural network itself is ill-formulated, so no matter how much information is provided it cannot learn to solve the classification problem. | # The neural network itself is ill-formulated, so no matter how much information is provided it cannot learn to solve the classification problem. | ||
# The input data is insufficient in quantity or format to solve the classification problem. | # The input data is insufficient in quantity or format to solve the classification problem. | ||
<br> | |||
That said, we found that a single neuron with input from a single feature was sufficient to solve the previous classification problem. Let's try another one. Without changing anything yet, press the play button on the Tensorflow playground below and let it run for about 5 seconds, and then press pause... | That said, we found that a single neuron with input from a single feature was sufficient to solve the previous classification problem. Let's try another one. Without changing anything yet, press the play button on the Tensorflow playground below and let it run for about 5 seconds, and then press pause... | ||
Line 19: | Line 21: | ||
{{#widget:Tensorflow2}} | {{#widget:Tensorflow2}} | ||
<br><br> | |||
====''Finished?''==== | |||
How'd it do on this new classification task? Is one neuron with input from ''a single feature'' (the dim1 data: AGE) still performing well to crate a background color gradient that matches the color of the dots? I'm assuming it didn't do so well this time around. Try again. Resent Tensorflow, and more neurons, and an additional layer also several neurons. Rerun. | |||
How'd it do? It still can't solve the classification problem right? It seems like we'll need to add an additional feature as input. Let's take a look at our options. Again, here is the full set of possible network inputs... | |||
How'd it do? | |||
{| class="wikitable" width=30% align=center | {| class="wikitable" width=30% align=center | ||
Line 62: | Line 60: | ||
---- | ---- | ||
====''DISCUSSION TBD''==== | |||
===Neuron Activation Function=== | |||
= | |||
---- | ---- | ||
The output function from each neuron in our neural net was chosen to be 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... | 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... | ||
Line 133: | Line 75: | ||
<br><br><br><br> | <br><br><br><br> | ||
{{Clear}} | {{Clear}} | ||
[[File: Tanh.png|thumb| | [[File: Tanh.png|thumb|400px|left|see [http://reference.wolfram.com/language/ref/Tanh.html tanh on wolfram alpha] for many details about tanh function.]] | ||
{{Clear}} | {{Clear}} | ||
Tanh produces a sigmoid output over the range {-2 : 2}, and automatically evaluates to exact values when its argument is the natural logarithm. Speaking of the natural log, that is another very common choice of output function for the same reasons as tanh. | Tanh produces a sigmoid output over the range {-2 : 2}, and automatically evaluates to exact values when its argument is the natural logarithm. Speaking of the natural log, that is another very common choice of output function for the same reasons as tanh. | ||
This is something to keep this in mind, if you're wondering what sorts of numbers are travelling along the axons of these neurons, and ultimately those colored gradients underneath the dots. | |||
====''TO BE CONTINUED...''==== | |||
<br> | |||
<!-- {{SmallBox|'''[[Neural Nets 2|Continue to Neural Nets Tutorial Page 2]]'''}} --> | |||
<!-- <btn data-toggle="tooltip">Neural Nets 2</btn> --> |
Revision as of 14:58, 22 January 2018
TUTORIAL ON MACHINE LEARNING AND NEURAL NETWORKS (PAGE 2)
The previous page ended by mentioning that neural net classifiers can fail for two independent reasons:
- The neural network itself is ill-formulated, so no matter how much information is provided it cannot learn to solve the classification problem.
- The input data is insufficient in quantity or format to solve the classification problem.
That said, we found that a single neuron with input from a single feature was sufficient to solve the previous classification problem. Let's try another one. Without changing anything yet, press the play button on the Tensorflow playground below and let it run for about 5 seconds, and then press pause...
Tensorflow
{{#widget:Tensorflow2}}
Finished?
How'd it do on this new classification task? Is one neuron with input from a single feature (the dim1 data: AGE) still performing well to crate a background color gradient that matches the color of the dots? I'm assuming it didn't do so well this time around. Try again. Resent Tensorflow, and more neurons, and an additional layer also several neurons. Rerun.
How'd it do? It still can't solve the classification problem right? It seems like we'll need to add an additional feature as input. Let's take a look at our options. Again, here is the full set of possible network inputs...
X1 | AGE | |
X2 | SCORE | |
X12 | AGE2 | |
X22 | SCORE2 | |
X1X2 | AGE × SCORE | |
sin(X1) | sin(AGE) | |
sin(X2) | sin(SCORE) |
Start by running X1 and X2 together, just to see what happens. Then feel free to test out whatever combinations you think might work.
Input Combinations
DISCUSSION TBD
Neuron Activation Function
The output function from each neuron in our neural net was chosen to be 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...
Tanh produces a sigmoid output over the range {-2 : 2}, and automatically evaluates to exact values when its argument is the natural logarithm. Speaking of the natural log, that is another very common choice of output function for the same reasons as tanh.
This is something to keep this in mind, if you're wondering what sorts of numbers are travelling along the axons of these neurons, and ultimately those colored gradients underneath the dots.
TO BE CONTINUED...