next up previous
Next: Example structures Up: Building Blocks Previous: Discrete variables

Switch

In a switch node, an input $ k$ with $ n$ discrete values selects one of the $ n$ continuous valued inputs $ s_{i}$ as the output: $ s_{\mbox{out}} = s_{k}$. The required expectations are as follows:

$\displaystyle \left< s_{\mbox{out}} \right>$ $\displaystyle =$ $\displaystyle \sum_{i=1}^{n} q(k=i) \left< s_{i} \right>$ (13)
$\displaystyle \left< s_{\mbox{out}}^{2} \right>$ $\displaystyle =$ $\displaystyle \sum_{i=1}^{n} q(k=i) \left< s_{i}^{2} \right>$ (14)
$\displaystyle \left< \exp s_{\mbox{out}} \right>$ $\displaystyle =$ $\displaystyle \sum_{i=1}^{n} q(k=i) \left< \exp s_{i} \right> .$ (15)

The variance is obtained by $ \mathrm{Var}\left\{s_{\mbox{out}}\right\} =
\left< s_{\mbox{out}}^{2} \right> - \left< s_{\mbox{out}} \right>^2$ and $ \left< s_i^2 \right> = \left< s_i \right>^2 + \mathrm{Var}\left\{s_i\right\}$.



Harri Valpola 2001-10-01