$$ \begin{pmatrix} x_0 & x_1 & x_2 & x_3 & \cdots & x_n \\ \end{pmatrix} \cdot \begin{pmatrix} w_{0,1} & w_{0,2} \\ w_{1,1} & w_{1,2} \\ w_{2,1} & w_{2,2} \\ w_{3,1} & w_{3,2} \\ \vdots & \vdots \\ w_{n,1} & w_{n,2} \\ \end{pmatrix} = \begin{pmatrix} z_1 & z_2 \\ \end{pmatrix} $$
$$ \begin{pmatrix} a_1 & a_2 \end{pmatrix} = \begin{pmatrix} sigmoid(z_1) & sigmoid(z_2) \end{pmatrix} $$
$$ sigmoid(t) = \frac{1}{1+e^{-t}} $$
$$ \quad X \quad \quad Y \\ \begin{eqnarray} 0\quad 0 & = & 0 \\ 0\quad 1 & = & 1 \\ 1\quad 0 & = & 1 \\ 1\quad 1 & = & 0 \end{eqnarray} $$
$$ J(\Theta )=\frac { 1 }{ m } \left[ \sum _{ i=1 }^{ m }{ \sum _{ k=1 }^{ K }{ { y }_{ k }^{ (i) }log({ h }_{ \Theta }({ x }^{ (i) }))_{ k }+(1-{ y }^{ (i) })(1-(h_{ \Theta }(x^{ (i) }))_{ k }) } } \right] \\ +\frac { \lambda }{ 2m } \sum _{ l=1 }^{ L-1 }{ \sum _{ i=1 }^{ s_{ l } }{ \sum _{ j=1 }^{ s_{ l }+1 }{ (\Theta _{ ij }^{ (l) })^{ 2 } } } } $$