tensorflow模型参数如何查看

tensorflow模型参数如何查看

技术问答

在TensorFlow中,可以通过调用model.summary()方法来查看模型的参数。示例如下:

import tensorflow as tf

model = tf.keras.Sequential([
    tf.keras.layers.Dense(64, activation='relu', input_shape=(784,)),
    tf.keras.layers.Dense(10, activation='softmax')
])

model.summary()

执行以上代码将会输出模型的参数信息,包括每一层的名称、类型、输出shape以及可训练参数的数量。

本文地址:https://www.sztg.com.cn/article/53640.html

如非特殊说明,本站内容均来自于网友自主分享,如有任何问题均请联系我们进行处理!

猜您喜欢