# Keras: do sample weights take part in the derivatives

According to Keras documentation, sample_weight can be used in order to give any sample in the training data a different importance in the loss.

• Do sample weights take part in the derivatives? In other words, does Keras use these weights to train the model or they just give rise to a different loss value? i.e., the derivatives are "still" computed w.r.t. to the "unweighted" loss?

Because the loss function is not actually defined based on the sample weights, its rather passed in (as an argument) to the fit function in Keras.

• These weights don't take part as derivatives because these are constants.; These just help in loss balancing and the backprop that follows is accordingly – Aditya Mar 23 at 16:05