Skip to main content

Table 4 Dynamic routing algorithm

From: Identifying the sequence specificities of circRNA-binding proteins based on a capsule network architecture

Dynamic routing algorithm
Input: \(u^{i}\) is the output of the affine transformation
Output: \(v^{t}\) is the output of the \(t\) times dynamic routing
Initialize: \(b_{0}^{i} = 0, i \in \left( {1,2, \cdots n} \right)\); T = 2
1: for t = 1 to T
\({2:}\quad c_{t}^{i} = {\text{softmax}}(b_{0}^{i} )\) 
\({3:}\quad a^{t} = \mathop \sum \limits_{i = 1}^{n} c_{t}^{i} \cdot u^{i}\)
\({4:}\quad v^{t} = Squash\left( {a^{t} } \right)\)
\({5:}\quad b_{t}^{i} = b_{t - 1}^{i} + v^{t} \cdot u^{i}\)