(self, model, input_record, name='bpr_loss', **kwargs)
| 19 | class 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: |
nothing calls this directly
no test coverage detected