[Coursera] DeepLearning.AI TensorFlow Developer ( Tensorflow In Practice ) 강의 정리
Course 1 : Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning
- Week 1 - A New Programming Paradigm
- Week 2 - Introduction to Computer Vision
- Week 3 - Enhancing Vision with Convolutional Neural Networks
- Week 4 - Using Real-world Images
Course 2 : Convolutional Neural Networks in TensorFlow
Course 3 : Natural Language Processing in TensorFlow
Course 4 : Sequences, Time Series and Prediction
Week 4 - Using Real-world Images
Understanding ImageGenerator
ImageGenerator 모듈
1 | |
Train 폴더
1 | |
상위 디렉토리 위치를 설정해야 함
train_dir - train 이미지가 포함 된 하위 디렉토리
target_size=(150, 150) - 이미지 사이즈 조정
class_mode='binary' - 이진분류
validation 폴더
1 | |
validation_dir - test 이미지가 포함 된 하위 디렉토리
Defining a ConvNet to use complex images
사람 / 말 분류에 사용한 신경망
1 | |
이전 강의보다 이미지 복잡성과 크기를 반영하여, 세 개 convolutional, pooling layers 사용
input_shape=(300, 300, 3) - 300 x 300 사이즈와 컬러이미지(빨간색, 초록색, 파란색)
tf.keras.layers.Dense(1, activation='sigmoid') - sigmoid는 0 or 1이므로, 1로 출력
Training the ConvNet with fit_generator
1 | |
loss='binary_crossentropy' - 사람 / 말 이진분류로 binary_crossentropy 선택
optimizer=RMSprop(lr=0.001) - Learning Rate 조절
이미지 생성은 model.fit() 아닌 model.fit_generator() 사용
1 | |
train_generator - 위의 train_generator 호출
steps_per_epoch=8 - train image 1024개. 1024/8로 한 번에 128개 처리
validation_data=validation_generator - validation 호출
validation_steps=8 - test image 256개. 256/8로 한 번에 32개 처리
verbose=2 - 진행사항 시각화 정도
전체코드
1 | |
https://www.coursera.org/professional-certificates/tensorflow-in-practice