MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / LinearDummy

Class LinearDummy

modules/networks.py:8–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8class LinearDummy(torch.nn.Module):
9 def __init__(self, in_channels, out_channels, bias=True):
10 super().__init__()
11 self.out_channels = out_channels
12 self.weight = torch.nn.Parameter(torch.randn(out_channels, in_channels))
13 self.bias=None
14 if bias:
15 self.bias = torch.nn.Parameter(torch.zeros(out_channels))
16
17 def forward(self, x, gain=1):
18 return F.linear(x, self.weight, self.bias)
19
20
21class BlockSiren(torch.nn.Module):

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected