syna.functions.math module¶
- class syna.functions.math.Abs[source]¶
Bases:
FunctionElementwise absolute value with direct sign-based backward.
- class syna.functions.math.Clip(x_min, x_max)[source]¶
Bases:
FunctionClip values into [x_min, x_max].
- class syna.functions.math.Div[source]¶
Bases:
FunctionElementwise division with broadcasting support.
- class syna.functions.math.Linear[source]¶
Bases:
FunctionLinear layer y = x.dot(W) + b (b optional).
- class syna.functions.math.MatMul[source]¶
Bases:
FunctionMatrix 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:
FunctionMax reduction with correct backward distribution.
- class syna.functions.math.Maximum[source]¶
Bases:
FunctionElementwise maximum with direct backward using masks.
- class syna.functions.math.Min(axis=None, keepdims=False)[source]¶
Bases:
MaxMin reduction re-uses Max implementation but calls np.min on forward.
- class syna.functions.math.Minimum[source]¶
Bases:
FunctionElementwise minimum with direct backward using masks (faster than algebraic identity).
- class syna.functions.math.Mul[source]¶
Bases:
FunctionElementwise multiply with broadcasting support.
- class syna.functions.math.Pow(c: float)[source]¶
Bases:
FunctionPower operation x**c where c is a constant.
- class syna.functions.math.Sqrt[source]¶
Bases:
FunctionElementwise sqrt with dedicated backward (faster than generic pow).
- class syna.functions.math.Sub[source]¶
Bases:
FunctionElementwise 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.