(self, dnn_input, dnn_hidden_units=None, layer_name='')
| 119 | tf.summary.histogram('%s/activation' % tag, value) |
| 120 | |
| 121 | def _dnn(self, dnn_input, dnn_hidden_units=None, layer_name=''): |
| 122 | for layer_id, num_hidden_units in enumerate(dnn_hidden_units): |
| 123 | with tf.variable_scope(layer_name + '_%d' % layer_id, |
| 124 | partitioner=self._dense_layer_partitioner, |
| 125 | reuse=tf.AUTO_REUSE) as dnn_layer_scope: |
| 126 | dnn_input = tf.layers.dense( |
| 127 | dnn_input, |
| 128 | units=num_hidden_units, |
| 129 | activation=tf.nn.relu, |
| 130 | name=dnn_layer_scope) |
| 131 | if self.use_bn: |
| 132 | dnn_input = tf.layers.batch_normalization( |
| 133 | dnn_input, training=self.is_training, trainable=True) |
| 134 | self._add_layer_summary(dnn_input, dnn_layer_scope.name) |
| 135 | |
| 136 | return dnn_input |
| 137 | |
| 138 | def _create_model(self): |
| 139 | # input features |
no test coverage detected