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

Function loss_fn

tensorflow/python/distribute/single_loss_example.py:41–44  ·  view source on GitHub ↗
(ctx, x)

Source from the content-addressed store, hash-verified

39 layer = core.Dense(1, use_bias=use_bias)
40
41 def loss_fn(ctx, x):
42 del ctx
43 y = array_ops.reshape(layer(x), []) - constant_op.constant(1.)
44 return y * y
45
46 single_loss_step = step_fn.StandardSingleLossStep(
47 dataset_fn, loss_fn, optimizer, distribution, iterations_per_step)

Callers 15

grad_fnMethod · 0.70
model_fnFunction · 0.70
grad_fnMethod · 0.70
model_fnMethod · 0.70
_replica_lossFunction · 0.50
_eager_loss_fnFunction · 0.50
_model_lossFunction · 0.50
_prepare_total_lossMethod · 0.50
train_stepMethod · 0.50
test_stepMethod · 0.50
minimizeMethod · 0.50
_replica_lossFunction · 0.50

Calls 6

reshapeMethod · 0.80
reduce_meanMethod · 0.80
reduce_sumMethod · 0.80
constantMethod · 0.45
control_dependenciesMethod · 0.45
get_collectionMethod · 0.45

Tested by 10

grad_fnMethod · 0.56
grad_fnMethod · 0.56
model_fnMethod · 0.56
train_stepMethod · 0.40
test_stepMethod · 0.40
minimizeMethod · 0.40
_replica_lossFunction · 0.40
_train_stepFunction · 0.40
_replica_lossFunction · 0.40
_train_stepFunction · 0.40