Tag: tensorflow
-
Tensorflow: training loop from scratch
The deep learning model has model weights which start from a random state wen the model object is created. As we expose the model with the training data, the weights are modified such that their mathematical operations produce values close to the training labels. Following are the major things that happen during training: If we…
-
Convert class labels to categories using keras
Class labels can be converted to OneHot encoded array using keras.utils.to_categorical.The resultant array has number of rows equal to the number of samples, and number of columns equal to the number of classes. Let’s take an example of an arrray containing labels.First we need to import numpy to create the labels array and then define the labels array. The labels contain four…
-
Tensorflow: The History object
To train a tensorfow model, we call the fit() method of the model as follows: Python The fit() method returns something called as a History object. It stores the epochwise values of the loss and any metrics we have asked the model to track. These records can be used to visualize how the training process occurred and potentially help us modify…
-
Tensorflow: Basic deep learning workflow for classification task
In our first project of tensorflow, we used the fashion-mnist data to make a simple deep learning model to identify whether any given image is of a trouser or a bag. We labelled the trouser images as class 0, and images of bag as class 1. In our neural network, the last output layer was as follows: Python As…
-
Tensorflow: The first project
We will try to build a deep learning model that differentiates between images of two kinds of objects. For this we will use the fashion mnist data which could be readily used from the keras API included with tensorflow. First import the necessary packages. Python Read data included in the keras library. Python Let’s first see the size…