MCPcopy Create free account
hub / github.com/ByteDance-Seed/Bagel / encode

Method encode

modeling/autoencoder.py:315–318  ·  view source on GitHub ↗
(self, x: Tensor)

Source from the content-addressed store, hash-verified

313 self.shift_factor = params.shift_factor
314
315 def encode(self, x: Tensor) -> Tensor:
316 z = self.reg(self.encoder(x))
317 z = self.scale_factor * (z - self.shift_factor)
318 return z
319
320 def decode(self, z: Tensor) -> Tensor:
321 z = z / self.scale_factor + self.shift_factor

Callers 10

forwardMethod · 0.95
_tokenizeMethod · 0.80
prepare_promptsMethod · 0.80
unk_token_lengthMethod · 0.80
_tokenizeMethod · 0.80
__iter__Method · 0.80
__iter__Method · 0.80
_add_textMethod · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected