-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
137 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!DOCTYPE html> | ||
<html lang="fr"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>Activation layer</title> | ||
<link href="style.css" rel="stylesheet"> | ||
</head> | ||
|
||
<body> | ||
<div class="sidenavbar"> | ||
<a href="index.html">Home Page</a> | ||
<a href="network.html">XOR Neural Network</a> | ||
<p>Layers</p> | ||
<a href="layer_dense.html">Dense Layer</a> | ||
<a href="layer_activation.html">Activation Layer</a> | ||
</div> | ||
|
||
<div class="sidelist"> | ||
<a href="#What">What is it</a> | ||
<a href="#How">How to create it</a> | ||
</div> | ||
|
||
<div class="main"> | ||
<h1>Layers > Activation</h1> | ||
<div class="part"> | ||
<h2 id="What">What is it</h2> | ||
<p> | ||
The Activation layer takes all the inputs and applies the activation function on each one. | ||
</p> | ||
<p> | ||
It allows the network to learn non-linear functions, so without an Activation layer the network would only be able to learn linear functions. | ||
So it's an important part of the network. | ||
</div> | ||
<div class="part"> | ||
<h2 id="How">How to create an Activation layer</h2> | ||
<p> | ||
To create a layer we first need a neural network to create the layer in, as seen in the <a href="network.html">XOR example</a>. | ||
</p> | ||
<p> | ||
We can then call the <i>add_layer</i> method on the neural network and create the layer that we want as the parameter for the function. | ||
In our case we are going to create an Activation layer. | ||
</p> | ||
<p> | ||
We only need one parameter, it is the activation function we chose for this layer. | ||
A commonly used one is the leaky relu function, as the derivative is easy to compute and the derivative does not fades out as for a sigmoid for example. | ||
Other activation functions can be found in <a href="activation_functions.html">here</a>. | ||
</p> | ||
<p class="snippet"> | ||
model.add_layer(nn.Activation.new(.leaky_relu)) | ||
</p> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
<html lang="fr"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>Dense layer</title> | ||
<link href="style.css" rel="stylesheet"> | ||
</head> | ||
|
||
<body> | ||
<div class="sidenavbar"> | ||
<a href="index.html">Home Page</a> | ||
<a href="network.html">XOR Neural Network</a> | ||
<p>Layers</p> | ||
<a href="layer_dense.html">Dense Layer</a> | ||
<a href="layer_activation.html">Activation Layer</a> | ||
</div> | ||
|
||
<div class="sidelist"> | ||
<a href="#What">What is it</a> | ||
<a href="#How">How to create it</a> | ||
</div> | ||
|
||
<div class="main"> | ||
<h1>Layers > Dense</h1> | ||
<div class="part"> | ||
<h2 id="What">What is it</h2> | ||
<p> | ||
A neural network is made out of layers. The dense layer is also called the fully connected layer or just known as a 'normal' layer. | ||
It is composed of weights connecting each input with every output, and then it adds the biases to each output. | ||
</p> | ||
<p> | ||
The Dense layer is complementary with the <a href="layer_activation.html">Activation layer</a> as the dense layer is the part that will train and improve and the activation layer | ||
produces non-linearity or said in another way: it allows the network to learn many more things. | ||
</p> | ||
</div> | ||
<div class="part"> | ||
<h2 id="How">How to create a Dense layer</h2> | ||
<p> | ||
To create a layer we first need a neural network to create the layer in, as seen in the <a href="network.html">XOR example</a>. | ||
</p> | ||
<p> | ||
We can then call the <i>add_layer</i> method on the neural network and create the layer that we want as the parameter for the function. | ||
In our case we are going to create a Dense layer. | ||
</p> | ||
<p> | ||
The first two arguments are for the number of inputs and the number of outputs of the layer, because as said earlier each input is connected with every output and there is a bias for each output. | ||
The third ad fourth arguments are the range for initialisation of weights and biases respectively. In this example for weights, they can be initialized between -0.7 to 0.7. | ||
</p> | ||
<p class="snippet"> | ||
model.add_layer(nn.Dense.new(2, 3, 0.7, 0.65)) | ||
</p> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters