<p>Actually, Ross Girshick's py-faster-rcnn repo includes an implementation for the SVD step: <a href="https://github.com/rbgirshick/py-faster-rcnn/blob/master/tools/compress_net.py" rel="nofollow noreferrer"><code>compress_net.py</code></a>.</p>

<p>BTW, you usually need to fine-tune the compressed model to recover the accuracy (or to compress in a more sophisticated way, see for example "<a href="https://arxiv.org/abs/1505.06798" rel="nofollow noreferrer">Accelerating Very Deep Convolutional Networks for Classification and Detection</a>", Zhang et al).</p>

<p>Also, for me scipy.linalg.svd worked faster than numpy's svd.</p>
How to reduce a fully-connected (`"InnerProduct"`) layer using truncated SVD
<p>In the paper <a href="https://arxiv.org/abs/1504.08083" rel="noreferrer"><em>Girshick, R</em> <strong>Fast-RCNN</strong> (ICCV 2015)</a>, section "3.1 Truncated SVD for faster detection", the author proposes to use <a href="https://en.wikipedia.org/wiki/Singular_value_decomposition" rel="noreferrer">SVD</a> trick to reduce the size and computation time of a fully connected layer.  </p>

<p>Given a <em>trained</em> model (<code>deploy.prototxt</code> and <code>weights.caffemodel</code>), how can I use this trick to replace a fully connected layer with a truncated one?</p>