def regularize_network_params(layer, penalty, tags={'regularizable': True}, **kwargs):
 return apply_penalty(get_all_params(layer, **tags), penalty, **kwargs)

def regularize_network_params ( layer , penalty , tags = { 'regularizable' : True } , ** kwargs ) : return apply_penalty ( get_all_params ( layer , ** tags ) , penalty , ** kwargs )
computes a regularization cost by applying a penalty to the parameters of all layers in a network .