# The Nature of Model Weights for Targeted Dropout

I am trying to figure out how to target certain model weights withtin my 1000x 1000 feed forward network in keras

>>>weights = loaded_model.layers[3].get_weights()
>>> type(weights)
[0] list
>>> len(weights)
[1] 2
>>> weights[0].shape
[2] (1000, 1000)
>>> weights[1].shape
[3] (1000,)


I know that weights[1] is the layer biases for each input and that weights[0] is the values for each the weights of each neural connection.

I am trying to get a list of all the connections weights for each neuron. The only problem is that I can't seem to figure out if I would need to pull the nth row of the (1000, 1000) weights matrix or the nth column of the (1000, 1000) weights matrix.

TLDR: is the weights for the input of the nth neuron located at (1000, n) or (n, 1000)

• Do you want all the weights from a given neuron in one layer to the next layer, or all the weights to a given neuron from the previous layer? I'd assume the latter, if you want to match it up with the bias . . . but could you please make this clearer in the question? – Neil Slater Jul 7 at 17:27

>>> weights[0].shape