MCPcopy Create free account
hub / github.com/pytorch/pytorch / __init__

Method __init__

caffe2/python/layers/bpr_loss.py:21–33  ·  view source on GitHub ↗
(self, model, input_record, name='bpr_loss', **kwargs)

Source from the content-addressed store, hash-verified

19class BPRLoss(ModelLayer):
20
21 def __init__(self, model, input_record, name='bpr_loss', **kwargs):
22 super().__init__(model, name, input_record, **kwargs)
23 assert schema.is_schema_subset(
24 schema.Struct(
25 ('pos_prediction', schema.Scalar()),
26 ('neg_prediction', schema.List(np.float32)),
27 ),
28 input_record
29 )
30 self.tags.update([Tags.EXCLUDE_FROM_PREDICTION])
31 self.output_schema = schema.Scalar(
32 np.float32,
33 self.get_next_blob_reference('output'))
34
35 def add_ops(self, net):
36 # formula:

Callers

nothing calls this directly

Calls 2

updateMethod · 0.45

Tested by

no test coverage detected