C.W.K.
Stream
Lesson 06 of 07 · published

Graph 검사하기

~8 min · functional

Level 0Keras 도제
0 XP0/97 lessons0/20 achievements
0/120 XP to next level120 XP to go0% complete

Functional model 은 graph 가 코드에 박혀있어서 정적 검사 가능. model.summary() 로 각 layer 의 input/output 보고, keras.utils.plot_model(model, to_file='model.png', show_shapes=True) 로 시각화. graphviz 설치 필요.

복잡한 architecture (멀티 입출력, skip) 디버깅 시 plot 한 번이 백 줄 print 보다 빠름. 학습 전 sanity check 로 강추.

Code

# Print architecture
model.summary()

# Generate a diagram (requires pydot/graphviz)
keras.utils.plot_model(model, show_shapes=True, show_layer_names=True)

# Inspect intermediate outputs for debugging
intermediate_model = keras.Model(
    inputs=model.input,
    outputs=model.get_layer("dense_2").output,
)
intermediate_output = intermediate_model.predict(sample_data)

External links

Exercise

앞에서 만든 siamese 또는 ResNet block 가져와. plot_model 출력 생성하고 graph 시각적으로 검사 — 의도한 모양 맞아?

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.