Implemented and tested multi-label cost function.