MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / __init__

Method __init__

tools/cosmos_vae_test.py:33–46  ·  view source on GitHub ↗
(self, z_channels: int, z_factor: int, embedding_dim: int, **kwargs)

Source from the content-addressed store, hash-verified

31
32class CausalContinuousVideoTokenizer(nn.Module):
33 def __init__(self, z_channels: int, z_factor: int, embedding_dim: int, **kwargs) -> None:
34 super().__init__()
35 self.name = kwargs.get("name", "CausalContinuousVideoTokenizer")
36 self.embedding_dim = embedding_dim
37 self.sigma_data = 0.5
38 self.encoder = EncoderFactorized(z_channels=z_factor * z_channels, **kwargs)
39 self.decoder = DecoderFactorized(z_channels=z_channels, **kwargs)
40
41 self.quant_conv = CausalConv3d(z_factor * z_channels, embedding_dim, kernel_size=1, padding=0)
42 self.post_quant_conv = CausalConv3d(embedding_dim, z_channels, kernel_size=1, padding=0)
43
44 latent_temporal_chunk = 16
45 self.latent_mean = nn.Parameter(torch.zeros([self.embedding_dim * latent_temporal_chunk], dtype=torch.float32))
46 self.latent_std = nn.Parameter(torch.ones([self.embedding_dim * latent_temporal_chunk], dtype=torch.float32))
47
48
49 def encode(self, x):

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
CausalConv3dClass · 0.50

Tested by

no test coverage detected