function

class neuxus.nodes.function.ApplyFunction(input_port, function)[source]

Apply function along rows

Attributes:
  • output: output Port

Args:
  • function: function to apply, the function can take in input a row or a np.array of shape number of input channels as columns and 1 row To perform calculation with an unvariateState output it is possible to include the .value attribute of this Node (see example)

Example:

def f(x): return x - 4 ApplyFunction(port4, f) or def f(x): return x - np.array([3, 2, 5, -1]) ApplyFunction(port4, f) or stat = UnivariateStat(port5, ‘mean’) def f(x): return x - stat.value ApplyFunction(port4, f)