MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / NetLinLayer

Class NetLinLayer

sat/sgm/modules/autoencoding/lpips/loss/lpips.py:68–83  ·  view source on GitHub ↗

A single linear layer which does a 1x1 conv

Source from the content-addressed store, hash-verified

66
67
68class NetLinLayer(nn.Module):
69 """A single linear layer which does a 1x1 conv"""
70
71 def __init__(self, chn_in, chn_out=1, use_dropout=False):
72 super(NetLinLayer, self).__init__()
73 layers = (
74 [
75 nn.Dropout(),
76 ]
77 if (use_dropout)
78 else []
79 )
80 layers += [
81 nn.Conv2d(chn_in, chn_out, 1, stride=1, padding=0, bias=False),
82 ]
83 self.model = nn.Sequential(*layers)
84
85
86class vgg16(torch.nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected