MCPcopy Create free account

hub / github.com/ZhangXInFD/SpeechTokenizer / functions

Functions140 in github.com/ZhangXInFD/SpeechTokenizer

↓ 9 callersMethodload
(self, path = None, restore_optimizer = True)
speechtokenizer/trainer/trainer.py:243
↓ 9 callersMethodlog
(self, values: dict, step, type=None, **kwargs)
speechtokenizer/trainer/trainer.py:291
↓ 7 callersMethodprint
(self, msg)
speechtokenizer/trainer/trainer.py:266
↓ 6 callersFunctionis_distributed
()
speechtokenizer/quantization/distrib.py:28
↓ 5 callersMethod__init__
(self, period, kernel_size=5, stride=3, use_spectral_norm=False)
speechtokenizer/discriminators.py:23
↓ 5 callersMethod__init__
(self, in_channels: int, out_channels: int, kernel_size: int, stride: int = 1, dilation: int
speechtokenizer/modules/conv.py:179
↓ 4 callersFunctionapply_parametrization_norm
(module: nn.Module, norm: str = 'none')
speechtokenizer/modules/conv.py:25
↓ 4 callersFunctionget_2d_padding
(kernel_size: tp.Tuple[int, int], dilation: tp.Tuple[int, int] = (1, 1))
speechtokenizer/discriminators.py:150
↓ 4 callersFunctionget_norm_module
Return the proper normalization module. If causal is True, this will ensure the returned module is causal, or return an error if the normalization
speechtokenizer/modules/conv.py:37
↓ 4 callersFunctionget_padding
(kernel_size, dilation=1)
speechtokenizer/discriminators.py:13
↓ 4 callersFunctionmel_spectrogram
(y, n_fft, num_mels, sample_rate, hop_size, win_size, fmin, fmax, center=False)
speechtokenizer/trainer/loss.py:18
↓ 3 callersMethod__init__
(self, channels)
speechtokenizer/modules/seanet.py:32
↓ 3 callersMethoddecode
(self, embed_ind)
speechtokenizer/quantization/core_vq.py:200
↓ 3 callersFunctionmel_loss
(x, x_hat, **kwargs)
speechtokenizer/trainer/loss.py:52
↓ 3 callersMethodpush
Push the given symbol on the stream, flushing out bits if possible. Args: symbol (int): symbol to encode with the AC.
speechtokenizer/quantization/ac.py:130
↓ 3 callersFunctionworld_size
()
speechtokenizer/quantization/distrib.py:21
↓ 2 callersMethod__init__
( self, dim: int, codebook_size: int, kmeans_init: int = False, kmeans
speechtokenizer/quantization/core_vq.py:112
↓ 2 callersFunctionall_reduce
(tensor: torch.Tensor, op=torch.distributed.ReduceOp.SUM)
speechtokenizer/quantization/distrib.py:32
↓ 2 callersFunctionbuild_stable_quantized_cdf
Turn the given PDF into a quantized CDF that splits [0, 2 ** self.total_range_bits - 1] into chunks of size roughly proportional to the PDF.
speechtokenizer/quantization/ac.py:18
↓ 2 callersMethoddequantize
(self, embed_ind)
speechtokenizer/quantization/core_vq.py:186
↓ 2 callersFunctionema_inplace
(moving_avg, new, decay: float)
speechtokenizer/quantization/core_vq.py:47
↓ 2 callersMethodencode
(self, x)
speechtokenizer/quantization/core_vq.py:190
↓ 2 callersFunctionget_dataloader
(ds, **kwargs)
speechtokenizer/trainer/dataset.py:30
↓ 2 callersFunctionget_extra_padding_for_conv1d
See `pad_for_conv1d`.
speechtokenizer/modules/conv.py:54
↓ 2 callersFunctionget_optimizer
( params, lr = 1e-4, wd = 1e-2, betas = (0.9, 0.99), eps = 1e-8, filter_by_requires_gr
speechtokenizer/trainer/optimizer.py:11
↓ 2 callersFunctionpad1d
Tiny wrapper around F.pad, just to allow for reflect padding on small input. If this is the case, we insert extra 0 padding to the right before th
speechtokenizer/modules/conv.py:79
↓ 2 callersFunctionplot_spectrogram
(spectrogram)
speechtokenizer/trainer/loss.py:37
↓ 2 callersMethodpostprocess_emb
(self, embed_ind, shape)
speechtokenizer/quantization/core_vq.py:183
↓ 2 callersMethodpreprocess
(self, x)
speechtokenizer/quantization/core_vq.py:169
↓ 2 callersMethodpull
Pull a symbol, reading as many bits from the stream as required. This returns `None` when the stream has been exhausted. Args:
speechtokenizer/quantization/ac.py:217
↓ 2 callersMethodquantize
(self, x)
speechtokenizer/quantization/core_vq.py:173
↓ 2 callersFunctionsample_vectors
(samples, num: int)
speechtokenizer/quantization/core_vq.py:61
↓ 2 callersMethodsave
(self, path, best_dev_mel_loss)
speechtokenizer/trainer/trainer.py:225
↓ 2 callersMethodtrain
(self)
speechtokenizer/trainer/trainer.py:302
↓ 2 callersFunctionunpad1d
Remove padding from x, handling properly zero padding. Only for 1d!
speechtokenizer/modules/conv.py:99
↓ 2 callersMethodwarmup
(self, step)
speechtokenizer/trainer/trainer.py:285
↓ 1 callersMethod__len__
(self)
speechtokenizer/trainer/dataset.py:48
↓ 1 callersFunction_check_number_of_params
(params: tp.List[torch.Tensor])
speechtokenizer/quantization/distrib.py:41
↓ 1 callersMethod_flush_common_prefix
(self)
speechtokenizer/quantization/ac.py:111
↓ 1 callersMethod_flush_common_prefix
(self)
speechtokenizer/quantization/ac.py:201
↓ 1 callersFunction_is_complex_or_float
(tensor)
speechtokenizer/quantization/distrib.py:37
↓ 1 callersFunctionaccum_log
(log, new_logs)
speechtokenizer/trainer/trainer.py:37
↓ 1 callersFunctionadversarial_loss
(disc_outputs)
speechtokenizer/trainer/loss.py:77
↓ 1 callersFunctioncheckpoint_num_steps
Returns the number of steps trained from a checkpoint based on the filename. Filename format assumed to be something like "/path/to/soundstorm.20
speechtokenizer/trainer/trainer.py:43
↓ 1 callersMethodcontinue_train
(self)
speechtokenizer/trainer/trainer.py:425
↓ 1 callersMethoddecode
Parameters ---------- codes : torch.tensor Indices for each quantizer. Shape: (n_q, batch, timesteps). s
speechtokenizer/model.py:164
↓ 1 callersFunctiondefault
(val: tp.Any, d: tp.Any)
speechtokenizer/quantization/core_vq.py:43
↓ 1 callersFunctiondiscriminator_loss
(disc_real_outputs, disc_generated_outputs)
speechtokenizer/trainer/loss.py:67
↓ 1 callersFunctiondynamic_range_compression_torch
(x, C=1, clip_val=1e-5)
speechtokenizer/trainer/loss.py:5
↓ 1 callersMethodencode
Parameters ---------- x : torch.tensor Input wavs. Shape: (batch, channels, timesteps). n_q : int, optio
speechtokenizer/model.py:136
↓ 1 callersFunctionexists
(val)
speechtokenizer/trainer/trainer.py:25
↓ 1 callersMethodexpire_codes_
(self, batch_samples)
speechtokenizer/quantization/core_vq.py:157
↓ 1 callersFunctionfeature_loss
(fmap_r, fmap_g)
speechtokenizer/trainer/loss.py:58
↓ 1 callersMethodflush
Flush the remaining information to the stream.
speechtokenizer/quantization/ac.py:160
↓ 1 callersMethodinit_embed_
(self, data)
speechtokenizer/quantization/core_vq.py:139
↓ 1 callersFunctionkmeans
(samples, num_clusters: int, num_iters: int = 10)
speechtokenizer/quantization/core_vq.py:72
↓ 1 callersFunctionlaplace_smoothing
(x, n_categories: int, epsilon: float = 1e-5)
speechtokenizer/quantization/core_vq.py:51
↓ 1 callersMethodload_from_checkpoint
Parameters ---------- config_path : str Path of model configuration file. ckpt_path : str Pa
speechtokenizer/model.py:53
↓ 1 callersFunctionrecon_loss
(x, x_hat)
speechtokenizer/trainer/loss.py:48
↓ 1 callersMethodreplace_
(self, samples, mask)
speechtokenizer/quantization/core_vq.py:151
↓ 1 callersFunctionseparate_weight_decayable_params
(params)
speechtokenizer/trainer/optimizer.py:4
↓ 1 callersFunctionsnake
(x, alpha)
speechtokenizer/modules/seanet.py:23
↓ 1 callersFunctionspectral_normalize_torch
(magnitudes)
speechtokenizer/trainer/loss.py:9
↓ 1 callersFunctiontest
()
speechtokenizer/modules/seanet.py:261
↓ 1 callersFunctiontest
()
speechtokenizer/quantization/ac.py:263
Method__getitem__
(self, index)
speechtokenizer/trainer/dataset.py:52
Method__init__
(self)
speechtokenizer/discriminators.py:59
Method__init__
(self, use_spectral_norm=False)
speechtokenizer/discriminators.py:86
Method__init__
(self)
speechtokenizer/discriminators.py:114
Method__init__
(self, filters: int, in_channels: int = 1, out_channels: int = 1, n_fft: int = 1024, hop_leng
speechtokenizer/discriminators.py:172
Method__init__
(self, filters: int, in_channels: int = 1, out_channels: int = 1, n_ffts: tp.List[int] = [102
speechtokenizer/discriminators.py:241
Method__init__
Parameters ---------- config : json Model Config.
speechtokenizer/model.py:15
Method__init__
(self, dim: int, kernel_sizes: tp.List[int] = [3, 1], dilations: tp.List[int] = [1, 1], activ
speechtokenizer/modules/seanet.py:54
Method__init__
(self, channels: int = 1, dimension: int = 128, n_filters: int = 32, n_residual_layers: int = 1,
speechtokenizer/modules/seanet.py:110
Method__init__
(self, channels: int = 1, dimension: int = 128, n_filters: int = 32, n_residual_layers: int = 1,
speechtokenizer/modules/seanet.py:194
Method__init__
(self, normalized_shape: tp.Union[int, tp.List[int], torch.Size], **kwargs)
speechtokenizer/modules/norm.py:21
Method__init__
(self, *args, causal: bool = False, norm: str = 'none', norm_kwargs: tp.Dict[str, tp.Any] = {
speechtokenizer/modules/conv.py:112
Method__init__
(self, *args, norm: str = 'none', norm_kwargs: tp.Dict[str, tp.Any] = {}, **kwargs)
speechtokenizer/modules/conv.py:129
Method__init__
(self, *args, causal: bool = False, norm: str = 'none', norm_kwargs: tp.Dict[str, tp.Any] = {
speechtokenizer/modules/conv.py:146
Method__init__
(self, *args, norm: str = 'none', norm_kwargs: tp.Dict[str, tp.Any] = {}, **kwargs)
speechtokenizer/modules/conv.py:163
Method__init__
(self, in_channels: int, out_channels: int, kernel_size: int, stride: int = 1, causal: bool =
speechtokenizer/modules/conv.py:217
Method__init__
(self, dimension: int, num_layers: int = 2, skip: bool = True, bidirectional: bool=False)
speechtokenizer/modules/lstm.py:17
Method__init__
( self, dimension: int = 256, n_q: int = 8, bins: int = 1024, decay: f
speechtokenizer/quantization/vq.py:41
Method__init__
( self, dim: int, codebook_size: int, codebook_dim: tp.Optional[int] = None,
speechtokenizer/quantization/core_vq.py:248
Method__init__
(self, *, num_quantizers, **kwargs)
speechtokenizer/quantization/core_vq.py:318
Method__init__
(self, fo: tp.IO[bytes], total_range_bits: int = 24)
speechtokenizer/quantization/ac.py:96
Method__init__
(self, fo: tp.IO[bytes], total_range_bits: int = 24)
speechtokenizer/quantization/ac.py:185
Method__init__
(self, file_list, segment_size, sample_rate,
speechtokenizer/trainer/dataset.py:35
Method__init__
( self, generator: SpeechTokenizer, discriminators: dict, cfg, acceler
speechtokenizer/trainer/trainer.py:59
Functionaverage_metrics
Average a dictionary of metrics across all workers, using the optional `count` as unormalized weight.
speechtokenizer/quantization/distrib.py:114
Methodbin_search
(low_idx: int, high_idx: int)
speechtokenizer/quantization/ac.py:235
Functionbroadcast_tensors
Broadcast the tensors from the given parameters to all workers. This can be used to ensure that all workers have the same model to start with.
speechtokenizer/quantization/distrib.py:56
Functioncast_tuple
(t)
speechtokenizer/trainer/trainer.py:33
Methodcodebook
(self)
speechtokenizer/quantization/core_vq.py:277
Functioncollate_fn
(data)
speechtokenizer/trainer/dataset.py:8
Functioncycle
(dl)
speechtokenizer/trainer/trainer.py:28
Functiond_axis_distill_loss
(feature, target_feature)
speechtokenizer/trainer/loss.py:86
Methoddecode
Decode the given codes to the quantized representation. Args: codes (torch.Tensor): Input indices for each quantizer.
speechtokenizer/quantization/vq.py:101
Methoddecode
(self, embed_ind)
speechtokenizer/quantization/core_vq.py:286
Methoddecode
(self, q_indices: torch.Tensor, st: int=0)
speechtokenizer/quantization/core_vq.py:360
next →1–100 of 140, ranked by callers