728x90
반응형
SMALL
plot_model 함수
keras.utils.plot_model(
model,
to_file="model.png",
show_shapes=False,
show_dtype=False,
show_layer_names=False,
rankdir="TB",
expand_nested=False,
dpi=200,
show_layer_activations=False,
show_trainable=False,
**kwargs
)
model_to_dot 함수
keras.utils.model_to_dot(
model,
show_shapes=False,
show_dtype=False,
show_layer_names=True,
rankdir="TB",
expand_nested=False,
dpi=200,
subgraph=False,
show_layer_activations=False,
show_trainable=False,
**kwargs
)
예시
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
# 모델 생성
model = Sequential()
model.add(Dense(64, activation='relu', input_shape=(10,)))
model.add(Dense(64, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
# 모델 시각화
keras.utils.plot_model(model, to_file='model.png', show_shapes=True, show_layer_names=True)
https://keras.io/api/utils/model_plotting_utils/
728x90
반응형
LIST
'Python Library > Keras' 카테고리의 다른 글
[Keras] 멀티모달 함의 분류 (2) (0) | 2024.04.02 |
---|---|
[Keras] 멀티모달 함의 분류 (1) (0) | 2024.03.30 |
[Keras] ImageDataGenerator class weight (0) | 2023.09.08 |
[Keras] tflite 변환 (0) | 2022.11.24 |
[Keras] ImageDataGenerator (0) | 2022.08.20 |