Tool(9)
-
3. Introduction to gradients and automatic differentiation
In this guide, you will explore ways to compute gradients with TensorFlow especially in eager execution. import numpy as np import matplotlib.pyplot as plt import tensorflow as tf Computing gradients To differentiate automatically, TensorFlow needs to remember what operations happen in what order during the forward pass. Then, during the backward pass, TensorFlow traverses this list of operation..
2022.03.12 -
2. Introduction to Variables
A TensorFlow variable is the recommanded way to represent shared, persistent state your program manipulates. This guide covers how to create, update, and manage instances of tf.Variable in Tensorflow. Higher level libraries like tf.keras use lf.Variable to store model parameters. import tensorflow as tf Create a variable To create a variable, provide an initial value. The tf.Variable will have t..
2022.03.12 -
1. Introduction to Tensors
import numpy as np import tensorflow as tf Basic Tensors are multi-dimensional arrays with a uniform type (called a dtype). All tensors are immutable like Python numbers and strings: you can never update the contents of a tensor, only create a new one. # Python number num = 123 # Tensorflow Tensor tensor = tf.constant([1, 2]) # Before num address print("Before num address: ", id(num)) # Before t..
2022.03.12