0%

DeepLearning.AI TensorFlow Developer 筆記

TensorFlow Developer 筆記

DeepLearning.AI TensorFlow Developer 专业证书 (總課程連結)

Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning

Convolutional Neural Networks in TensorFlow

Natural Language Processing in TensorFlow

Sequences, Time Series and Prediction

Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning

Week 1 A New Programming Paradigm

Before you begin: TensorFlow 2.0 and this course

Introduction: A conversation with Andrew Ng

A primer in machine learning

NewParadigm

The ‘Hello World’ of neural networks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import tensorflow as tf
from tensorflow import keras
import numpy as np

model = tf.keras.Sequential([keras.layers.Dense(units=1, input_shape=[1])])

model.compile(optimizer='sgd', loss='mean_squared_error')

xs = np.array([-1.0, 0.0, 1.0, 2.0, 3.0, 4.0], dtype=float)
ys = np.array([-3.0, -1.0, 1.0, 3.0, 5.0, 7.0], dtype=float)

model.fit(xs, ys, epochs=500)

print(model.predict([10.0]))

From rules to data

Working through ‘Hello World’ in TensorFlow and Python

Get started with Google Colaboratory (Coding TensorFlow)

Try it for yourself

GitHub Course 1 - Part 2 - Lesson 2 - Notebook.ipynb
Colab Course 1 - Part 2 - Lesson 2 - Notebook.ipynb

Week 1 Quiz (升級後提交)

Weekly Exercise - Your First Neural Network

Introduction to Google Colaboratory

Frequently Asked Questions

Get started with Google Colaboratory (Coding TensorFlow) - YouTube

Exercise 1 (Housing Prices) (升級後提交)

编程作业: Exercise 1 (Housing Prices) (升級後提交)

Week 1 Resources

Optional: Ungraded Google Colaboratory environment

Exercise 1 (Housing Prices)

Colab Exercise_1_House_Prices_Question.ipynb

Week 2 Introduction to Computer Vision

A Conversation with Andrew Ng

An Introduction to computer vision

Exploring how to use data

GitHub Fashion-MNIST

Writing code to load training data

The structure of Fashion MNIST data

Responsible AI practices

Coding a Computer Vision Neural Network

Flatten Layer Shaping
Neural Network Overview (C1W3L01)

See how it’s done

Walk through a Notebook for computer vision

Get hands-on with computer vision

Colab Course 1 - Part 4 - Lesson 2 - Notebook.ipynb

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import tensorflow as tf
print(tf.__version__)

mnist = tf.keras.datasets.fashion_mnist

(training_images, training_labels), (test_images, test_labels) = mnist.load_data()

import numpy as np
np.set_printoptions(linewidth=200)
import matplotlib.pyplot as plt
#Display image as grayscale using matplotlib
#https://stackoverflow.com/questions/3823752/display-image-as-grayscale-using-matplotlib
#plt.imshow(training_images[0])
plt.imshow(training_images[0], cmap='gray', vmin=0, vmax=255)
print(training_labels[0])
print(training_images[0])

training_images = training_images / 255.0
test_images = test_images / 255.0

model = tf.keras.models.Sequential([tf.keras.layers.Flatten(),
tf.keras.layers.Dense(128, activation=tf.nn.relu),
tf.keras.layers.Dense(10, activation=tf.nn.softmax)])

model.compile(optimizer = tf.optimizers.Adam(),
loss = 'sparse_categorical_crossentropy',
metrics=['accuracy'])

model.fit(training_images, training_labels, epochs=5)

model.evaluate(test_images, test_labels)

classifications = model.predict(test_images)

print(classifications[0])

print(test_labels[0])

Using Callbacks to control training

On Epoch End
Callbacks

See how to implement Callbacks

Colab Course 1 - Part 4 - Lesson 4 - Notebook.ipynb

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import tensorflow as tf

class myCallback(tf.keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs={}):
if(logs.get('accuracy')>0.6):
print("\nReached 60% accuracy so cancelling training!")
self.model.stop_training = True

mnist = tf.keras.datasets.fashion_mnist

(x_train, y_train),(x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0

callbacks = myCallback()

model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(input_shape=(28, 28)),
tf.keras.layers.Dense(512, activation=tf.nn.relu),
tf.keras.layers.Dense(10, activation=tf.nn.softmax)
])
model.compile(optimizer=tf.optimizers.Adam(),
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])

model.fit(x_train, y_train, epochs=10, callbacks=[callbacks])

Walk through a notebook with Callbacks

Week 2 Quiz (升級後提交)

Exercise 2 (Handwriting Recognition) (购买订阅以解锁此项目。)

编程作业: Exercise 2 (升級後提交)

Weekly Exercise - Implement a Deep Neural Network to recognize handwritten digits

Week 2 Resources

Beyond Hello, World - A Computer Vision Example

Exploring Callbacks

Exercise 2 - Handwriting Recognition - Answer

Optional: Ungraded Google Colaboratory environment

Exercise 2 (Handwriting Recognition)

Colab Exercise2-Question.ipynb

Week 3 Enhancing Vision with Convolutional Neural Networks

A conversation with Andrew Ng

What are convolutions and pooling?

Coding convolutions and pooling layers

tf.keras.layers.Conv2D
tf.keras.layers.MaxPool2D

Implementing convolutional layers

Implementing convolutional layers code

  • 64 個 3*3 的 filter
    • beyond the scope of this class
    • they aren’t random. They start with a set of known good filters in a similar way to the pattern fitting that you saw earlier
  • relu 表示負值會被丟棄
  • 1 表示顏色為灰階
  • For more details on convolutions and how they work, there’s a great set of resources here.
    Convolutional Neural Networks

Learn more about convolutions

Convolutional Neural Networks playlist

Implementing pooling layers

Implementing pooling layers code
Implementing pooling layers code

28->26
13->11
Implementing pooling layers code
Implementing pooling layers code

Getting hands-on, your first ConvNet

Improving the Fashion classifier with convolutions

Try it for yourself

Colab Course 1 - Part 6 - Lesson 2 - Notebook.ipynb

Walking through convolutions

Experiment with filters and pools

Colab Course 1 - Part 6 - Lesson 3 - Notebook.ipynb

Lode’s Computer Graphics Tutorial Image Filtering

Week 3 Quiz (升級後提交)

Weekly Exercise - Improving DNN Performance using Convolutions

Exercise 3 (Improve MNIST with convolutions) 购买订阅以解锁此项目。

编程作业: Exercise 3 (Improve MNIST with convolutions)) (升級後提交)

Week 3 Resources

Adding Convolutions to Fashion MNIST
Exploring how Convolutions and Pooling work

Optional: Ungraded Google Colaboratory environment

Exercise 3 - Improve MNIST with convolutions

Exercise 3 - Question.ipynb

(未完待續)