MCPcopy Create free account
hub / github.com/10Ring/LAA-Net / SwishImplementation

Class SwishImplementation

models/networks/efficientNet.py:380–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378
379
380class SwishImplementation(torch.autograd.Function):
381 @staticmethod
382 def forward(ctx, i):
383 result = i * torch.sigmoid(i)
384 ctx.save_for_backward(i)
385 return result
386
387 @staticmethod
388 def backward(ctx, grad_output):
389 i = ctx.saved_tensors[0]
390 sigmoid_i = torch.sigmoid(i)
391 return grad_output * (sigmoid_i * (1 + i * (1 - sigmoid_i)))
392
393
394def get_width_and_height_from_size(x):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected