TensorFlow Tutorial
Welcome to this week's programming assignment. Until now, you've always used numpy to build neural networks. Now we will step you through a deep learning
framework that will allow you to build neural networks more easily. Machine learning frameworks like TensorFlow, PaddlePaddle, Torch, Caffe, Keras, and many
others can speed up your machine learning development significantly. All of these frameworks also have a lot of documentation, which you should feel free to read.
In this assignment, you will learn to do the following in TensorFlow:
Initialize variables
Start your own session
Train algorithms
Implement a Neural Network
Programing frameworks can not only shorten your coding time, but sometimes also perform optimizations that speed up your code.
1 - Exploring the Tensorflow Library
To start, you will import the library:
In[3]:
Now that you have imported the library, we will walk you through its different applications. You will start with an example, where we compute for you the loss of one
training example.
loss
=
( ,
y
) = (
−
y
y
(
i
)
y
(
i
)
)
2
(1)
import
math
import
numpy
as
np
import
h5py
import
matplotlib.pyplot
as
plt
import
tensorflow
as
tf
from
tensorflow.python.framework
import
ops
from
tf_utils
import
load_dataset, random_mini_batches, convert_to_one_hot, predict
%
matplotlib inline
np.random.seed(1)
评论0