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

Method __init__

model/DocDiff.py:24–35  ·  view source on GitHub ↗

* `n_channels` is the number of dimensions in the embedding

(self, n_channels: int)

Source from the content-addressed store, hash-verified

22 """
23
24 def __init__(self, n_channels: int):
25 """
26 * `n_channels` is the number of dimensions in the embedding
27 """
28 super().__init__()
29 self.n_channels = n_channels
30 # First linear layer
31 self.lin1 = nn.Linear(self.n_channels // 4, self.n_channels)
32 # Activation
33 self.act = Swish()
34 # Second linear layer
35 self.lin2 = nn.Linear(self.n_channels, self.n_channels)
36
37 def forward(self, t: torch.Tensor):
38 # Create sinusoidal position embeddings

Callers

nothing calls this directly

Calls 2

SwishClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected