Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

reset all weights tensorflow

for layer in model.layers: 
  if isinstance(layer, tf.keras.Model):
  reset_weights(layer)
    continue
    for k, initializer in layer.__dict__.items():
  if "initializer" not in k:
  continue
    # find the corresponding variable
    var = getattr(layer, k.replace("_initializer", ""))
    var.assign(initializer(var.shape, var.dtype))
Source by www.gitmemory.com #
 
PREVIOUS NEXT
Tagged: #reset #weights #tensorflow
ADD COMMENT
Topic
Name
8+1 =