Skip to content
Snippets Groups Projects
Commit 4ac1c6b5 authored by Nikolai's avatar Nikolai
Browse files

normalize weights for default training as well

parent 6a2f9292
No related branches found
No related tags found
No related merge requests found
......@@ -828,7 +828,7 @@ class ClassificationProject(object):
validation_split = self.validation_split,
# we have to multiply by class weight since keras ignores class weight if sample weight is given
# see https://github.com/keras-team/keras/issues/497
sample_weight=self.w_train*np.array(self.class_weight)[self.y_train.astype(int)],
sample_weight=self.w_train*np.array(self.class_weight)[self.y_train.astype(int)]/self.mean_train_weight,
shuffle=True,
batch_size=self.batch_size,
callbacks=self.callbacks_list)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment