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)
- New Features in TensorFlow 2.0
- Verify Eager Execution and Find GPU Devices
- Common Use Operations
- Linear Algebra Operations
- Calculating Gradients with Gradient Tape
- Functions in TensorFlow with tf.function
- 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/