code: def regularize_network_params(
      layer, penalty, tags={"regularizable": True}, **kwargs
  ):
      """
      Computes a regularization cost by applying a penalty to the parameters
      of all layers in a network.
  
      Parameters
      ----------
      layer : a :class:`Layer` instance.
          Parameters of this layer and all layers below it will be penalized.
      penalty : callable
      tags: dict
          Tag specifications which filter the parameters of the layer or layers.
          By default, only parameters with the `regularizable` tag are included.
      **kwargs
          keyword arguments passed to penalty.
  
      Returns
      -------
      Theano scalar
          a scalar expression for the cost
      """
      return apply_penalty(
          get_all_params(layer, **tags), penalty, **kwargs
      )
  
file_path: Lasagne/lasagne/regularization.py
imports: import theano.tensor
  from .layers import Layer, get_all_params
label_desc: Use image node_id 6 for calling a global function with example usage: regularize_network_params(layer, penalty, tags) and returns: apply_penalty