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

Function loss_fn

tensorflow/contrib/eager/python/examples/rnn_ptb/rnn_ptb.py:155–160  ·  view source on GitHub ↗
(model, inputs, targets, training)

Source from the content-addressed store, hash-verified

153
154
155def loss_fn(model, inputs, targets, training):
156 labels = tf.reshape(targets, [-1])
157 outputs = model(inputs, training=training)
158 return tf.reduce_mean(
159 tf.nn.sparse_softmax_cross_entropy_with_logits(
160 labels=labels, logits=outputs))
161
162
163def _divide_into_batches(data, batch_size):

Callers 6

evaluateFunction · 0.70
model_lossFunction · 0.70
loss_and_gradsFunction · 0.50
_create_model_fn_opsFunction · 0.50
_wrapperFunction · 0.50
_centered_bias_stepFunction · 0.50

Calls 3

modelFunction · 0.85
reshapeMethod · 0.80
reduce_meanMethod · 0.80

Tested by

no test coverage detected