(self, bottom, name)
| 82 | |
| 83 | |
| 84 | def fc_layer(self, bottom, name): |
| 85 | with tf.variable_scope(name): |
| 86 | shape = bottom.get_shape().as_list() |
| 87 | dim = 1 |
| 88 | for d in shape[1:]: |
| 89 | dim *= d |
| 90 | x = tf.reshape(bottom, [-1, dim]) |
| 91 | |
| 92 | weights = self.get_fc_weight(name) |
| 93 | biases = self.get_bias(name) |
| 94 | |
| 95 | # Fully connected layer. Note that the '+' operation automatically |
| 96 | # broadcasts the biases. |
| 97 | fc = tf.nn.bias_add(tf.matmul(x, weights), biases) |
| 98 | |
| 99 | return fc |
| 100 | |
| 101 | def get_conv_filter(self, name): |
| 102 | return tf.constant(self.data_dict[name][0], name="filter") |
nothing calls this directly
no test coverage detected