[혼자 공부하는 머신러닝 + 딥러닝] p.476 질문입니다.

28 views
Skip to first unread message

harang4282

unread,
Feb 16, 2021, 2:28:30 AM2/16/21
to 머신러닝/딥러닝 도서 Q&A
책 476페이지 손코딩
conv2_acti = keras.models.Model(model.input, model.layers[2].output)
함수형 API를 만들때 이  model.layers[2].output의 값은 어떻게 해서 나오는 값인가요?
앞에서 만들었던 2*conv+ 2*pooling ~~ 'model' 모델에 model.input값이 이 모델의 전부를 거쳐서 나오는 것인가요?
models.Model 클래스는 그럼 output이나 input에 입력한 모델의 일부(model.layers[n].output 등등)를 보고, 전체 model을 알아낼 수 있는 것인가요? 

model의 2번째 레이어 출력값의 결과를 알기위해서
conv0_acti = keras.models.Model(model.input, model.layers[0].output)  
conv1_acti = keras.models.Model( model.layers[0].output , model.layers[1].output)
conv2_acti = keras.models.Model( model.layers[1].output model.layers[2].output)   

왜 이런식으로 한개씩 거쳐가지 않는 것인가요?

Haesun Park

unread,
Feb 19, 2021, 1:03:57 AM2/19/21
to harang4282, 머신러닝/딥러닝 도서 Q&A
안녕하세요. 알림 메일이 스팸함에 있어서 회신이 늦었네요.
model.layers[2].output은 첫 번째 합성곱, 그다음 맥스풀링함수, 그다음 합성곱을 거쳐서 나온 출력입니다.
케라스 모델은 summary() 메서드를 사용해 전체 구조를 알 수 있습니다.
모델 중간 값을 얻기 위해 번거롭게 모든 층을 차례대로 호출할 필요가 있을까요? :)
감사합니다.

2021년 2월 16일 (화) 오후 4:28, harang4282 <tofh...@naver.com>님이 작성:
--
이 메일은 Google 그룹스 '머신러닝/딥러닝 도서 Q&A' 그룹에 가입한 분들에게 전송되는 메시지입니다.
이 그룹에서 탈퇴하고 더 이상 이메일을 받지 않으려면 ml-dl-book-qn...@googlegroups.com에 이메일을 보내세요.
웹에서 이 토론을 보려면 https://groups.google.com/d/msgid/ml-dl-book-qna/e423c20a-91a5-4237-873f-3806724a9ae9n%40googlegroups.com을(를) 방문하세요.
Reply all
Reply to author
Forward
0 new messages