Please use the same type as self.criterion.weighted_* (which is double)