MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / MLPProj

Class MLPProj

models/transformer/wan/modules/tm2m_model.py:521–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519
520
521class MLPProj(torch.nn.Module):
522
523 def __init__(self, in_dim, out_dim):
524 super().__init__()
525
526 self.proj = torch.nn.Sequential(
527 torch.nn.LayerNorm(in_dim), torch.nn.Linear(in_dim, in_dim),
528 torch.nn.GELU(), torch.nn.Linear(in_dim, out_dim),
529 torch.nn.LayerNorm(out_dim))
530
531 def forward(self, image_embeds):
532 clip_extra_context_tokens = self.proj(image_embeds)
533 return clip_extra_context_tokens
534
535class PositionalEncoding(nn.Module):
536 def __init__(self, d_model, max_len=5000):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected