reservoirpy.mat_gen.line#

reservoirpy.mat_gen.line = _line()[source]#

Create a lower shift matrix.

This is used for line reservoirs, which have a linear topology (each node n is connected to the node n+1, the last node has no successor).

Note that the connectivity and seed parameters have no effect.

Parameters:
  • *shape ((int, int), optional) – Shape (row, columns) of the array. Must be a square matrix, i.e. row == columns.

  • sr (float, optional) – If defined, then will rescale the spectral radius of the matrix to this value.

  • input_scaling (float or array, optional) – If defined, then will rescale the matrix using this coefficient or array of coefficients.

  • weights (array of shape (units-1, ), optional) – If defined, corresponds to the weights of each connection.

  • sparsity_type ({"csr", "csc", "dense"}, default to "csr") – Format of the output matrix. “csr” and “csc” corresponds to the Scipy sparse matrix formats, and “dense” corresponds to a regular Numpy array.

  • dtype (numpy.dtype, default to numpy.float64) – A Numpy numerical type.

  • **kwargs (optional) – This argument is kept for compatibility reasons. This is not used.

Returns:

If a shape is given to the initializer, then returns a matrix. Else, returns a function partially initialized with the given keyword parameters, which can be called with a shape and returns a matrix.

Return type:

Numpy array or callable