MCPcopy Create free account
hub / github.com/YeWR/EfficientZero / __init__

Method __init__

config/atari/model.py:88–118  ·  view source on GitHub ↗
(self, in_channels, out_channels, momentum=0.1)

Source from the content-addressed store, hash-verified

86# Downsample observations before representation network (See paper appendix Network Architecture)
87class DownSample(nn.Module):
88 def __init__(self, in_channels, out_channels, momentum=0.1):
89 super().__init__()
90 self.conv1 = nn.Conv2d(
91 in_channels,
92 out_channels // 2,
93 kernel_size=3,
94 stride=2,
95 padding=1,
96 bias=False,
97 )
98 self.bn1 = nn.BatchNorm2d(out_channels // 2, momentum=momentum)
99 self.resblocks1 = nn.ModuleList(
100 [ResidualBlock(out_channels // 2, out_channels // 2, momentum=momentum) for _ in range(1)]
101 )
102 self.conv2 = nn.Conv2d(
103 out_channels // 2,
104 out_channels,
105 kernel_size=3,
106 stride=2,
107 padding=1,
108 bias=False,
109 )
110 self.downsample_block = ResidualBlock(out_channels // 2, out_channels, momentum=momentum, stride=2, downsample=self.conv2)
111 self.resblocks2 = nn.ModuleList(
112 [ResidualBlock(out_channels, out_channels, momentum=momentum) for _ in range(1)]
113 )
114 self.pooling1 = nn.AvgPool2d(kernel_size=3, stride=2, padding=1)
115 self.resblocks3 = nn.ModuleList(
116 [ResidualBlock(out_channels, out_channels, momentum=momentum) for _ in range(1)]
117 )
118 self.pooling2 = nn.AvgPool2d(kernel_size=3, stride=2, padding=1)
119
120 def forward(self, x):
121 x = self.conv1(x)

Callers 5

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 1

ResidualBlockClass · 0.85

Tested by

no test coverage detected