MCPcopy Create free account
hub / github.com/TEA-Lab/TwoByTwo / __init__

Method __init__

src/shape_assembly/models/train/transformer.py:148–167  ·  view source on GitHub ↗
(self, cfg)

Source from the content-addressed store, hash-verified

146class Transformer(pl.LightningModule):
147
148 def __init__(self, cfg):
149 super().__init__()
150 c = copy.deepcopy
151 attn = MultiHeadedAttention(
152 cfg.model.num_heads,
153 cfg.model.pc_feat_dim
154 )
155
156 ff = PositionwiseFeedForward(
157 cfg.model.pc_feat_dim,
158 cfg.model.transformer_feat_dim
159 )
160
161 self.model = EncoderDecoder(
162 Encoder(EncoderLayer(cfg.model.pc_feat_dim, c(attn), c(ff)), cfg.model.num_blocks),
163 Decoder(DecoderLayer(cfg.model.pc_feat_dim, c(attn), c(attn), c(ff)), cfg.model.num_blocks),
164 nn.Sequential(),
165 nn.Sequential(),
166 nn.Sequential()
167 )
168
169 def forward(self, src, tgt):
170 src = src.transpose(2, 1).contiguous()

Callers

nothing calls this directly

Calls 8

EncoderDecoderClass · 0.85
EncoderClass · 0.85
EncoderLayerClass · 0.85
DecoderClass · 0.85
DecoderLayerClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected