I would like to decide if to train some specific weight, based on feature values.
As a simple attempt I would like to "touch" only the weights between input and 1st layer such that if a condition on a feature i holds, then DO NOT train (update) all those weights connecting the 1st layer with input neuron i
Let us say I have model like this:
model = keras.Sequential([
layers.Dense(2, activation=tf.nn.relu, input_shape=(N, 4)),
layers.Dense(1, activation=tf.nn.relu)])
I want everything working normally if I have inputs as [1,2,3,4] with all nonzero values.But, then I would like to provide an example like [1,2,3,0] and make the weights related the 4th neuron of the input layers to stay the same and not updated.I'm trying to simulate a "missing feature" behaviour