해당 내용은 Laurence Moroney 교수님의 Coursera의 TensorFlow Developer Professional Certificate의 3주차 강의 Enhancing Vision with Convolutional Neural Networks 를 듣고 정리한 내용이다.
자격증 쿠폰이 있는데 왜 따질 못하니...!!! ㅇ0ㅇ
화이팅 빠샤
조금만 더....ㅜ
1. 실험실 1
fashion mnist datasets 사용
(1)dnn 사용
(2) 이전과 동일한 신경망이지만 이번에는 Convolution 및 MaxPooling 레이어 추가
# Define the model
model = tf.keras.models.Sequential([
# Add convolutions and max pooling
tf.keras.layers.Conv2D(32, (3,3), activation='relu', input_shape=(28, 28, 1)),
tf.keras.layers.MaxPooling2D(2, 2),
tf.keras.layers.Conv2D(32, (3,3), activation='relu'),
tf.keras.layers.MaxPooling2D(2,2),
# Add the same layers as before
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(128, activation='relu'),
tf.keras.layers.Dense(10, activation='softmax')
])
# Print the model summary
model.summary()
# Use same settings
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
# Train the model
print(f'\nMODEL TRAINING:')
model.fit(training_images, training_labels, epochs=5)
# Evaluate on the test set
print(f'\nMODEL EVALUATION:')
test_loss = model.evaluate(test_images, test_labels)
매개변수는 다음과 같습니다.
|
컨볼루션 수 1
컨볼루션 수 10
컨볼루션을 그래픽으로 보여주는 방법을 알아보겠습니다. 아래 셀은 테스트 세트에서 처음 100개의 레이블을 인쇄하고, 인덱스 0, 인덱스 23 및 인덱스 28에 있는 레이블은 모두 동일한 값입니다(즉, 9). 모두 신발입니다. 컨볼루션을 각각 실행한 결과를 살펴봅시다. 그러면 두 레이블 사이의 공통점이 드러나기 시작할 것입니다. 밀도가 높은 레이어가 해당 데이터를 학습할 때 훨씬 적은 작업을 수행하고 있으며, 이 컨볼루션/풀링 조합을 기반으로 신발 간의 공통점을 찾는 것일 수도 있습니다. |
오늘은 집중이 안 돼서 여기까지..!
'coursera강의 > TensorFlow Certificate' 카테고리의 다른 글
TensorFlow Developer Professional Certificate [3]-3 (0) | 2024.06.20 |
---|---|
TensorFlow Developer Professional Certificate [1] - 2 (0) | 2024.03.04 |
TensorFlow Developer Professional Certificate [1] (0) | 2024.02.23 |