MCPcopy Create free account
hub / github.com/ml-explore/mlx-examples / __init__

Method __init__

encodec/encodec.py:418–429  ·  view source on GitHub ↗
(self, config)

Source from the content-addressed store, hash-verified

416 """Residual Vector Quantizer."""
417
418 def __init__(self, config):
419 super().__init__()
420 self.codebook_size = config.codebook_size
421
422 hop_length = np.prod(config.upsampling_ratios)
423 self.frame_rate = math.ceil(config.sampling_rate / hop_length)
424 self.num_quantizers = int(
425 1000 * config.target_bandwidths[-1] // (self.frame_rate * 10)
426 )
427 self.layers = [
428 EncodecVectorQuantization(config) for _ in range(self.num_quantizers)
429 ]
430
431 def get_num_quantizers_for_bandwidth(
432 self, bandwidth: Optional[float] = None

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45

Tested by

no test coverage detected