Hi Shamoon!



 shamoons:

some of the classes will not have any positive samples is because I am pad_sequence my data
…
It doesn’t contain positive samples for a specific position of the target vector


From this I understand that you are performing a multi-label,
multi-class classification problem, where your “classes” are
the positions in your sequence.
If it is really true that some positions (that is, some classes)
are never positive across your entire training set, then don’t
reweight such classes (no zero-divides).  Simply let your network
learn that these classes are never positive, and your network
will always (correctly) predict negative for them.
Good luck!
K. Frank