Controlling Weights at keras.layer During Training

Say I have the following model(I removed the parameters for simplicity) :

inputs = keras.Input(shape=(,,))
layer_1 =  layers.Conv2D()(inputs)
layer_2 = layers.AveragePooling2D()(layer_1)
layer_3 = layers.Conv2D()(layer_2)
flatten = layers.Flatten()(layer_3)
outputLayer = layers.Dense()(flatten)
model = keras.Model(inputs= (inputs), outputs=(outputLayer))
model.compile()
hist = model.fit()

How can I get control over the weights of a specific layer (say: I want to add noise to the weights during every batch training).

I strongly appreciate any kind of help (explanation, examples, sources)



Read more here: https://stackoverflow.com/questions/66327627/controlling-weights-at-keras-layer-during-training

Content Attribution

This content was originally published by Smith at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: