Neural Network Vectorization
From Ufldl
(→Sparse autoencoder) |
m (Fixed tt markup) |
||
Line 137: | Line 137: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
- | Notice that the sparsity_delta is the same regardless of the example we are processing. | + | Notice that the <tt>sparsity_delta</tt> is the same regardless of the example we are processing. |
Recall that when we vectorizing the gradient computations, <tt>delta2</tt> is replaced with matrices. Thus, to vectorize the above computations, we can simply add <tt>sparsity_delta</tt> (using <tt>repmat</tt>) while computing the <tt>delta2</tt> matrices. | Recall that when we vectorizing the gradient computations, <tt>delta2</tt> is replaced with matrices. Thus, to vectorize the above computations, we can simply add <tt>sparsity_delta</tt> (using <tt>repmat</tt>) while computing the <tt>delta2</tt> matrices. |