brainmass.bounded_input

Contents

brainmass.bounded_input#

brainmass.bounded_input(x, bound=500.0)[source]#

Apply a tanh bound to an input signal.

Prevents numerical instability by smoothly limiting the magnitude of the inputs fed to a second-order system.

Parameters:
  • x (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Input signal.

  • bound (float) – Maximum absolute value of the output.

Returns:

The bounded input bound * tanh(x / bound).

Return type:

Array | ndarray | bool | number | bool | int | float | complex | Quantity