我的模型定义如下:
model = keras.models.Sequential()
model.add(layers.Embedding(max_features, 128, input_length=max_len,
input_shape=(max_len,), name='embed'))
model.add(layers.Conv1D(32, 7, activation='relu'))
model.add(layers.MaxPooling1D(5))
model.add(layers.Conv1D(32, 7, activation='relu'))
model.add(layers.GlobalMaxPooling1D())
model.add(layers.Dense(1))
当我使用plot_model函数将其绘制出来时:
from keras.utils import plot_model
plot_model(model, show_shapes=True, to_file='model.png')
我得到的图形是
![like this](https://istack.dev59.com/Yzx7h.webp)