# How do you write sigmoid function for matrices and vectors?

I would like to apply the sigmoid (logistic) function:

$$\sigma{(x)} = \frac{1}{1+e^{-x}}$$

to a vector $$\mathbb{R}^n$$ or matrix $$\mathbb{R}^{m × n}$$.

And the question is how to write this function for vectors/matrices. I need it for a scientific publication.

• Oftentimes people simply write $\sigma(\mathbf{x})$ to denote elementwise application of $\sigma$ to the vector or matrix (so if $\mathbf{x} = \begin{bmatrix} x\\ y\\ z\end{bmatrix}$, then $\sigma(\mathbf{x})=\sigma\left(\begin{bmatrix} x\\ y\\ z\end{bmatrix}\right) = \begin{bmatrix}\sigma(x)\\ \sigma(y) \\ \sigma(z)\end{bmatrix}$ for example). If in doubt, maybe you could just quickly explain the notation you are using. – Minus One-Twelfth Mar 1 at 10:54
Oftentimes, people simply write $$\sigma(\mathbf{x})$$ to denote elementwise application of the sigmoid function to a vector or matrix. (For example, the author does it here, search the page for "vectorizing".) If in doubt, maybe you could just quickly explain the notation you are using.