'Returns a list of Theano shared variables or expressions that
parameterize the layer.
By default, all shared variables that participate in the forward pass
will be returned (in the order they were registered in the Layer\'s
constructor via :meth:`add_param()`). The list can optionally be
filtered by specifying tags as keyword arguments. For example,
``trainable=True`` will only return trainable parameters, and
``regularizable=True`` will only return parameters that can be
regularized (e.g., by L2 decay).
If any of the layer\'s parameters was set to a Theano expression instead
of a shared variable, `unwrap_shared` controls whether to return the
shared variables involved in that expression (``unwrap_shared=True``,
the default), or the expression itself (``unwrap_shared=False``). In
either case, tag filtering applies to the expressions, considering all
variables within an expression to be tagged the same.
Parameters
unwrap_shared : bool (default: True)
Affects only parameters that were set to a Theano expression. If
``True`` the function returns the shared variables contained in
the expression, otherwise the Theano expression itself.
**tags (optional)
tags can be specified to filter the list. Specifying ``tag1=True``
will limit the list to parameters that are tagged with ``tag1``.
Specifying ``tag1=False`` will limit the list to parameters that
are not tagged with ``tag1``. Commonly used tags are
``regularizable`` and ``trainable``.
Returns
list of Theano shared variables or expressions
A list of variables that parameterize the layer
Notes
For layers without any parameters, this will return an empty list.'

def get_params(self, unwrap_shared=True, **tags):

    result = list(self.params.keys())
    only = set((tag for (tag, value) in tags.items() if value))
    if only:
        result = [param for param in result if (not (only - self.params[param]))]
    exclude = set((tag for (tag, value) in tags.items() if (not value)))
    if exclude:
        result = [param for param in result if (not (self.params[param] & exclude))]
    if unwrap_shared:
        return utils.collect_shared_vars(result)
    else:
        return result
