MCPcopy Create free account
hub / github.com/NineAbyss/ZeroG / get_loss

Method get_loss

code/model.py:189–194  ·  view source on GitHub ↗
(self, pos_h, neg_h, summary)

Source from the content-addressed store, hash-verified

187 return torch.sigmoid(value)
188
189 def get_loss(self, pos_h, neg_h, summary):
190
191 pos_loss = -torch.log(self.discriminate(pos_h, summary) + self.EPS).mean()
192 neg_loss = -torch.log(1 - self.discriminate(neg_h, summary) + self.EPS).mean()
193
194 return pos_loss + neg_loss
195
196
197 # def predict(self, x, edge_index, edge_weigt=None, batch=None):

Callers

nothing calls this directly

Calls 1

discriminateMethod · 0.95

Tested by

no test coverage detected