# activations

Python API: `depthai_nodes.node.parsers.utils.activations`

## Functions

### sigmoid

```python
def sigmoid(x: np.ndarray) -> np.ndarray:
```

Sigmoid function.

Parameters

 * `x` (`np.ndarray`): Input tensor.

Returns

 * `np.ndarray`: A result tensor after applying a sigmoid function on the given input.

### softmax

```python
def softmax(x: np.ndarray, axis: int | None = None, keep_dims: bool = False) -> np.ndarray:
```

Compute the softmax of an array. The softmax function is defined as: softmax(x) = exp(x) / sum(exp(x))

Parameters

 * `x` (`np.ndarray`): The input array.
 * `axis` (`int | None`): Axis or axes along which a sum is performed. The default, axis=None, will sum all of the elements of the
   input array. If axis is negative it counts from the last to the first axis.
 * `keep_dims` (`bool`): If this is set to True, the axes which are reduced are left in the result as dimensions with size one.
   With this option, the result will broadcast correctly against the input array.

Returns

 * `np.ndarray`: The softmax of the input array.
