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

Class Encoder

src/shape_assembly/models/train/transformer.py:37–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35 return self.decode(self.encode(src, src_mask), src_mask, tgt, tgt_mask)
36
37class Encoder(pl.LightningModule):
38 def __init__(self, layer, N):
39 super().__init__()
40 self.layers = clones(layer, N)
41 self.norm = LayerNorm(layer.size)
42
43 def forward(self, x, mask):
44 for layer in self.layers:
45 x = layer(x, mask)
46 return self.norm(x)
47
48class Decoder(pl.LightningModule):
49 def __init__(self, layer, N):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected