Selectively zero weights in TensorFlow?
<p>Lets say I have an NxM weight variable <code>weights</code> and a constant NxM matrix of 1s and 0s <code>mask</code>.</p>

<p>If a layer of my network is defined like this (with other layers similarly defined):</p>

<pre><code>masked_weights = mask*weights
layer1 = tf.relu(tf.matmul(layer0, masked_weights) + biases1)
</code></pre>

<p>Will this network behave as if the corresponding 0s in <code>mask</code> are zeros in <code>weights</code> during training? (i.e. as if the connections represented by those weights had been removed from the network entirely)? </p>

<p>If not, how can I achieve this goal in TensorFlow?</p>