bug fixes to weighted loss layer, always 3 bottoms