MCPcopy Create free account
hub / github.com/Royalvice/DocDiff / Swish

Class Swish

model/DocDiff.py:9–16  ·  view source on GitHub ↗

### Swish activation function $$x \cdot \sigma(x)$$

Source from the content-addressed store, hash-verified

7
8
9class Swish(nn.Module):
10 """
11 ### Swish activation function
12 $$x \cdot \sigma(x)$$
13 """
14
15 def forward(self, x):
16 return x * torch.sigmoid(x)
17
18
19class TimeEmbedding(nn.Module):

Callers 3

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected