MCPcopy Create free account

hub / github.com/Stability-AI/stable-audio-tools / functions

Functions1,182 in github.com/Stability-AI/stable-audio-tools

↓ 4 callersMethodforward
(self, audio, latent, text = None, masking = True)
stable_audio_tools/models/discriminators.py:146
↓ 4 callersFunctionget_2d_padding
(kernel_size: tp.Tuple[int, int], dilation: tp.Tuple[int, int] = (1, 1))
stable_audio_tools/models/encodec.py:34
↓ 4 callersMethodget_buffers_iter
(self, model)
stable_audio_tools/training/ema.py:114
↓ 4 callersFunctionget_hinge_losses
(score_real, score_fake)
stable_audio_tools/models/discriminators.py:30
↓ 4 callersMethodget_params_iter
(self, model)
stable_audio_tools/training/ema.py:108
↓ 4 callersFunctionget_transformer_dim
Return d_model as a clean multiple of head_dim. Uses a saturating sqrt-law: d_raw = k * sqrt(c), but performs rounding and clamping in u
stable_audio_tools/models/discriminators.py:1523
↓ 4 callersFunctionrecursive_wrap
Recursively wrap modules matching the given policy. Uses depth-first traversal to wrap child modules before their parents. Must be calle
stable_audio_tools/training/fsdp.py:141
↓ 4 callersFunctionunfold_channels_from_batch
(x, channels)
stable_audio_tools/models/pretransforms.py:22
↓ 3 callersFunctionTimePositionalEmbedding
(dim: int, out_features: int)
stable_audio_tools/models/adp.py:675
↓ 3 callersFunctionWNConvTranspose1d
(*args, **kwargs)
stable_audio_tools/models/autoencoders.py:28
↓ 3 callersMethod__init__
(self, n_samples, randomize=True)
stable_audio_tools/data/utils.py:11
↓ 3 callersMethod__init__
(self, sample_rate=32000)
stable_audio_tools/training/metrics/fad_metrics.py:240
↓ 3 callersMethod_calculate_loss
(self, logits_pos, logits_neg)
stable_audio_tools/models/discriminators.py:215
↓ 3 callersMethod_forward
( self, x, t, mask=None, cross_attn_cond=None, cross_attn_cond
stable_audio_tools/models/dit.py:179
↓ 3 callersFunction_init_bn
(bn)
stable_audio_tools/training/metrics/fad_metrics.py:213
↓ 3 callersMethod_istft
(self, X: torch.Tensor, length: Optional[int])
stable_audio_tools/models/pretransforms.py:279
↓ 3 callersMethod_muon_update_single
(self, p, group)
stable_audio_tools/training/optims.py:377
↓ 3 callersMethod_scale_and_shift
(self, z)
stable_audio_tools/models/fsq.py:78
↓ 3 callersMethod_scale_and_shift_inverse
(self, level_indices)
stable_audio_tools/models/fsq.py:82
↓ 3 callersFunction_zero_pad_modulo_sequence
(x, size, dim=-2)
stable_audio_tools/models/autoencoders.py:108
↓ 3 callersMethodapply_attn
(self, q, k, v, causal = None, flex_attention_block_mask = None, flex_attention_score_mod = None, flash_attn_s
stable_audio_tools/models/transformer.py:596
↓ 3 callersFunctionapply_reduction
(losses, reduction="none", retain_batch_dim=False)
stable_audio_tools/training/losses/auraloss.py:45
↓ 3 callersFunctionapply_to_lora
apply a function to LoRAParametrization layers, designed to be used with model.apply
stable_audio_tools/models/lora/utils.py:11
↓ 3 callersMethodbuild_noise_dist
(self, key)
stable_audio_tools/training/arc.py:1379
↓ 3 callersFunctioncompute_mean_kernel
(x, y)
stable_audio_tools/models/bottleneck.py:162
↓ 3 callersFunctioncreate_dataloader_from_config
(dataset_config, batch_size, sample_size, sample_rate, audio_channels=2, num_workers=4, shuffle = True, tokeni
stable_audio_tools/data/dataset.py:958
↓ 3 callersMethoddecode
(self, z)
stable_audio_tools/models/pretransforms.py:45
↓ 3 callersFunctiondefault_noise_sampler
(x)
stable_audio_tools/inference/k_diffusion/sampling.py:42
↓ 3 callersMethoddisable_lora
(self)
stable_audio_tools/models/lora/model.py:248
↓ 3 callersMethoddpm_solver_2_step
(self, x, t, t_next, r1=1 / 2, eps_cache=None)
stable_audio_tools/inference/k_diffusion/sampling.py:252
↓ 3 callersFunctionextract_embeddings
Extract audio embeddings using any combination of CLAP, PANNs, and VGGish. Args: id2audio: dict mapping id to audio tensor on GPU (s
stable_audio_tools/training/metrics/fad_metrics.py:384
↓ 3 callersFunctionfast_scandir
very fast `glob` alternative. from https://stackoverflow.com/a/59803793/4259243
stable_audio_tools/data/dataset.py:27
↓ 3 callersMethodforward_from_seq_len
(self, seq_len)
stable_audio_tools/models/transformer.py:270
↓ 3 callersFunctionget_ancestral_step
Calculates the noise level (sigma_down) to step down to and the amount of noise to add (sigma_up) when doing an ancestral sampling step.
stable_audio_tools/inference/k_diffusion/sampling.py:32
↓ 3 callersFunctionget_non_fsdp_trainable_params
Get trainable parameters that are NOT managed by FSDP. These parameters need explicit gradient synchronization via sync_non_fsdp_gradients()
stable_audio_tools/training/fsdp.py:38
↓ 3 callersFunctionget_relativistic_losses
(score_real, score_fake)
stable_audio_tools/models/discriminators.py:41
↓ 3 callersMethodmanual_backward_with_sync
Perform backward pass and sync gradients for non-FSDP trainable parameters. FSDP only synchronizes gradients for wrapped modules. No
stable_audio_tools/training/arc.py:948
↓ 3 callersFunctionmulti_bandwidth_kernel_2d
Compute the sum of Gaussian kernels (with different bandwidths) between two flat tensors. Args: x: Tensor of shape (B, D) y:
stable_audio_tools/training/losses/utils.py:27
↓ 3 callersFunctionmultinomial
torch.multinomial with arbitrary number of dimensions, and number of candidates on the last dimension. Args: input (torch.Tensor): The in
stable_audio_tools/models/utils.py:66
↓ 3 callersFunctionpca_point_cloud
( tokens, # embeddings / latent vectors. shape = (b, d, n) color_scheme='batch', #
stable_audio_tools/interface/aeiou.py:152
↓ 3 callersMethodpreprocess_audio_for_encoder
Preprocess single audio tensor (Channels x Length) to be compatible with the encoder. If the model is mono, stereo audio will be conv
stable_audio_tools/models/autoencoders.py:933
↓ 3 callersFunctionsample_params_per_example
(M: int)
stable_audio_tools/training/autoencoders.py:159
↓ 3 callersFunctionsample_v
Draws samples from a model given starting noise. v-diffusion DDIM. Args: sigmas: Pre-computed schedule tensor of shape (steps,).
stable_audio_tools/inference/sampling.py:574
↓ 3 callersFunctionsave_lora_safetensors
Save a LoRA checkpoint in safetensors format with config as metadata. The lora_config dict is JSON-serialized and stored under the metadata key
stable_audio_tools/models/lora/utils.py:201
↓ 3 callersFunctionset_audio_channels
(audio, target_channels)
stable_audio_tools/inference/utils.py:5
↓ 3 callersFunctionset_requires_grad
(model, req_grad: bool)
stable_audio_tools/training/autoencoders.py:31
↓ 3 callersMethodshift
Transform t∈[0,1] to log-SNR-spaced t with adaptive bounds. Maps through: logsnr = logsnr_end - t * (logsnr_end - logsnr_start)
stable_audio_tools/inference/sampling.py:195
↓ 3 callersMethodspectrogram
(self, x)
stable_audio_tools/models/discriminators.py:646
↓ 3 callersFunctiontruncated_logistic_normal_rescaled
shape: shape of the output tensor left_trunc: left truncation point, fraction of probability to be discarded right_trunc: right truncati
stable_audio_tools/inference/sampling.py:337
↓ 3 callersFunctionupdate_ema_fsdp
FSDP-aware EMA update using summon_full_params. The ema_pytorch library captures parameter names at initialization. When the online mode
stable_audio_tools/training/fsdp.py:91
↓ 3 callersFunctionvae_sample
(mean, scale)
stable_audio_tools/models/bottleneck.py:131
↓ 2 callersFunctionDownsample1d
( in_channels: int, out_channels: int, factor: int, kernel_multiplier: int = 2 )
stable_audio_tools/models/adp.py:174
↓ 2 callersFunctionUpsample1d
( in_channels: int, out_channels: int, factor: int, use_nearest: bool = False )
stable_audio_tools/models/adp.py:187
↓ 2 callersMethod__init__
( self, configs, sample_size=65536, sample_rate=48000, random_crop=Tru
stable_audio_tools/data/dataset.py:189
↓ 2 callersMethod__init__
( self, params, lr: float = 1e-4, betas: Tuple[float, float] = (0.9, 0.99),
stable_audio_tools/training/optims.py:138
↓ 2 callersMethod__init__
( self, sample_rate: int = 48000, clap_model: str = 'music_audioset_epoch_15_esc_90.14
stable_audio_tools/training/losses/semantic.py:89
↓ 2 callersMethod__init__
(self, *args, **kwargs)
stable_audio_tools/models/encodec.py:23
↓ 2 callersMethod_apply_local_conditioning
Apply local additive and modular local conditioning to x.
stable_audio_tools/models/transformer.py:974
↓ 2 callersMethod_build_reverted_sequence_scatter_indexes
Builds scatter indexes required to retrieve the original multi-codebook sequence from interleaving pattern. Args: sequenc
stable_audio_tools/models/codebook_patterns.py:178
↓ 2 callersMethod_compute_Beta
(self)
stable_audio_tools/models/pretransforms.py:303
↓ 2 callersMethod_compute_W
(self)
stable_audio_tools/models/pretransforms.py:297
↓ 2 callersMethod_compute_bmld
Compute Binaural Masking Level Difference Returns: unmasking factor [B, F, T]
stable_audio_tools/models/psychoacoustics.py:297
↓ 2 callersMethod_compute_score_masks
Derive score masks from padding_mask and actual score tensor shapes. Uses adaptive_max_pool1d for downsampled outputs so that a score positio
stable_audio_tools/training/arc.py:821
↓ 2 callersMethod_create_dist_shift
Create a distribution shift object from config options.
stable_audio_tools/models/diffusion.py:155
↓ 2 callersFunction_demod_sign
Parity demod for hop=N/2. Returns ±1 with shape [1,1,F,M] (if expand_bc) for unambiguous broadcast against X[...,F,M]. Numerically exact for h
stable_audio_tools/models/pretransforms.py:158
↓ 2 callersFunction_expand
Expand bracket notation in layer filter strings, e.g. 'layers[0-5]' -> ['layers0', ..., 'layers5'].
stable_audio_tools/models/lora/model.py:307
↓ 2 callersMethod_extract_features
Run audio through HTSAT's spectrogram frontend and transformer layers, returning intermediate features from each BasicLayer.
stable_audio_tools/training/losses/semantic.py:141
↓ 2 callersMethod_filter_hidden_states
Keep only hidden states needed for discriminator scoring. Strips prepended memory tokens so shapes match padding_mask.
stable_audio_tools/training/arc.py:784
↓ 2 callersMethod_generate_shaped_noise
Generate frequency-shaped noise
stable_audio_tools/models/psychoacoustics.py:317
↓ 2 callersMethod_get_seg_sizes
(self, stride, prepend_cond_length = 0)
stable_audio_tools/models/autoencoders.py:173
↓ 2 callersMethod_get_sliding_window_size
(self, window, stride, prepend_cond_length = 0)
stable_audio_tools/models/autoencoders.py:167
↓ 2 callersFunction_hann
(n, device, dtype)
stable_audio_tools/models/psychoacoustics.py:8
↓ 2 callersFunction_hermitian_sqrt
√2 for interior one-sided bins; 1 for DC (and Nyquist if even N).
stable_audio_tools/models/transforms.py:349
↓ 2 callersFunction_hz_to_bark
Convert frequency in Hz to Bark scale using Zwicker & Fastl formula
stable_audio_tools/models/psychoacoustics.py:16
↓ 2 callersMethod_init_buffers
Initialize frequency-domain buffers
stable_audio_tools/models/psychoacoustics.py:113
↓ 2 callersMethod_istft
Compute ISTFT
stable_audio_tools/models/psychoacoustics.py:151
↓ 2 callersFunction_left_pad_to_match
Left-pad or right-trim emb along seq dim to match target_len. Used for local conditioning embeddings that need to align with x without affect
stable_audio_tools/models/transformer.py:77
↓ 2 callersFunction_match_layer_type
Find the matching lora_config key for a layer, using isinstance to handle ParametrizedLinear etc.
stable_audio_tools/models/lora/model.py:342
↓ 2 callersFunction_matches_any
Check if name contains any pattern substring (with bracket expansion).
stable_audio_tools/models/lora/model.py:329
↓ 2 callersFunction_maybe_create_weighted_sampler
Create a WeightedRandomSampler if any dataset has non-default weights, otherwise return None.
stable_audio_tools/data/dataset.py:946
↓ 2 callersFunction_power_sine_tight
Tight (Parseval) power-sine analysis window for hop H=N/R (integer R>=2). g[n] = A_p * sin^p(pi n / N), with A_p chosen so that sum_{r=0
stable_audio_tools/models/transforms.py:327
↓ 2 callersMethod_preprocess
Resample and pad/truncate to CLAP's expected 10s at 48kHz.
stable_audio_tools/training/losses/semantic.py:128
↓ 2 callersMethod_stft
(self, x: torch.Tensor)
stable_audio_tools/models/pretransforms.py:263
↓ 2 callersMethodanalysis
(self, x: Tensor)
stable_audio_tools/models/transforms.py:191
↓ 2 callersMethodapg_project
Project v0 into components parallel and orthogonal to v1. Args: v0: Tensor to project (B, C, T) v1: Referenc
stable_audio_tools/models/dit.py:311
↓ 2 callersFunctionappend_random_linear_chirps
Concatenate `n_chirps` random linear chirps to `batch` along dim=0. Accepts mono [B, N] or multichannel [B, C, N] input and returns the same
stable_audio_tools/training/autoencoders.py:89
↓ 2 callersFunctionapply_alias_cancellation
Applies alias cancellation by inverting the sign of every second element of every second row, starting from the second row's first elem
stable_audio_tools/models/pqmf.py:257
↓ 2 callersFunctionapply_rotary_pos_emb
(t, freqs, scale = 1)
stable_audio_tools/models/transformer.py:302
↓ 2 callersMethodbackward
(ctx, grad_output)
stable_audio_tools/training/clap.py:138
↓ 2 callersMethodbuild_pattern_sequence
Build sequence corresponding to the pattern from the input tensor z. The sequence is built using up to sequence_steps if specified, and non-pa
stable_audio_tools/models/codebook_patterns.py:151
↓ 2 callersFunctioncalc_update_to_weight_ratio
Compute update-to-weight ratio without concatenating all params into a single tensor. Accumulates squared norms on GPU to avoid the ~2 GB tempora
stable_audio_tools/training/autoencoders.py:60
↓ 2 callersMethodcalculate_disc_loss
(self, real_scores_list, fake_scores_list, score_masks=None, beta=1.0)
stable_audio_tools/training/arc.py:857
↓ 2 callersFunctioncalculate_frechet_distance
Adapted from: https://github.com/mseitzer/pytorch-fid/blob/master/src/pytorch_fid/fid_score.py Adapted from: https://github.com/gudgud96/frec
stable_audio_tools/training/metrics/fad_metrics.py:26
↓ 2 callersFunctioncast_base_to_precision
Cast frozen base weights to lower precision, keeping LoRA params in fp32. Args: model: Model with LoRA parametrizations applied.
stable_audio_tools/models/lora/utils.py:108
↓ 2 callersFunctioncheckpoint
(function, *args, **kwargs)
stable_audio_tools/models/convnext.py:12
↓ 2 callersFunctioncheckpoint
(function, *args, **kwargs)
stable_audio_tools/models/encodec.py:15
↓ 2 callersFunctionclamp
(value, min_value = None, max_value = None)
stable_audio_tools/training/ema.py:11
↓ 2 callersFunctionclap_load_state_dict
(clap_ckpt_path, clap_model)
stable_audio_tools/models/conditioners.py:252
↓ 2 callersFunctioncompute_effective_seq_len_from_conditioning
Compute effective sequence lengths from seconds_total in conditioning dicts. Args: conditioning: List of conditioning dicts, one per
stable_audio_tools/data/utils.py:215
↓ 2 callersMethodcompute_logits
Compute logits for a batch of codes, optionally conditioning on cross-attention and prepend conditioning Handles translation between
stable_audio_tools/models/lm.py:101
← previousnext →101–200 of 1,182, ranked by callers