Addressing duplicate category issue in training phase
Using logarithms to prevent floating point precision errors