[도서완독]Hands On Machine Learning
-
[HandsOn]11. 심층 신경망 훈련하기 - 내용 정리 2[도서완독]Hands On Machine Learning 2022. 7. 6. 18:39
11.2 사전훈련된 층 재사용하기 전이 학습(transfer learning) 아주 큰 규모의 DNN을 처음부터 새로 훈련하는 것은 힘듬... 비슷한 유형의 문제를 처리한 신경망이 이미 있는지 찾고, 그 신경망의 하위층을 재사용하는 것이 좋다. 훈련 속도, 훈련 데이터의 양 면에서 좋음 이미지, 텍스트 데이터에 주로 쓰인다고 함! ❓그럼 모든 DNN을 짤 때 신경망을 좀 서치하는 게 좋은건가? ❗요즘은 텐서플로 내부에 유명한 모델 구조는 다 패키지로 제공된다고 함. 단, 이미지 텍스트 데이터 한정...😂 ❗ 정형 데이터는 적당히 dense 여러개 쌓으면 웬만하면 된다고 하는데... 원본 모델의 출력층 바꾸어야 함. 원본 모델의 상위 은닉층은 하위 은닉층보다 덜 유용함. -> 재사용할 층 개수를 잘 선정하..
-
[HandsOn]11. 심층 신경망 훈련하기 - 내용 정리 1[도서완독]Hands On Machine Learning 2022. 7. 5. 15:51
10장에서 얕은 네트워크를 훈련해 보았다. 아주 복잡한 문제를 다뤄야 한다면? 아마도 수백 개의 뉴런으로 구성된 10개 이상의 층을 수십만 개의 가중치로 연결해 훨씬 더 깊은 신경망을 훈련해야 할 것... 훈련중 마주칠 수 있는 문제: 그레이디언트 소실 또는 그레이디언트 폭주 문제 대규모 신경망을 위한 훈련 데이터가 충분하지 않거나, 레이블을 만드는 작업에 비용이 너무 많이 들어갈 수 있음 훈련이 너무 느려짐 수백만 개의 파라미터를 가진 모델이 훈련 세트에 과대적합될 위험이 매우 큼. 특히 훈련 샘플이 충분하지 않거나 잡음이 많은 경우 그럼 그레이디언트 소실과 그레이디언트 폭주 문제의 널리 알려진 해결 방법 레이블 된 데이터가 적을 때 도움이 되는 전이 학습과 비지도 사전훈련 대규모 모델의 훈련 속도를 ..
-
[HandsOn]10. 케라스를 사용한 인공 신경망 - 내용 정리 3[도서완독]Hands On Machine Learning 2022. 7. 1. 21:42
10.2.4 함수형 API를 사용해 복잡한 모델 만들기 순차적이지 않은 신경망의 예. 복잡한 패턴과 간단한 규칙을 모두 학습할 수 있다. 이런 신경망을 만들어서 캘리포니아 주택 문제를 해결해보자! input_=keras.layers.Input(Shape=X_train.shape[1:]) hidden1=keras.layers.Dense(30,activation='relu')(input_) hidden2=keras.layers.Dense(30,activation='relu')(hidden1) concat=keras.layers.Concatenate()([input_,hidden2]) output=keras.layers.Dense(1)(concat) model=keras.Model(inputs=[input_]..
-
[HandsOn]10. 케라스를 사용한 인공 신경망 - 내용 정리2[도서완독]Hands On Machine Learning 2022. 7. 1. 17:16
10.2 케라스로 다층 퍼셉트론 구현하기 10.2.2 시퀀셜 API를 사용하여 이미지 분류기 만들기 케라스를 사용하여 패션 MNIST 적재 픽셀 강도가 정수(0~255)로 되어 있음 경사 하강법으로 신경망 훈련하기 때문에 입력 특성의 스케일을 조정해야 함 MSE 데이터에 잡음이 많기 때문에 과대적합을 막는 용도로 뉴런 수가 적은 은닉층 하나만 사용했다고 함. 여튼 시퀀셜 API는 매우 쉽당. 하지만 입력,출력이 여러 개거나 더 복잡한 신경망을 만들어야 할 때, 함수형(functional API)를 사용한다! 그건 다음 포스팅에서!
-
[HandsOn]10. 케라스를 사용한 인공 신경망 - 내용 정리1[도서완독]Hands On Machine Learning 2022. 6. 28. 19:36
1~2 3. 10.2.3까지 인공 신경망의 초창기 구조를 간단히 소개 다층 퍼셉트론(MLP) 소개 케라스 API를 사용하여 인공 신경망을 구현하는 방법 10.1 생물학적 뉴런에서 인공 뉴런까지 현재는 인공 신경망의 또 다른 부흥기 신경망을 훈련하기 위한 데이터가 많아짐. 인공신경망은 규모가 크고 복잡한 문제에서 머신러닝 기법보다 좋은 성능을 냄 컴퓨터 하드웨어의 발전, GPU 카드의 생산, 클라우드 플랫폼 훈련 알고리즘의 향상 투자와 진보의 선순환 10.1.2 뉴런을 사용한 논리 연산 생물학적 뉴런에서 착안한 매우 단순한 신경망 모델 제안-> 이것이 나중에 인공 뉴런이 됨 하나 이상의 이진(on/off) 입력과 이진 출력을 가짐 1. 항등 함수: A가 활성화되면 C 활성화. 반대로는 꺼짐 2. 논리곱 연..
-
[HandsOn]12. 텐서플로를 사용한 사용자 정의 모델과 훈련 - 연습문제[도서완독]Hands On Machine Learning 2022. 2. 15. 17:14
https://github.com/rickiepark/handson-ml2/blob/master/12_custom_models_and_training_with_tensorflow.ipynb GitHub - rickiepark/handson-ml2: 핸즈온 머신러닝 2/E의 주피터 노트북 핸즈온 머신러닝 2/E의 주피터 노트북. Contribute to rickiepark/handson-ml2 development by creating an account on GitHub. github.com 답안은 여기를 참고하였다! 정말 어렵지만 내맘대로 커스텀한 모델을 짜기 위해선 필수적이니 꼭 알아두도록 하자. 절대 첫 번째에 익숙해지지 않으니 보고 또 볼 것! 12. 사용자 정의 모델과 훈련 알고리즘 1. 사용자..
-
[HandsOn]11.심층 신경망 훈련하기- 연습문제[도서완독]Hands On Machine Learning 2022. 1. 19. 18:06
'핸즈온 완독'프로젝트 2탄! https://book.naver.com/bookdb/book_detail.nhn?bid=16328592 핸즈온 머신러닝 머신러닝 전문가로 이끄는 최고의 실전 지침서 텐서플로 2.0을 반영한 풀컬러 개정판 『핸즈온 머신러닝』은 지능형 시스템을 구축하려면 반드시 알아야 할 머신러닝, 딥러닝 분야 핵심 개념과 book.naver.com 11장은 MLP에서 좀 더 심층으로 갔을 때 속도나 성능을 향상시키는 방법을 다루고 있다. 문제를 풀면서 내가 이해한 것들, 모르는 것들을 기록하려고 한다. 정답 코드는 여기에! https://github.com/rickiepark/handson-ml2/blob/master/11_training_deep_neural_networks.ipynb G..
-
[HandsOn]10. 케라스를 사용한 인공 신경망- 연습문제[도서완독]Hands On Machine Learning 2022. 1. 12. 12:09
신년 목표로 '핸즈온 머신러닝' 책을 완독하기로 결심했다. https://book.naver.com/bookdb/book_detail.nhn?bid=16328592 핸즈온 머신러닝 컬러판으로 돌아온 아마존 인공지능 분야 부동의 1위 도서이 책은 지능형 시스템을 구축하려면 반드시 알아야 할 머신러닝, 딥러닝 분야 핵심 개념과 이론을 이해하기 쉽게 설명한다. 사이킷런, book.naver.com 엄청나게 두껍다! 전에 보던 '머신러닝 완벽 가이드'보다 더 깊고 방대한 내용을 담고 있다. 이제 겨우 1장 끝냈지만... 천리 길도 한 걸음부터! 이니깐 열심히 해봐야지. 해당 책은 연습문제에서 한 문제 정도를 코딩을 직접 해 볼수 있도록 하고 있다. 같이 풀어보자! 10. 심층 다층 퍼셉트론을 MNIST 데이터셋..