(self, dnn_input, dnn_hidden_units=None, layer_name='')
| 153 | tf.summary.scalar('eval_auc', self.auc) |
| 154 | |
| 155 | def dnn(self, dnn_input, dnn_hidden_units=None, layer_name=''): |
| 156 | for layer_id, num_hidden_units in enumerate(dnn_hidden_units): |
| 157 | with tf.variable_scope(layer_name + "_%d" % layer_id, |
| 158 | partitioner=self.dense_layer_partitioner, |
| 159 | reuse=tf.AUTO_REUSE) as dnn_layer_scope: |
| 160 | dnn_input = tf.layers.dense(dnn_input, |
| 161 | units=num_hidden_units, |
| 162 | activation=tf.nn.relu, |
| 163 | name=dnn_layer_scope) |
| 164 | if self.use_bn: |
| 165 | dnn_input = tf.layers.batch_normalization( |
| 166 | dnn_input, training=self._is_training, trainable=True) |
| 167 | add_layer_summary(dnn_input, dnn_layer_scope.name) |
| 168 | |
| 169 | return dnn_input |
| 170 | |
| 171 | def prediction(self): |
| 172 | # input features |
no test coverage detected