본문 바로가기

AI & 머신러닝 coding skill56

[CONVOLUTIONAL NEURAL NETWORKS IN TENSORFLOW] Horses vs. humans using Transfer Learning 코세라의 deeplearning.AI tensorflow developer 전문가 자격증 과정내에 Convolutional Neural Networks in TensorFlow 과정의 3주차 Transfer Learning 챕터의 코드 예제입니다. 1) 다른 사람이 이미 training 시켜 놓은 layer와 weight를 이용하여 모델을 구성할 수 있다. InceptionV3 model와 weight를 다운로드받는다. 2) 내 모델의 input으로 쓰일 Inception model의 'mixed7' layer의 output을, last_output 으로 선언한다. 3) last_output을 input으로 사용할 수 있도록, flatten하고 내 모델의 dense layer에 입력으로 넣는다. 4) d.. 2020. 11. 16.
[CONVOLUTIONAL NEURAL NETWORKS IN TENSORFLOW] Full cats vs. dogs using augmentation 코세라의 deeplearning.AI tensorflow developer 전문가 자격증 과정내에 Convolutional Neural Networks in TensorFlow 과정의 2주차 Augmentation: A technique to avoid overfitting 챕터의 코드 예제입니다. 1) cats and dogs dataset 다운로드 2) Training set과 Test set 디렉토리 경로 설정 3) image dataset을 traing set과 test set으로 나누는 spilt_data함수 구현 4) Conv2D 3개 layer을 이용한 모델 구성 5) preprocessing.image name space의 ImageDataGenerator를 이용해서, 밝기를 1/255로 .. 2020. 11. 16.
[CONVOLUTIONAL NEURAL NETWORKS IN TENSORFLOW] Attempt the cats vs. dogs Kaggle challenge! 코세라의 deeplearning.AI tensorflow developer 전문가 자격증 과정내에 Convolutional Neural Networks in TensorFlow 과정의 1주차 Exploring a Larger Dataset 챕터의 코드 예제입니다. Attempt the cats vs. dogs Kaggle challenge! 1) cats and dogs dataset 다운로드 2) Training set과 Test set 디렉토리 경로 설정 3) image dataset을 traing set과 test set으로 나누는 spilt_data함수 구현 4) Conv2D 3개 layer을 이용한 모델 구성 5) preprocessing.image name space의 ImageDataGene.. 2020. 11. 16.
[INTRODUCTION TO TENSORFLOW FOR ARTIFICIAL INTELLIGENCE, MACHINE LEARNING, AND DEEP LEARNING] Handling Complex Images 코세라의 deeplearning.AI tensorflow developer 전문가 자격증 과정내에 Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning 과정의 4주차 Using Real-world Images 챕터의 코드 예제입니다. Handling Complex Images 1) Happy or Sad image dataset를 받는다 2) myCallback함수에 traing accuracy가 99.9%이상이되면 훈련을 멈추도록 구현한다. 3) Conv2D를 이용한 네트워크를 구성한다. 4) preprocessing.image name space의 ImageDataGenerator를 이용해서.. 2020. 11. 16.
[INTRODUCTION TO TENSORFLOW FOR ARTIFICIAL INTELLIGENCE, MACHINE LEARNING, AND DEEP LEARNING] Improving DNN Performance using Convolutions 코세라의 deeplearning.AI tensorflow developer 전문가 자격증 과정내에 Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning 과정의 3주차 Enhancing Vision with Convolutional Neural Networks 챕터의 코드 예제입니다. Improving DNN Performance using Convolutions 1) Convolution 2D layer, Max pooling layer를 2개 층을 쌓는다. 2) 마지막에 dense layer를 추가한다. Dense layer만 쓴 것 보다, 정확도가 더 좋아진다. #!/usr/bin/env p.. 2020. 11. 16.
[INTRODUCTION TO TENSORFLOW FOR ARTIFICIAL INTELLIGENCE, MACHINE LEARNING, AND DEEP LEARNING] Implement a Deep Neural Network to recognize handwritten digits 코세라의 deeplearning.AI tensorflow developer 전문가 자격증 과정내에 Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning 과정의 2주차 Introduction to Computer Vision챕터의 코드 예제입니다. Implement a Deep Neural Network to recognize handwritten digits Handwriting Recognition예제 1) MNIST dataset을 이용해서 모델 학습 2) 각 픽셀의 밝기값을 225로 나눠서 정규화 3) 28x28의 2차원 픽셀 데이터를 1차원으로 flatten하여 모델에 입력되도록 함 4).. 2020. 11. 16.
[INTRODUCTION TO TENSORFLOW FOR ARTIFICIAL INTELLIGENCE, MACHINE LEARNING, AND DEEP LEARNING] Housing Prices 코세라의 deeplearning.AI tensorflow developer 전문가 자격증 과정내에 Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning 과정의 1주차 A New Programming Paradigm 챕터의 코드 예제입니다. Your First Neural Network 1) ys에 따른 xs 데이터를 준비 2) Dense unit 1개의 뉴럴 네트워크 모델 생성 3) medel.predict로 새로운 y 7.0 에 대응하는 x를 예측한다. #!/usr/bin/env python # coding: utf-8 # In this exercise you'll try to build a .. 2020. 11. 16.
[SEQUENCES, TIME SERIES AND PREDICTION] Real data Sunspots 예측 코세라의 deeplearning.AI tensorflow developer 전문가 자격증 과정내에 Sequences, Time Series and Prediction 과정의 4주차 Real world time series data 챕터의 코드 예제입니다. multi LSTM layer를 사용하여 11년 주기성을 갖는 sunspots 실재 데이터를 traning하여 예측하는 코드 예제입니다. import numpy as np import matplotlib.pyplot as plt def plot_series(time, series, format="-", start=0, end=None): plt.plot(time[start:end], series[start:end], format) plt.xlabel(".. 2020. 11. 12.
[SEQUENCES, TIME SERIES AND PREDICTION] multi layer LSTM for time series 코세라의 deeplearning.AI tensorflow developer 전문가 자격증 과정내에 Sequences, Time Series and Prediction 과정의 4주차 Real world time series data 챕터의 코드 예제입니다. multi LSTM layer를 사용한 time series data forcasting 코드 예제입니다. LSTM layer에서 return_sequences = True로 해야, 다음 layer에 입력 길이 만큼 아웃풋으로 전달할 수 있습니다. import tensorflow as tf import numpy as np import matplotlib.pyplot as plt print(tf.__version__) def plot_series(tim.. 2020. 11. 11.
[SEQUENCES, TIME SERIES AND PREDICTION] Mini batch gradient descent DNN에서 time serise data를 traning할 때, batch data가 많으면, traing에 오랜 시간이 걸린다. 그래서, batch중에 선정한 mini batch를 이용해서 빠르게 gradient descent를 진행하는 것이 traing에 더 빠른 효과가 있다. 아래는 관련 유튜브 강의이니 참고하기 바란다. www.youtube.com/watch?v=4qJaSmvhxi8 2020. 11. 11.
[SEQUENCES, TIME SERIES AND PREDICTION] RNN, LSTM for time series 코세라의 deeplearning.AI tensorflow developer 전문가 자격증 과정내에 Sequences, Time Series and Prediction 과정의 3주차 RNN for time series 챕터의 코드 예제입니다. RNN으로 이전 window의 time series data를 보고 window 바로 직후의 data를 예측한다. import tensorflow as tf import numpy as np import matplotlib.pyplot as plt print(tf.__version__) def plot_series(time, series, format="-", start=0, end=None): plt.plot(time[start:end], series[start:e.. 2020. 11. 11.
[SEQUENCES, TIME SERIES AND PREDICTION] Deep neural network for time series 예측 코세라의 deeplearning.AI tensorflow developer 전문가 자격증 과정내에 Sequences, Time Series and Prediction 과정의 2주차 Deep neural network for time series 챕터의 코드 예제입니다. DNN으로 이전 window의 time series data를 보고 window 바로 직후의 data를 예측한다. 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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 .. 2020. 11. 11.