MCPcopy Create free account
hub / github.com/Francis-Rings/MotionFollower / __init__

Method __init__

src/models/motion_module.py:44–74  ·  view source on GitHub ↗
(
        self,
        in_channels,
        num_attention_heads=8,
        num_transformer_block=2,
        attention_block_types=("Temporal_Self", "Temporal_Self"),
        cross_frame_attention_mode=None,
        temporal_position_encoding=False,
        temporal_position_encoding_max_len=24,
        temporal_attention_dim_div=1,
        zero_initialize=True,
    )

Source from the content-addressed store, hash-verified

42
43class VanillaTemporalModule(nn.Module):
44 def __init__(
45 self,
46 in_channels,
47 num_attention_heads=8,
48 num_transformer_block=2,
49 attention_block_types=("Temporal_Self", "Temporal_Self"),
50 cross_frame_attention_mode=None,
51 temporal_position_encoding=False,
52 temporal_position_encoding_max_len=24,
53 temporal_attention_dim_div=1,
54 zero_initialize=True,
55 ):
56 super().__init__()
57
58 self.temporal_transformer = TemporalTransformer3DModel(
59 in_channels=in_channels,
60 num_attention_heads=num_attention_heads,
61 attention_head_dim=in_channels
62 // num_attention_heads
63 // temporal_attention_dim_div,
64 num_layers=num_transformer_block,
65 attention_block_types=attention_block_types,
66 cross_frame_attention_mode=cross_frame_attention_mode,
67 temporal_position_encoding=temporal_position_encoding,
68 temporal_position_encoding_max_len=temporal_position_encoding_max_len,
69 )
70
71 if zero_initialize:
72 self.temporal_transformer.proj_out = zero_module(
73 self.temporal_transformer.proj_out
74 )
75
76 def forward(
77 self,

Callers

nothing calls this directly

Calls 3

zero_moduleFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected