We have class_weight
in fit_generator
(Keras v.2.2.2) According to docs:
Class_weight: Optional dictionary mapping class indices (integers) to
a weight (float) value, used for weighting the loss function (during
training only). This can be useful to tell the model to "pay more
attention" to samples from an under-represented class.
Assume you have two classes [positive and negative], you can pass class_weight
to fit_generator
with:
model.fit_generator(gen,class_weight=[0.7,1.3])