MCPcopy Create free account
hub / github.com/MotrixLab/insactor / FFN

Class FFN

diffplanner/models/transformers/diffusion_transformer.py:61–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60
61class FFN(nn.Module):
62
63 def __init__(self, latent_dim, ffn_dim, dropout, time_embed_dim):
64 super().__init__()
65 self.linear1 = nn.Linear(latent_dim, ffn_dim)
66 self.linear2 = zero_module(nn.Linear(ffn_dim, latent_dim))
67 self.activation = nn.GELU()
68 self.dropout = nn.Dropout(dropout)
69 self.proj_out = StylizationBlock(latent_dim, time_embed_dim, dropout)
70
71 def forward(self, x, emb, **kwargs):
72 y = self.linear2(self.dropout(self.activation(self.linear1(x))))
73 y = x + self.proj_out(y, emb)
74 return y
75
76
77class DecoderLayer(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected