简体   繁体   中英

Extracting weights and biases to a specific prediction in Keras Tensorflow

I have a neural network to classify the MNIST dataset. While I can extract the weights and biases for the model, I am curious to know if there are specific weights and biases for individual predictions. For eg, if I predict a specific image, 2 for example is it possible to get the weights and biases for this particular prediction? If so, how do I do that?

Model -

model = keras.Sequential([
    keras.layers.Flatten(input_shape=(28, 28)),
    keras.layers.Dense(128, activation=tf.nn.relu),
    keras.layers.Dense(10, activation=tf.nn.softmax)
])

Please let me know what additional information I need to provide for this question to be answered.

不,在进行预测时权重和偏差是固定的,没有用于单个预测的权重和偏差。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM