Solved by alexgo in post #2 
              
              
                you have a mistake in the labels in your manual implementation. 
should be: 
l1 = -(0*(math.log(0.5332))+(1-0)*math.log(1-0.5332)) 
l2 = -(0*(math.log(0.5362))+(1-0)*math.log(1-0.5362)) 
l3 = -(1*(math.log(0.6664))+(1-1)*math.log(1-0.6664)) 
l4 = -(0*(math.log(0.5075))+(1-0)*math.log(1-0.5075))