def expr(self, model, data, **kwargs):
        # This Cost does not depend on any data, and get_data_specs does not
        # ask for any data, so we should not be provided with some.
        self.get_data_specs(model)[0].validate(data)

        penalty = 0
        for var in self.variables:
            # Absolute value handles odd-valued p cases
            penalty = penalty + abs(var ** self.p).sum()
        return penalty
Serializes all states into json form.
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/costs/cost.py/LpPenalty.expr--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/appengine-mapreduce/python/src/mapreduce/datastore_range_iterators.py/AbstractKeyRangeIterator.to_json