Cancel Preloader

TensorFlow 2.0 Tutorial in 10 Minutes

 TensorFlow 2.0 Tutorial in 10 Minutes
TensorFlow 2.0 Tutorial in 10 Minutes

TensorFlow is inevitably the package to use for Deep Learning, if you are doing any sort of business. Keras is the standard API in TensorFlow and the easiest way to implement neural networks. Deployment is much easier, compared to PyTorch – so unless you are doing research, TensorFlow is most likely the way to go.

And even then, you should go with TensorFlow because your models will be easier for the industry to adopt in production.

The most important parts of this article is at the end, so stick around! I will show you how to use TensorFlow functions and also how to make a custom training and testing class.

TensorFlow also seem to be much more popular than PyTorch:

It's possible to find all the documentation for TensorFlow on this link.

This article is possible to follow solely based on the Colab notebook provided here. I wish for you to comment on this post if there is any confusion. With that said, let's jump right into TensorFlow version 2.0.

Table of Contents (Click To Scroll)

  1. New Features in TensorFlow 2.0
  2. Verify Eager Execution and Find GPU Devices
  3. Common Use Operations
  4. Linear Algebra Operations
  5. Calculating Gradients with Gradient Tape
  6. Functions in TensorFlow with tf.function
  7. Custom Train and Test Functions for Neural Network

New Features in TensorFlow 2.0

TensorFlow 2.0 is mostly a marketing move and some cleanup in the TensorFlow API. Nevertheless, whenever you consider doing deep learning and want to deploy a model, you will find yourself using TensorFlow.

Let's start off with a simple way to install / upgrade both the CPU and GPU version of TensorFlow in one line of code. This is not default in the popular Google Colab app yet, but it's rumored to arrive soon.

!pip install --upgrade tensorflow-gpu

All of the upcoming code in this article presumes that you have imported the tensorflow package in your Python program.

import tensorflow as tf

You should verify that you are running the correct version, TensorFlow 2.0,

[...]

Source - Continue Reading: https://mlfromscratch.com/tensorflow-2/

webmaster

Related post