I know that there is a possibility in Keras with the class_weights parameter dictionary at fitting, but I couldn't find any example. Would somebody so kind to provide one?By the way, in this case the appropriate praxis is simply to weight up the minority class proportionally to its underrepresentation?
How to set class weights for imbalanced classes in Keras?
classification;keras;weighted data
If you are talking about the regular case, where your network produces only one output, then your assumption is correct. In order to force your algorithm to treat every instance of class 1 as 50 instances of class 0 you have to:Define a dictionary with your labels and their associated weightsclass_weight = {0 : 1.,    1: 50.,    2: 2.}Feed the dictionary as a parameter:model.fit(X_train, Y_train, nb_epoch=5, batch_size=32, class_weight = class_weight)