1 of 78

Deep Learning Adventures TensorFlow In Practice - Presentation 5

A quick overview of Courseraโ€™s Tensorflow in Practice specialization course

Robert Kraig, David Patton, George Zoto

https://www.meetup.com/Deep-Learning-Adventures

2 of 78

In the beginning...

3 of 78

Get to know our community

Hello, my name is ___ and I am a new/existing/regular member of this meetup.

I enjoy ___ and I am interested in learning more about ___

Training set ๐Ÿ˜€

Hello, my name is George and I am a regular member of this meetup. I enjoy applying deep learning to solve interesting problems and I am interested in learning more about time series and forecasting.

4 of 78

Not a typical Meetupโ€ฆ Get ready for a fun game on 7/3 ๐Ÿ˜€๐ŸŽ‰

5 of 78

Attribution to Coursera and deeplearning.ai

6 of 78

Chapter 1 - TensorFlow in Practice Specialization

7 of 78

Chapter 1 - TensorFlow in Practice Specialization

8 of 78

Setup

Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud. You can write and execute code, save and share your analyses, and access powerful computing resources, all for free from your browser.

https://colab.research.google.com

9 of 78

Course 4: Sequences, Time Series and Prediction

Week 1: Sequences and Prediction

Week 2: Deep Neural Networks for Time Series

Week 3: Recurrent Neural Networks for Time Series

Week 4: Real-world time series data

10 of 78

Sequences and Prediction

Time series: An ordered sequence of values that are usually equally spaced over time e.g. every day in the weather forecast

Single value at each time step: univariate time series

Multiple values at each time step: multivariate time series

11 of 78

Sequences and Prediction

Movement of a body can also be plotted as a series of univariates or as a combined multivariate

Latitude

Longitude

Coordinates

12 of 78

Sequences and Prediction

13 of 78

Sequences and Prediction

Anomaly detection

Patterns / time series analysis

Imputation

Forecasting

Imputation

14 of 78

Sequences and Prediction

Anomaly detection

15 of 78

Sequences and Prediction

Anomaly detection

Stationary Time Series / Process: Its unconditional joint probability distribution does not change when shifted in time. Consequently, parameters such as mean and variance also do not change over time.

16 of 78

Sequences and Prediction

Anomaly detection

17 of 78

Sequences and Prediction

Anomaly detection

18 of 78

Sequences and Prediction

Anomaly detection

19 of 78

Sequences and Prediction

Anomaly detection

20 of 78

Sequences and Prediction

Anomaly detection

21 of 78

Sequences and Prediction

Anomaly detection

22 of 78

Course 4: Sequences, Time Series and Prediction

Week 1: Sequences and Prediction

Week 2: Deep Neural Networks for Time Series

Week 3: Recurrent Neural Networks for Time Series

Week 4: Real-world time series data

23 of 78

Deep Neural Networks for Time Series

Anomaly detection

24 of 78

Deep Neural Networks for Time Series

25 of 78

Deep Neural Networks for Time Series

26 of 78

Deep Neural Networks for Time Series

27 of 78

Deep Neural Networks for Time Series

28 of 78

Deep Neural Networks for Time Series

29 of 78

Deep Neural Networks for Time Series

30 of 78

Deep Neural Networks for Time Series

31 of 78

Lawrenceโ€™s LR optimization?

For consistent results:

import random

seed = 51

tf.random.set_seed(seed)

random.seed = seed

Set all runs to epochs=500

Restart runtime and run all each test.

32 of 78

Lawrenceโ€™s LR optimization results (seed=51)

  1. optimizer=tf.keras.optimizers.SGD(lr=1e-6, momentum=0.9)

mae 4.500836

  • optimizer = tf.keras.optimizers.SGD(lr=4e-6, momentum=0.9)

mae 4.8579106

  • optimizer = tf.keras.optimizers.Adam(learning_rate=0.001)

mae 5.3804765

  • ReduceLROnPlateau(monitor='loss', patience=25, verbose=1)

optimizer = tf.keras.optimizers.Adam(learning_rate=0.01)

mae 4.490887

33 of 78

Lawrenceโ€™s LR optimization?

