Special#
Special functions for neural networks.
- nabla.ops.special.softmax(arg, axis=-1)[source]#
Compute softmax function in a numerically stable way.
- nabla.ops.special.logsumexp(arg, axis=None, keep_dims=False)[source]#
Compute log(sum(exp(x))) in a numerically stable way.
- nabla.ops.special.where(condition, x, y)[source]#
Element-wise selection from x or y based on condition.
- nabla.ops.special.cond(condition, true_fn, false_fn, *args, **kwargs)[source]#
Conditional execution based on a boolean condition.
- Parameters:
condition (Array) – Boolean array determining which function to execute
true_fn (Callable) – Function to execute if condition is True
false_fn (Callable) – Function to execute if condition is False
*args – Arguments passed to the selected function
**kwargs –
Arguments passed to the selected function
- Returns:
Result of the executed function
- Return type: