Skip to content

Commit

Permalink
Feat: Update nat
Browse files Browse the repository at this point in the history
Feat: Update loader.py
  • Loading branch information
speedcell4 committed Sep 10, 2024
1 parent 4bf48f3 commit 8900975
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions torchglyph/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,11 @@ def update(self, sequence: Z) -> None:
class HashMetric(MetricCollection):
def __init__(self) -> None:
super(HashMetric, self).__init__({
'loss': MeanMetric(),
'pos': MeanMetric(),
'neg': MeanMetric(),
'unique': MeanMetric(),
})

def update_loss(self, loss: Tensor) -> None:
self['loss'].update(loss)

def update(self, x: Tensor, y: Tensor, t1: Tensor, t2: Tensor) -> None:
pos = t1[:, None] == t2[None, :]
neg = t1[:, None] != t2[None, :]
Expand Down

0 comments on commit 8900975

Please sign in to comment.