Professional Documents
Culture Documents
01 Speed Read Tensorflow Playground
01 Speed Read Tensorflow Playground
AI for Business
Tensorflow playground provides a great platform that allows users who are not
familiar with high-level math and coding to experiment with neural network for
deep learning. It is created for understanding the core idea behind the neural
network.
1. Data
Small circle points are represented as data points that correspond to Positive (+)
and Negative (-). Positive represented by blue, Negative represented by orange.
These same colours are used in representing Data, Neuron, Weight values.
Splitting ration of data into Train and Test data. Add noise to your data for
better training of the model. Batch means a set of examples used in one
iteration.
3. Features
It provides 7 features or inputs– X1, X2, Squares of X1X2, Product of X1X2 and
sin of X1X2. Select and Deselect the features to understand which feature is
more important; It plays a major role in feature engineering.
4. Hidden Layers
Increase and decrease the hidden layer according to your inputs or data. Also
can select the neurons for each hidden layer, and experiment with different
hidden layers and neurons, check how the results are changing.
5. Epoch
Epoch is one complete iteration through the data set. When you select the play
button to start the network. When the network is started no. Epochs will keep
increasing.
6. Learning Rate
7. Activation Function
8. Regularization
There are two types of Regularization L1 and L2. Which is used to reducing the
overfitting of the model? Model is overfitted when it can only work well with the
single dataset when the dataset is changed; it performs poorly on that data.
9. Problem Type
Tensorflow playground handle two types of problems: Classifications,
Regression
10. Output
Check the model performance after the training the neural network. Observe the
Test loss and Training loss of the model.
Example
Let’s do a classification problem on the Tensorflow playground.
Now add the third feature product of (X1X2) then observe the Losses.
This how you can understand the value of features, how to get good results in
minimum steps.
• Set the learning rate to 0.03, also checks how the learning rate plays an
important role in training a neural network.
• Activation function as Tanh, for basic neural networks there are no
requirements for regularization and regularization rate. There is no need
the change the problem type.
But do not forget to play with regression, so you have a clear idea about
regression.
• Select 2 hidden layers. Set 4 neurons for the first hidden layer and 2
neurons for the second hidden layer followed by the output.
• Starting from the first layer, the weights are passed on to the first hidden
layer, which contains output from one neuron, the second hidden layer
output is mixed with different weights. The thickness of the lines
represents the weights.
• Then the final output will contain the Train and Test loss of the neural
network.
• The output has classified the data point correctly, as shown in the below
image.
Experimentation:
Make some changes and check how it affects other factors. Observe the Train
and Test loss after every change.
Let’s learn how parameters play a vital role in getting better accuracy of the
model.
• Ratio Train and Test: Getting a good ratio of the train test data set will
give our model a good performance.
• Feature Selection: By exploring and selecting different kinds of features,
find your right features for the model.
• Hidden Layer Selection: Select the hidden layer based on your input
size, but the small dataset 2 hidden layer works perfectly. So make some
changes in the hidden layer and also make some observations on it. You
will get a better idea of how the hidden layer plays a role in it.
• Learning Rate: The Most important hyperparameter for the model.
Large learning rates can result in unstable training of the model, and a tiny
rate results in failure of training. So select the learning rate that perfectly
fits your model and give you the best output.
Above mentioned 4 terms play an important role in training a good neural
network. So try to play with it in Tensorflow Playground.
Conclusion