You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2016-12-19-feedforward-neural-networks-visual-interactive.md
+82-12
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,85 @@ title: Feedforward Neural Networks - Part 2 of A Visual and Interactive Guide to
6
6
7
7
<!--more-->
8
8
9
+
While the networks we discussed in the [previous post]() show some important basic concepts, we'll need to continue our look at more concepts that can improve our prediction models.
10
+
11
+
12
+
We'll slightly adjust the way we represent the networks from the previous weights. The bias node specifically is more commonly represented like this
The calculation flows from the left to the right. Before we can use this net for prediction, we'll have to run a "training" process that will give us the values of all the weights (<span class="weight-node-text">w</span>) and biases (<span class="bias-node-text">b</span>).
17
+
</div>
18
+
19
+
20
+
The dataset we'll use this time will be the [Titanic passenger list]() from Kaggle. It lists the names and other information of the passengers and shows whether each passenger survived the sinking event or not. We'll attempt to build a network that predicts whether a passenger survived or not. We'll start with only two feature columns of the dataset (and add more later):
21
+
22
+
23
+
24
+
<divclass="two_variables">
25
+
<table>
26
+
<thead>
27
+
<tr>
28
+
<th>Age</th>
29
+
<th>Sex</th>
30
+
<th>Survived?</th>
31
+
</tr>
32
+
</thead>
33
+
<tbody>
34
+
<tr>
35
+
<td>22</td>
36
+
<td>male</td>
37
+
<td>No</td>
38
+
</tr>
39
+
<tr>
40
+
<td>38</td>
41
+
<td>female</td>
42
+
<td>Yes</td>
43
+
</tr>
44
+
<tr>
45
+
<td>26</td>
46
+
<td>female</td>
47
+
<td>Yes</td>
48
+
</tr>
49
+
<tr>
50
+
<td colspan="3">… 891 rows total</td>
51
+
</tr>
52
+
</tbody>
53
+
</table>
54
+
</div>
55
+
56
+
Let's start with training a shallow neural network to predict survival given given a passenger's information. Running two thousand steps of gradient descent looks like this:
57
+
58
+
[Training Viz]
59
+
60
+
61
+
The trained network now looks like this:
62
+
63
+
(hover or click on values in the table to see their individual predictions)
64
+
65
+
<divid="neural-network-calculation-viz"></div>
66
+
67
+
<divid="neural-network-calculation-table"></div>
68
+
69
+
70
+
When trained, this shallow network can correctly guess only 81% of the training examples. To improve on it, we'll need to pull another tool from our toolbox.
In the [previous post]() we discussed some of the basics of neural networks:
10
89
11
90
* How the inputs flow through the network to calculate a prediction
@@ -17,6 +96,9 @@ In the [previous post]() we discussed some of the basics of neural networks:
17
96
18
97
There are a couple more concepts we need to touch upon if we're to build a better understanding of proper neural networks. These will be network structure concepts that improve the behaviours of our networks and our prediction models.
19
98
99
+
100
+
101
+
20
102
## Feed it forward
21
103
Let's keep tweaking the example we started with. Your friend who wants to buy a house provided you with this list of house size & price and how appropriate for her she thinks the size and price are.
22
104
@@ -42,15 +124,3 @@ Let's keep tweaking the example we started with. Your friend who wants to buy a
42
124
In [this notebook](), I trained a softmax regression neural network against this dataset. After the training, the network could correctly classify only 8 out of the 10 examples in the training set.
43
125
44
126
Take a look at how the trained network calculates the prediction for each example in the training set:
0 commit comments