MCPcopy Create free account
hub / github.com/Anoise/WTFlib / __init__

Method __init__

LDPS_Graph/layers/utils.py:347–356  ·  view source on GitHub ↗
(self, d=2, p=2, size_average=True, reduction=True)

Source from the content-addressed store, hash-verified

345
346class LpLoss(object):
347 def __init__(self, d=2, p=2, size_average=True, reduction=True):
348 super(LpLoss, self).__init__()
349
350 #Dimension and Lp-norm type are postive
351 assert d > 0 and p > 0
352
353 self.d = d
354 self.p = p
355 self.reduction = reduction
356 self.size_average = size_average
357
358 def abs(self, x, y):
359 num_examples = x.size()[0]

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected