MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / dnn

Method dnn

modelzoo/features/runtime/deepfm/train.py:158–172  ·  view source on GitHub ↗
(self, dnn_input, dnn_hidden_units=None, layer_name='')

Source from the content-addressed store, hash-verified

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

Callers 1

predictionMethod · 0.95

Calls 2

variable_scopeMethod · 0.80
add_layer_summaryFunction · 0.70

Tested by

no test coverage detected