안녕하세요
27년차 진로탐색꾼 조녁입니다!
오늘은 텐서플로우 자격증 과정 네번째 강좌인
'Sequences, Time Series and Prediction '
4주차 강의(Real-world time series data) 및 자료를 공부했습니다.
드디어 .. 마지막 강의네요. 2월 한달은 중간 중간에 이벤트가 많았던 것도 있지만,
꼬박 한달을 텐서플로우 자격증 공부에 쏟았던 것 같아요.. (부끄럽지만 제가 좀 느립니다)
얼른 끝내고 오늘 시험봐야지!!
첫번째 영상, Week4 - A conversation with Andrew Ng
지금까지 배워온 것들을 실제 데이터(여기서는 sunspots)에 적용시킬 것이다.
CNN, 1D cams , LSTMs, DNN 을 함께 사용해서 흑점 운동에 대한 나이스한 예측을 해보자.
두번째 영상, Convolutions
지난 강의때 사용했던 LSTM 신경망에 Conv1D를 추가했다. 이미지 컨볼루션과 거의 동일하게 작동할 것이다.
세번째 읽기자료, Convolutional neural networks course *딥러닝 전문화 과정 일부임
www.coursera.org/learn/convolutional-neural-networks
Convolutional Neural Networks
deeplearning.ai에서 제공합니다. In the fourth course of the Deep Learning Specialization, you will understand how computer vision has evolved and ... Enroll for free.
www.coursera.org
네번째 영상. Bi-directional LSTMs
그림1 코드에 더해 그림2와 같이 windowed dataset을 정의해주면 mae는 5보다 약간 작은 4.985가 나온다.
그리고 양방향 LSTM을 사용하면, mae가 아주 많이 줄어들지만, 이것은 오버피팅으로 검증 셋에서 mae : 6.21로 더 높아진다.
힌트라며 배치 사이즈를 조절해보라고 함.
다섯번째 읽기자료, More on batch
www.youtube.com/watch?v=4qJaSmvhxi8
여섯번째 영상, LSTM
코드리뷰, 잘 작동하고 있다.
일곱번째 읽기자료, LSTM notebook
gist.github.com/jonhyuk0922/0bf5556baee7f1972af9df8de1ade3bd#file-course4-week-4-lstm-notebook-ipynb
Course4 - week 4 -LSTM notebook
Course4 - week 4 -LSTM notebook. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
여덟번째 영상, Real data - sunspots
1749년 부터 2018년까지의 흑점 데이터(csv) - Kaggle
케글에서 데이터 다운받을 수있고, 제공하는 코랩에는 로렌스가 호스팅해놨다.
csv 파일을 읽을때 1행은 열이름들이 있어서 아래 코드를 사용해준다.
next(reader)
for row in reader:
sunspots.append(float(row[2]))
time_step.append(int(row[0]))
흑점을 시각화 해주면 아래 그림4와 같다,
series = np.array(sunspots)
time = np.array(time_step)
아홉번째 영상, Train and tune the model
간단한 DNN으로 돌아가보자. 아래 그림5와 같이 MAE값(약 19)이 아주 크게 나타난다. 뭔가 잘못됐다.
그래서 윈도우 사이즈를 20-> 132로 늘려줬다. (그 결과 MAE는 23이 넘어감) _ 왜냐면 주기가 11년이라 너무 커도 안 좋다.
그 다음으로, 전체 데이터 갯수가 3,500개이므로 split_time을 1,000 -> 3,000으로 바꿔준다. 그 결과 MAE = 15.144로 비교적 양호해 졌다.
학습 데이터의 수가 늘어났으므로, layer의 뉴런수를 각층마다 10-> 30 , 10 -> 15 , 1 = 1 으로 늘려준다.
그 결과 그림7 처럼 MAE = 14.348로 감소되었다.
마지막으로, 뉴런이 추가되었으므로 학습률(lr)을 1e-6 -> 1e-7로 늦췄더니 MAE =14.1로 약간 더 감소했다.
열번째 영상. Prediction
우리가 사용한 예측이 나쁘지 않았다. 다음 영상에서는 노트북으로 직접 가서 살펴볼 것이다.
열한번째 영상, Sunspots
코드 리뷰
열두번째 읽기자료, Sunspots notebook
Use RNN to predict sunspots : gist.github.com/jonhyuk0922/d280ae7281d248066e916e365098759f#file-course4-week-4-rnn-for-sunspots-ipynb
Course4 - week 4 -RNN for Sunspots
Course4 - week 4 -RNN for Sunspots. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
For fun, use Only DNN to predict sunspots : gist.github.com/jonhyuk0922/18af1b31586fe82dc02540b54bb565cd#file-course4-week-4-dnn-for-sunspots-ipynb
Course4 - week 4 -DNN for Sunspots
Course4 - week 4 -DNN for Sunspots. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
열세번째 영상, Combining our tools for analysis
지금까지 알려준거(Bid LSTM , 각종 하이퍼파라미터 튜닝, CNN, DNN, 학습률 조정 등) 섞어서 결과를 도출해보시오.
퀴즈에서 배운점
과제 : Sunspots
gist.github.com/jonhyuk0922/1c9b1bf0d9924eb20c383054f2953d0b#file-course4-ex4-sunspots-ipynb
Course4-Ex4-Sunspots
Course4-Ex4-Sunspots. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
4주차 마무리 + 축하 영상
Congratulations on getting this far! In this course you've dipped your toe into the water of understanding sequences and some of the tools for predicting them! Hopefully it was a fun journey and we're really looking forward to what you build next! :)
모든 과정의 끝에서 : Tensorflow in practice has come to an end
영상, Specialization wrap up - A conversation with Andrew Ng
수고했고, 더 공부하고 싶으면 다음 강의에서 보자고 하신다. (당분간은 보고싶지 않다.)
읽기자료, What next? *혹시 보고싶을때 들어야지
- Ready to deploy your models to the world? Learn how to go live with your models with the TensorFlow: Data and Deployment Specialization
- Looking to customize and build powerful real-world models for complex scenarios? Check out the TensorFlow: Advanced Techniques Specialization.
TensorFlow: Advanced Techniques
deeplearning.ai에서 제공합니다. Expand your skill set and master TensorFlow. Customize your machine learning models through four hands-on courses! Enroll for free.
www.coursera.org
끝.
'머신러닝 & 딥러닝 공부 > Tensorflow' 카테고리의 다른 글
[Tensorflow developer Certificate] 구글 공인 텐서플로우 개발자 자격증 공부방법 & 합격 후기 (6) | 2021.03.08 |
---|---|
[Tensorflow dev 자격증] Recurrent Neural Networks for Time Series (0) | 2021.03.02 |
[Tensorflow dev 자격증] Deep Neural Networks for Time Series (0) | 2021.03.02 |
[Tensorflow dev 자격증] Sequences and Prediction (2) | 2021.03.01 |
[Tensorflow dev 자격증] Sequence models and literature (0) | 2021.02.25 |