Open darpitdavetamu opened 2 years ago
I am not that well-versed with Keras but looking at its documentation (https://keras.io/api/models/model_training_apis/) there seems to be a sample_weight
parameter in the .fit()
method of the model. Providing the weights through this parameter should do what you are looking for, if I'm not mistaken.
I understand the concept of DenseLoss/weights broadly. But to practically use it do I just specify the weights computed by DenseWeight in the 'loss_weight' parameter while compiling the model or is there some other way that I use it as a custom_loss function Usage: dw = DenseWeight(alpha=4.0) wts = dw.fit(y)
tf_model.compile( optimizer=tf.keras.optimizers.Adam(learning_rate=0.001),
loss = [tf.keras.losses.MeanSquaredError()], metrics=[tf.keras.metrics.MeanSquaredError()], loss_weights=wts)