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

Method _create_loss

modelzoo/dien/train.py:557–567  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

555
556 # compute loss
557 def _create_loss(self):
558 self._logits = tf.squeeze(self._logits)
559 self._crt_loss = tf.losses.sigmoid_cross_entropy(
560 self._label,
561 self._logits,
562 scope='loss',
563 reduction=tf.losses.Reduction.SUM_OVER_BATCH_SIZE)
564 self.loss = self._crt_loss + self._aux_loss
565 tf.summary.scalar('sigmoid_cross_entropy', self._crt_loss)
566 tf.summary.scalar('aux_loss', self._aux_loss)
567 tf.summary.scalar('loss', self.loss)
568
569 # define optimizer and generate train_op
570 def _create_optimizer(self):

Callers 1

__init__Method · 0.95

Calls 1

scalarMethod · 0.45

Tested by

no test coverage detected