For consistent results:

import random

seed = 52

tf.random.set_seed(seed)

random.seed = seed

Set all runs to epochs=500

Restart runtime and run all each test.

34 of 78

Lawrenceโ€™s LR optimization results (seed=52)

  • optimizer=tf.keras.optimizers.SGD(lr=1e-6, momentum=0.9)

mae 4.577156

  • optimizer = tf.keras.optimizers.SGD(lr=2e-6, momentum=0.9)

mae 4.5869045

  • optimizer = tf.keras.optimizers.Adam(learning_rate=0.001)

mae 4.632053

  • ReduceLROnPlateau(monitor='loss', patience=25, verbose=1)

optimizer = tf.keras.optimizers.Adam(learning_rate=0.01)

mae 4.528657

35 of 78

Letโ€™s continue our Time Series adventure ๐Ÿ˜€

36 of 78

Course 4: Sequences, Time Series and Prediction

Week 1: Sequences and Prediction

Week 2: Deep Neural Networks for Time Series

Week 3: Recurrent Neural Networks for Time Series

Week 4: Real-world time series data

37 of 78

Recurrent Neural Networks for Time Series

return_sequences=True

Shape = [batch_size, #time_steps, #dims]

38 of 78

Recurrent Neural Networks for Time Series

39 of 78

Recurrent Neural Networks for Time Series

Loss Function: Huber

40 of 78

Recurrent Neural Networks for Time Series

41 of 78

Recurrent Neural Networks for Time Series

LR: 5e-5

42 of 78

Recurrent Neural Networks for Time Series

Readjust LR: 3e-6

43 of 78

Recurrent Neural Networks for Time Series

LR: 3e-6

LR: 5e-5

44 of 78

Recurrent Neural Networks for Time Series

45 of 78

Recurrent Neural Networks for Time Series

46 of 78

Recurrent Neural Networks for Time Series

47 of 78

Recurrent Neural Networks for Time Series

48 of 78

Recurrent Neural Networks for Time Series

49 of 78

Recurrent Neural Networks for Time Series

50 of 78

Recurrent Neural Networks for Time Series

51 of 78

Recurrent Neural Networks for Time Series

Readjust LR: 3e-6

tanh

linear

ReLU

Leaky ReLU

Validation MAE = 5.67

Validation MAE = 5.44

Validation MAE = 5.71

Validation MAE = 5.41

52 of 78

Recurrent Neural Networks for Time Series

Readjust LR: 3e-6

tanh

linear

ReLU

Leaky ReLU

53 of 78

Letโ€™s continue our Time Series adventure ๐Ÿ˜€

54 of 78

Course 4: Sequences, Time Series and Prediction

Week 1: Sequences and Prediction

Week 2: Deep Neural Networks for Time Series

Week 3: Recurrent Neural Networks for Time Series

Week 4: Real-world time series data

55 of 78

Real-world time series data

56 of 78

Real-world time series data

57 of 78

Real-world time series data

58 of 78

Real-world time series data

59 of 78

Real-world time series data

60 of 78

Real-world time series data

61 of 78

Real-world time series data

62 of 78

Real-world time series data

63 of 78

Real-world time series data

64 of 78

Real-world time series data

65 of 78

Real-world time series data

66 of 78

Real-world time series data

67 of 78

Real-world time series data

68 of 78

Real-world time series data

69 of 78

Course 4: Sequences, Time Series and Prediction

Week 1: Sequences and Prediction

Week 2: Deep Neural Networks for Time Series

Week 3: Recurrent Neural Networks for Time Series

Week 4: Real-world time series data

70 of 78

Letโ€™s continue our Time Series adventure ๐Ÿ˜€

71 of 78

Check out these resources

72 of 78

Check out these resources

73 of 78

Check out these AI for Healthcare resources

74 of 78

Check out this certification and books

75 of 78

Letโ€™s continue our Time Series adventure ๐Ÿ˜€

76 of 78

Time for a fun game ๐Ÿ˜€๐ŸŽ‰

77 of 78

Time for a fun game ๐Ÿ˜€๐ŸŽ‰

78 of 78

Questions

Discussion