FunctionSet (deprecated)

class chainer.FunctionSet(**links)[source]

Set of links (as “parameterized functions”).

FunctionSet is a subclass of Chain. Function registration is done just by adding an attribute to object.

Deprecated since version v1.5: Use Chain instead.


FunctionSet was used for manipulation of one or more parameterized functions. The concept of parameterized function is gone, and it has been replaced by Link and Chain.


Returns an attribute by name.

Parameters:key (str) – Name of the attribute.


>>> import chainer.links as L
>>> model = FunctionSet(l1=L.Linear(10, 10), l2=L.Linear(10, 10))
>>> l1 = model['l1']  # equivalent to l1 = model.l1

Returns a tuple of parameters and gradients.

Returns:Tuple (pair) of two tuples. The first element is a tuple of parameter arrays, and the second is a tuple of gradient arrays.

Copies parameters from another source without reallocation.

Parameters:params (Iterable) – Iterable of parameter arrays.

Tuple of gradient arrays of all registered functions.

The order of gradients is consistent with parameters() property.


Tuple of parameter arrays of all registered functions.

The order of parameters is consistent with parameters() property.