I feel like there's a lot of code duplication between these two methods. How about something like this:

```python
def _weight_decay_gather(self, method_name, coeff):
    if isinstance(coeff, py_float_types):
        return T.sum([getattr(layer, method_name)(coeff)
                      for layer in self.layers])
    elif is_iterable(coeff):
        assert all(layer_coeff >= 0 for layer_coeff in coeff)
        return T.sum([getattr(layer, method_name)(layer_coeff) for
                      layer, layer_coeff in safe_zip(self.layers, coeff)
                      if layer_coeff > 0])
    else:
        raise TypeError("CompositeLayer's " + method_name + " received "
                        "coefficients of type " + str(type(coeff)) + " "
                        "but must be provided with a float or list/tuple")

def get_weight_decay(self, coeff):
    return self._weight_decay_gather('get_weight_decay', coeff)

def get_l1_weight_decay(self, coeff):
    return self._weight_decay_gather('get_l1_weight_decay', coeff)
```