MCPcopy Create free account
hub / github.com/FreeformRobotics/OTS / __init__

Method __init__

models/ots.py:42–57  ·  view source on GitHub ↗
(self, in_dim, one_hot_cls_num)

Source from the content-addressed store, hash-verified

40
41class OAM_GRAM(Module):
42 def __init__(self, in_dim, one_hot_cls_num):
43 super(OAM_GRAM, self).__init__()
44 self.attn1 = Obj_Attn_Block(in_dim, 2)
45 self.attn2 = Obj_Attn_Block(in_dim//2, 0.5)
46 self.depth_conv = nn.Conv2d(in_channels=in_dim,
47 out_channels=in_dim,
48 kernel_size=(one_hot_cls_num, 1),
49 stride=1,
50 padding=0,
51 groups=in_dim)
52 self.point_conv = Conv2d(in_channels=in_dim, out_channels=in_dim*2, kernel_size=1)
53 self.norm = nn.BatchNorm2d(in_dim*2)
54 self.relu = nn.ReLU(inplace=True)
55
56 for layer in [self.depth_conv, self.point_conv]:
57 weight_init(layer)
58
59 def forward(self, x):
60 x = self.attn1(x)

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 2

Obj_Attn_BlockClass · 0.85
weight_initFunction · 0.85

Tested by

no test coverage detected