以下のようなコードで、
modelが定義できますが、
なぜ、
inputs=inputs, outputs=predictions
の情報で、
途中のレイヤの情報がわかるのかがわかりません。
predictionsは、Tensorで、それほどの情報がない気がするのですが。
たとえば、
predictions.shapeとしても、
そのレイヤの情報しかないですし、
それ以上の情報がどこにあるのかが、よくわかりません。
from keras.layers import Input, Dense from keras.models import Model # This returns a tensor inputs = Input(shape=(784,)) # a layer instance is callable on a tensor, and returns a tensor x = Dense(64, activation='relu')(inputs) x = Dense(64, activation='relu')(x) predictions = Dense(10, activation='softmax')(x) # This creates a model that includes # the Input layer and three Dense layers model = Model(inputs=inputs, outputs=predictions)コード
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。