Skip to content

Package: elementwise_math

Elementwise math operations.

These nodes operate on data on an element-by-element basis. Most elementwise math operations are found here. These operations can typically operate on and output data in any data structure supported by NeuroPype, including Packets, Chunks, Blocks, arrays, and raw numbers (intergers or floats), or lists/dictionaries thereof. The output data structure is usually the same as the input data structure for unary operations, and for binary or n-ary operations, specific pairings of container data structures (lists/dictionaries) with numeric data types (numbers, arrays, Packets etc), e.g., list + number will trigger broadcasting, where the number is applied to each element of the list. The operations will also typically preserve axes and axis labels; for binary/n-ary operations, the axis_pairing (and label_pairing) ports can be used to specify how the axes (and labels) of the inputs should be paired to produce the output data (either left-to-right or based on matched types).

Nodes in this package:

  • Absolute Value
    Take the absolute value of each element in the data.

  • Add
    Add the data across the given data inputs (elementwise).

  • Inverse (Arc) Cosine
    Calculate the inverse cosine of each element in the data.

  • Inverse Hyperbolic Cosine
    Calculate the inverse hyperbolic cosine of each element in the data.

  • Inverse (Arc) Sine
    Calculate the inverse sine of each element in the data.

  • Inverse Hyperbolic Sine
    Calculate the inverse hyperbolic sine of each element in the data.

  • Inverse (Arc) Tangent
    Calculate the inverse tangent of each element in the data.

  • Arc Tangent 2
    Take the elementwise arc tangent (atan2) of the two given inputs.

  • Inverse Hyperbolic Tangent
    Calculate the inverse hyperbolic tangent of each element in the data.

  • And (Elementwise)
    Computes the elementwise AND operation between two or more objects.

  • Not (Elementwise)
    For each element in the data, take the logical negation (NOT) of the element.

  • Or (Elementwise)
    Computes the elementwise OR operation between two or more objects.

  • Xor (Elementwise)
    Computes the elementwise XOR operation between two objects.

  • Clamp
    Clamp each element in the data between a minimum and a maximum.

  • Close (Elementwise)
    For each array element in data1, test whether it is close to the corresponding element in data2 according to some tolerance.

  • Conditional Replace Values
    Replace values that meet a given criteria.

  • Complex Conjugate
    Calculate the complex conjugate of each element in the data.

  • Cosine
    Calculate the cosine of each element in the data.

  • Hyperbolic Cosine
    Calculate the hyperbolic cosine of each element in the data.

  • Discretize
    Discretize the input data (continuous) through a multi-level threshold function.

  • Divide
    Divide the data in the first input by the data in the second input (elementwise).

  • Equal (Elementwise)
    For each array element in data1, test whether it is equal to the corresponding element in data2.

  • Exponent
    Exponentiate a constant base given each element in the data.

  • Formula
    Evaluate a mathematical formula of n variables.

  • Greater Or Equal
    For each array element in data1, test whether it is greater than or equal to the corresponding element in data2.

  • Greater Than
    For each array element, test whether it is greater in data1 than in data2.

  • Greatest Common Divisor (Elementwise)
    Get the greatest common divisor of the integer inputs.

  • Hypotenuse (Elementwise)
    Take the elementwise hypotenus of two inputs.

  • Imaginary Part
    Obtain the imaginary part of a complex number.

  • Is Even
    True if the element is even, otherwise False.

  • Is Infinite
    Return an object of the same type and shape as the data that has, for each element, a boolean value (true/false) indicating whether it was a positive or negative infinity value.

  • Is NaN (Not a Number)
    Return an object of the same type and shape as the data that has, for each element, a boolean value (true/false) indicating whether it was a NaN value (invalid floating-point value, a.k

  • Is Odd
    True if the element is odd, otherwise False.

  • Is Real-Valued
    Return an object of the same type and shape as the data that has, for each element, a boolean value (true/false) indicating whether it a real value (as opposed to complex).

  • Least Common Multiple (Elementwise)
    Get the least common multiple of the integer inputs.

  • Less Or Equal
    For each array element in data1, test whether it is less than or equal to the corresponding element in data2.

  • Less Than
    For each array element, test whether it is less in data1 than in data2.

  • Logarithm
    Take the logarithm of each element in the data to some base.

  • Complex Magnitude (Absolute Value)
    Take the absolute magnitude of each element in the data.

  • Math Constant
    Returns the value of a named mathematical constant.

  • Threshold Maximum
    Take the maximum of each element in the data and a fixed threshold.

  • Maximum
    Take the elementwise maximum of the given data items.

  • Threshold Minimum
    Take the minimum of each element in the data and a fixed threshold.

  • Minimum
    Take the elementwise minimum of the given data items.

  • Modulo
    Calculate the modulus (remainder) of a mod b.

  • Multiply
    Multiply the data in the in the given data items (elementwise).

  • Negate
    Negate each element of the data.

  • Not Equal (Elementwise)
    For each array element in data1, test whether it is not equal to the corresponding element in data2.

  • OperateConstant
    Add, subtract, multiply or divide each element in the data by a given constant.

  • Operate Elementwise
    Apply an operation to the data, where the data block of the first and second inputs are operands.

  • Complex Phase
    Calculate the phase angle of each element in the data.

  • Power (Exponentiate)
    Raise each element in the data to some power (exponent).

  • Exponentiate
    Raise each element of the data in the first input to a power that is given by the corresponding element in the second input.

  • Real Part
    Obtain the real part of a complex number.

  • Reciprocal (Inverse)
    Take the reciprocal (inverse) of each element in the data.

  • Reciprocal Square Root
    Take the reciprocal square root of each element in the data.

  • Replace NaNs
    Replace all NaN values in the data by a given value.

  • Clip Nonfinite Values
    Replace NaN, +Inf and -Inf values by substitution values, and optionally clip very large finite values to a min/max range.

  • Replace Values
    Replace values in the data, using a mapping of old_value -> new_value.

  • Round
    Round each element to a given precision.

  • Scale by Constant Factor
    Scale each element of the data by a constant factor.

  • Add Constant Value
    Add a given value to each element of the data.

  • Sigmoid
    Apply a sigmoidal (dampening/squashing) transform to each element in the data.

  • Sign
    Take the sign of each element in the data.

  • Sine
    Calculate the sine of each element in the data.

  • Hyperbolic Sine
    Calculate the hyperbolic sine of each element in the data.

  • Softmax
    Apply the softmax function to the given data array.

  • Special Function (Elementwise)
    Evaluate a mathematical special function elementwise for one or more array operands.

  • Square Root
    Take the square root of each element in the data.

  • Squaring
    Square each element in the data.

  • Step (Statistical Threshold)
    Map the input data through a single interval step function.

  • Subtract
    Subtract the data in the second input from the data in the first input (elementwise).

  • Tangent
    Calculate the tangent of each element in the data.

  • Hyperbolic Tangent
    Calculate the hyperbolic tangent of each element in the data.

  • To Decibels
    Convert the given quantity to decibels.

  • Where Clause (Elementwise Select)
    Select from one or another array elementwise, depending on an elementwise condition mask.