def reset_weights(self):
"""Returns a TensorFlow operation to resets TensorFlow weights
so the model can be used again.
Returns:
list [tf.Operation]: List of operations to reassign weights.
"""
weights = [entry['weights'] for entry in self.network]
weights.extend([entry['biases'] for entry in self.network])
return [weight.assign(tf.random_normal(weight.get_shape(), stddev=0.1))
for weight in weights]
评论列表
文章目录