syna.functions.math module¶
- class syna.functions.math.Abs[source]¶
Bases:
Function
Elementwise absolute value with direct sign-based backward.
- class syna.functions.math.Clip(x_min, x_max)[source]¶
Bases:
Function
Clip values into [x_min, x_max].
- class syna.functions.math.Div[source]¶
Bases:
Function
Elementwise division with broadcasting support.
- class syna.functions.math.Linear[source]¶
Bases:
Function
Linear layer y = x.dot(W) + b (b optional).
- class syna.functions.math.MatMul[source]¶
Bases:
Function
Matrix multiplication x @ W.
Expects both x and W to be 2D arrays (matrices). Does not support batched or higher-dimensional tensor multiplication.
- class syna.functions.math.Max(axis=None, keepdims=False)[source]¶
Bases:
Function
Max reduction with correct backward distribution.
- class syna.functions.math.Maximum[source]¶
Bases:
Function
Elementwise maximum with direct backward using masks.
- class syna.functions.math.Min(axis=None, keepdims=False)[source]¶
Bases:
Max
Min reduction re-uses Max implementation but calls np.min on forward.
- class syna.functions.math.Minimum[source]¶
Bases:
Function
Elementwise minimum with direct backward using masks (faster than algebraic identity).
- class syna.functions.math.Mul[source]¶
Bases:
Function
Elementwise multiply with broadcasting support.
- class syna.functions.math.Pow(c: float)[source]¶
Bases:
Function
Power operation x**c where c is a constant.
- class syna.functions.math.Sqrt[source]¶
Bases:
Function
Elementwise sqrt with dedicated backward (faster than generic pow).
- class syna.functions.math.Sub[source]¶
Bases:
Function
Elementwise subtraction with broadcasting support.
- syna.functions.math.linear_simple(x, W, b=None) Tensor [source]¶
A slightly optimized linear for common case: returns t + b when b is given.
- syna.functions.math.maximum(x, y) Tensor [source]¶
Elementwise maximum using a dedicated Function for performance.
- syna.functions.math.mean(x, axis: Tuple[int, ...] | None = None, keepdims=False) Tensor [source]¶
Mean like torch.mean: mean over all elements by default, or over given axis/axes.
- syna.functions.math.minimum(x, y) Tensor [source]¶
Elementwise minimum using a dedicated Function for performance.