MCPcopy Create free account
hub / github.com/NarcissusEx/GuardSplat / load_data

Method load_data

wm_utils.py:93–101  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

91 return len(self.data)
92
93 def load_data(self):
94 max_value = int(2 ** self.msg_len)
95 if not hasattr(self, 'b2t_maps'):
96 rand_tokens = torch.randperm(CLIP_TOKEN_MAX) + 1
97 self.b2t_maps = rand_tokens[:2 * self.msg_len].reshape(self.msg_len, 2)
98
99 if not hasattr(self, 'data'):
100 dec_messages = sample_K_from_N(self.max_size, max_value)
101 self.data = [self.dec_message_to_tokens(x) for x in dec_messages]
102
103 # Decimal message -> Binary message + CLIP tokens
104 def dec_message_to_tokens(self, dec_message):

Callers 1

__init__Method · 0.95

Calls 2

dec_message_to_tokensMethod · 0.95
sample_K_from_NFunction · 0.85

Tested by

no test coverage detected