MCPcopy Create free account
hub / github.com/lingeringlight/START / __init__

Method __init__

models/vmamba.py:581–606  ·  view source on GitHub ↗
(
            self,
            hidden_dim: int = 0,
            drop_path: float = 0,
            norm_layer: Callable[..., torch.nn.Module] = partial(nn.LayerNorm, eps=1e-6),
            attn_drop_rate: float = 0,
            d_state: int = 16,
            spatial_aug_flag: int = 0,
            START_flag=1,
            START_p=1.0,
            START_token_prob=0.75,
            START_batch_prob=0.5,
            START_attention_mode=0,
            **kwargs,
    )

Source from the content-addressed store, hash-verified

579
580class VSSBlock(nn.Module):
581 def __init__(
582 self,
583 hidden_dim: int = 0,
584 drop_path: float = 0,
585 norm_layer: Callable[..., torch.nn.Module] = partial(nn.LayerNorm, eps=1e-6),
586 attn_drop_rate: float = 0,
587 d_state: int = 16,
588 spatial_aug_flag: int = 0,
589 START_flag=1,
590 START_p=1.0,
591 START_token_prob=0.75,
592 START_batch_prob=0.5,
593 START_attention_mode=0,
594 **kwargs,
595 ):
596 super().__init__()
597 self.ln_1 = norm_layer(hidden_dim)
598 self.self_attention = SS2D(d_model=hidden_dim, dropout=attn_drop_rate, d_state=d_state,
599 spatial_aug_flag=spatial_aug_flag,
600 START_flag=START_flag,
601 START_p=START_p,
602 START_token_prob=START_token_prob,
603 START_batch_prob=START_batch_prob,
604 START_attention_mode=START_attention_mode,
605 **kwargs)
606 self.drop_path = DropPath(drop_path)
607
608 def forward(self, input: torch.Tensor):
609 x = input + self.drop_path(self.self_attention(self.ln_1(input)))

Callers

nothing calls this directly

Calls 2

SS2DClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected