Fix bugs in regularize multi-task layer