提问人:levi mungai 提问时间:11/17/2023 更新时间:11/17/2023 访问量:15
TensorFlow 中 tf.keras.Model() 的功能是什么?这个 satement 到底是做什么的 (model = tf.keras.Model(inputs=input, outputs=output))
what is the function of tf.keras.Model() in tensorflow? What exactly does this satement do (model = tf.keras.Model(inputs=input, outputs=output))
问:
请帮助我理解 Model() 在这种情况下的功能。它返回的内容 以及为什么我们需要它,诸如此类的东西。
def make_embedding():
inp = Input(shape=(100,100,3), name='input_image')
# First block
c1 = Conv2D(64, (10,10), activation='relu')(inp)
m1 = MaxPooling2D(64, (2,2), padding='same')(c1)
# Second block
c2 = Conv2D(128, (7,7), activation='relu')(m1)
m2 = MaxPooling2D(64, (2,2), padding='same')(c2)
# third block
c3 = Conv2D(128, (4,4), activation='relu')(m2)
m3 = MaxPooling2D(64, (2,2), padding='same')(c3)
# Final embedding block
c4 = Conv2D(256, (4,4), activation='relu')(m3)
f1 = Flatten()(c4)
d1 = Dense(4096, activation='sigmoid')(f1)
return Model(inputs=[inp], outputs=[d1], name='embedding')
答: 暂无答案
评论