Explanation of 3 common activation functions on Deep learning by usability.

Why Activation Function so Important?

We can imagine activation Function is a thing that firing our brain (in this case neuron) to think. Maybe that illustration makes you more confuse :P

Anyway.. Without activation Function every calculation in each layer doesn’t have a meaning. Why? because the calculation is linear, which is input value has the same value with output value, implicitly. Activation function makes this is not(n) linear anymore.

Sigmoid

Sigmoid function is used together with binary_crossentropy for loss function. And we used this on final or output Layer.

As we can see on…


If the Sequence is matter, then LSTM is good for your Machine Learning Layer.

The Purpose of Recurrent neural network (RNN)

When we want to Predict sequential series of data. For examples sentences, cryptocurrency or stock. We can train the datasets using RNN.

LSTM on RNN

And then the layer that used to RNN training usually we use LSTM.

What is LSTM

We take a look at Sequential Series of data. Because it’s a Sequential so the Sequence of the series data is very important. And each of the series of data influence each other data.

It’s like a Fibonacci Sequence number, every number influence to other number.

Fibonacci Sequence Numbers

In Fibonacci the previous of…


Understanding the weights calculation with dot product and biases behind of Deep Learning

X = feature, w = weight, b = bias and Y is label

Weight

First of all if you use Keras as library, Keras provides some random weights. These weights will be the multiplied by features given from training parameter. And sum all the results.

The value of the weight will be optimized during training process, with optimizer, depends on the result of each epoch.

Dot Product

The calculation between weights and features uses dot product.

Why dot Product? because this calculation much simply to get similarity from some values (equation of vector).


Over Fitting

When is it happened?

  • When the delta from your Train Accuracy and Test Accuracy is too much.
  • When Test Accuracy value is larger than Train Accuracy

Why is it Happened?

Usually overfitting occurs when you have too much Layer or too much training for your model.

How can we reduce OverFitting?

  • Making more simple training model, like remove some layer. Or use DropOut.
  • Make Augmentation from our current dataset. (do pivot, flip or resizing)
  • Adding more training data set.

It looks easy when you read the tutorial about convert model, with 2 lines of codes.

converter=tf.lite.TFLiteConverter.from_saved_model(saved_model_dir)
tflite_model=converter.convert()

Yes it works, but in some conditions.

Three things that you must know about TFLite Converter before you use the converter:

1. Consider the Supported types

At that article, we know that TFLite converter doesn’t support string and float16, at least not yet.

There are some tutorials about text classification that use String for the input shape parameter at input layer, for example this tutorial provided by tensorflow. For now, you cannot convert the model from that tutorial into TFLite.

But actually you can make the text classification by encoding the text string into float or int.

2. You Can Use Tensorflow Lite Model Maker, for not Supported Input Type

If you don’t wanna…


Step by Step to Train your own Image Dataset for Deep Learning Using Tensorflow

Actually there is an easiest way to train you own Image. You can use Firebase Machine Learning. You only have to upload your images and define the labels. But if you still wanna train a model by your hands, you can continue read this blog.

Anyway.. you can find the full source code and the datasets in here

Prepare the Data Set

Prepare as many as possible sample images. Put them into each folders by the classification/labels.

For this i will use mine from this story. …


Yesterday, NVIDIA has released a new series for RTX… 3090.

We know that GPU makes training process for machine learning faster than use CPU. Because GPU consists of hundreds of core.

did you know, Nvidia is using 10,496 CUDA cores on the RTX 3090.

WOW!!! it’s not hundreds man!!!

I cannot imagine how fast my train execution with this machine.

Actually i don’t have this stuff yet, not yet released on my country :(

If you want to use GPU for your machine learning, you can follow this tutorial.

Next time, once i have this GPU.. i will compare the training execution time. cheers..

Anyway,, If you want to learn how to train model with easy steps, you can read this.


If you want to train your data set, then at least you must know these 3 Layers.

Layers

Dense Layer

We called this “the most well-known type of the Layer”. You can use this layer if you want to adding more Layer because your model need to more memorize some values.

Too much Dense Layer will causing Overfitting training.

Too less Dense Layer will causing your training is far from the best result.

And usually we added Dense Layer at the end of sequence of layers for fitting the number of output to number of classes.

Convolution Layer

This layer for training image datasets.


I have TFlite Model and i want to run checking image on Desktop.

Preparation

Python

If you don’t have Python on your PC then you can install it from: Getting Start with Python.

TFLite Model

You can use my sample TFLite Model. Inside my TFLite model there are 4 labels. indosiar_iklan, indosiar, sctv and sctv_iklan. If you confused with TFLite or Label you can read this.

Execution

The Script

Use following script to run the TFLite

import tensorflow as tf
import cv2.cv2 as cv
import pathlib
import sys
# Load TFLite model and allocate tensors. interpreter = tf.lite.Interpreter(model_path="model.tflite") # Get input and output tensors. input_details = interpreter.get_input_details()…


Checking State from Image with TensorFlow is very easy.

Background Story

One day at office time, i am staring at local TV Channel playing on our App. My job is develop OTT App that provides lot of awesome content and some Local TV Channels. While i am stare at the app i saw something. Something that give me a Wonderfull idea.

I saw an opportunity to adding ads. On local TV Channel when playing ads, i can replace the content with our ads. How we know when is TV Channel playing ads? there is a pattern

The Pattern

Channel TV Playing Content :

Channel…

ade sueb

Still believe, can change the world with code..

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store