SYMBOL INDEX (299 symbols across 18 files) FILE: commons.py function init_weights (line 8) | def init_weights(m, mean=0.0, std=0.01): function get_padding (line 14) | def get_padding(kernel_size, dilation=1): function convert_pad_shape (line 18) | def convert_pad_shape(pad_shape): function intersperse (line 24) | def intersperse(lst, item): function kl_divergence (line 30) | def kl_divergence(m_p, logs_p, m_q, logs_q): function rand_gumbel (line 37) | def rand_gumbel(shape): function rand_gumbel_like (line 43) | def rand_gumbel_like(x): function slice_segments (line 48) | def slice_segments(x, ids_str, segment_size=4): function rand_slice_segments (line 57) | def rand_slice_segments(x, x_lengths=None, segment_size=4): function rand_spec_segments (line 67) | def rand_spec_segments(x, x_lengths=None, segment_size=4): function get_timing_signal_1d (line 77) | def get_timing_signal_1d( function add_timing_signal_1d (line 93) | def add_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4): function cat_timing_signal_1d (line 99) | def cat_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4, axis... function subsequent_mask (line 105) | def subsequent_mask(length): function fused_add_tanh_sigmoid_multiply (line 111) | def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels): function convert_pad_shape (line 120) | def convert_pad_shape(pad_shape): function shift_1d (line 126) | def shift_1d(x): function sequence_mask (line 131) | def sequence_mask(length, max_length=None): function generate_path (line 138) | def generate_path(duration, mask): function clip_grad_value_ (line 156) | def clip_grad_value_(parameters, clip_value, norm_type=2): FILE: data_utils_engppg.py class TextAudioSpeakerLoader (line 15) | class TextAudioSpeakerLoader(torch.utils.data.Dataset): method __init__ (line 21) | def __init__(self, audiopaths, hparams): method _filter (line 37) | def _filter(self): method get_audio (line 50) | def get_audio(self, filename): method __getitem__ (line 128) | def __getitem__(self, index): method __len__ (line 131) | def __len__(self): class TextAudioSpeakerCollate (line 135) | class TextAudioSpeakerCollate(): method __init__ (line 138) | def __init__(self, hps): method __call__ (line 143) | def __call__(self, batch): class DistributedBucketSampler (line 205) | class DistributedBucketSampler(torch.utils.data.distributed.DistributedS... method __init__ (line 214) | def __init__(self, dataset, batch_size, boundaries, num_replicas=None,... method _create_buckets (line 225) | def _create_buckets(self): method __iter__ (line 246) | def __iter__(self): method _bisect (line 286) | def _bisect(self, x, lo=0, hi=None): method __len__ (line 301) | def __len__(self): FILE: data_utils_whisper.py class TextAudioSpeakerLoader (line 15) | class TextAudioSpeakerLoader(torch.utils.data.Dataset): method __init__ (line 21) | def __init__(self, audiopaths, hparams): method _filter (line 37) | def _filter(self): method get_audio (line 50) | def get_audio(self, filename): method __getitem__ (line 126) | def __getitem__(self, index): method __len__ (line 129) | def __len__(self): class TextAudioSpeakerCollate (line 133) | class TextAudioSpeakerCollate(): method __init__ (line 136) | def __init__(self, hps): method __call__ (line 141) | def __call__(self, batch): class DistributedBucketSampler (line 203) | class DistributedBucketSampler(torch.utils.data.distributed.DistributedS... method __init__ (line 212) | def __init__(self, dataset, batch_size, boundaries, num_replicas=None,... method _create_buckets (line 223) | def _create_buckets(self): method __iter__ (line 244) | def __iter__(self): method _bisect (line 284) | def _bisect(self, x, lo=0, hi=None): method __len__ (line 299) | def __len__(self): FILE: losses.py function feature_loss (line 7) | def feature_loss(fmap_r, fmap_g): function discriminator_loss (line 18) | def discriminator_loss(disc_real_outputs, disc_generated_outputs): function generator_loss (line 34) | def generator_loss(disc_outputs): function kl_loss (line 46) | def kl_loss(z_p, logs_q, m_p, logs_p, z_mask): FILE: mel_processing.py function dynamic_range_compression_torch (line 19) | def dynamic_range_compression_torch(x, C=1, clip_val=1e-5): function dynamic_range_decompression_torch (line 28) | def dynamic_range_decompression_torch(x, C=1): function spectral_normalize_torch (line 37) | def spectral_normalize_torch(magnitudes): function spectral_de_normalize_torch (line 42) | def spectral_de_normalize_torch(magnitudes): function spectrogram_torch (line 51) | def spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, cente... function spec_to_mel_torch (line 73) | def spec_to_mel_torch(spec, n_fft, num_mels, sampling_rate, fmin, fmax): function mel_spectrogram_torch (line 85) | def mel_spectrogram_torch(y, n_fft, num_mels, sampling_rate, hop_size, w... FILE: models.py class ResidualCouplingBlock (line 15) | class ResidualCouplingBlock(nn.Module): method __init__ (line 16) | def __init__(self, method forward (line 38) | def forward(self, x, x_mask, g=None, reverse=False): class Encoder (line 48) | class Encoder(nn.Module): method __init__ (line 49) | def __init__(self, method forward (line 70) | def forward(self, x, x_lengths, g=None): class Generator (line 80) | class Generator(torch.nn.Module): method __init__ (line 81) | def __init__(self, initial_channel, resblock, resblock_kernel_sizes, r... method forward (line 106) | def forward(self, x, g=None): method remove_weight_norm (line 127) | def remove_weight_norm(self): class DiscriminatorP (line 135) | class DiscriminatorP(torch.nn.Module): method __init__ (line 136) | def __init__(self, period, kernel_size=5, stride=3, use_spectral_norm=... method forward (line 150) | def forward(self, x): class DiscriminatorS (line 172) | class DiscriminatorS(torch.nn.Module): method __init__ (line 173) | def __init__(self, use_spectral_norm=False): method forward (line 186) | def forward(self, x): class MultiPeriodDiscriminator (line 200) | class MultiPeriodDiscriminator(torch.nn.Module): method __init__ (line 201) | def __init__(self, use_spectral_norm=False): method forward (line 209) | def forward(self, y, y_hat): class SpeakerEncoder (line 225) | class SpeakerEncoder(torch.nn.Module): method __init__ (line 226) | def __init__(self, mel_n_channels=80, model_num_layers=3, model_hidden... method forward (line 232) | def forward(self, mels): method compute_partial_slices (line 238) | def compute_partial_slices(self, total_frames, partial_frames, partial... method embed_utterance (line 246) | def embed_utterance(self, mel, partial_frames=128, partial_hop=64): class SynthesizerTrn (line 267) | class SynthesizerTrn(nn.Module): method __init__ (line 272) | def __init__(self, method forward (line 321) | def forward(self, c, spec, g=None, mel=None, c_lengths=None, spec_leng... method infer (line 344) | def infer(self, c, g=None, mel=None, c_lengths=None): FILE: modules.py class LayerNorm (line 19) | class LayerNorm(nn.Module): method __init__ (line 20) | def __init__(self, channels, eps=1e-5): method forward (line 28) | def forward(self, x): class ConvReluNorm (line 34) | class ConvReluNorm(nn.Module): method __init__ (line 35) | def __init__(self, in_channels, hidden_channels, out_channels, kernel_... method forward (line 59) | def forward(self, x, x_mask): class DDSConv (line 69) | class DDSConv(nn.Module): method __init__ (line 73) | def __init__(self, channels, kernel_size, n_layers, p_dropout=0.): method forward (line 95) | def forward(self, x, x_mask, g=None): class WN (line 110) | class WN(torch.nn.Module): method __init__ (line 111) | def __init__(self, hidden_channels, kernel_size, dilation_rate, n_laye... method forward (line 147) | def forward(self, x, x_mask, g=None, **kwargs): method remove_weight_norm (line 177) | def remove_weight_norm(self): class ResBlock1 (line 186) | class ResBlock1(torch.nn.Module): method __init__ (line 187) | def __init__(self, channels, kernel_size=3, dilation=(1, 3, 5)): method forward (line 209) | def forward(self, x, x_mask=None): method remove_weight_norm (line 224) | def remove_weight_norm(self): class ResBlock2 (line 231) | class ResBlock2(torch.nn.Module): method __init__ (line 232) | def __init__(self, channels, kernel_size=3, dilation=(1, 3)): method forward (line 242) | def forward(self, x, x_mask=None): method remove_weight_norm (line 253) | def remove_weight_norm(self): class Log (line 258) | class Log(nn.Module): method forward (line 259) | def forward(self, x, x_mask, reverse=False, **kwargs): class Flip (line 269) | class Flip(nn.Module): method forward (line 270) | def forward(self, x, *args, reverse=False, **kwargs): class ElementwiseAffine (line 279) | class ElementwiseAffine(nn.Module): method __init__ (line 280) | def __init__(self, channels): method forward (line 286) | def forward(self, x, x_mask, reverse=False, **kwargs): class ResidualCouplingLayer (line 297) | class ResidualCouplingLayer(nn.Module): method __init__ (line 298) | def __init__(self, method forward (line 323) | def forward(self, x, x_mask, g=None, reverse=False): FILE: preprocess_ppg.py function load_model (line 11) | def load_model(path) -> Whisper: function pred_ppg (line 20) | def pred_ppg(whisper: Whisper, wavPath, ppgPath): FILE: train_eng_ppg_emo_loss.py function main (line 138) | def main(): function run (line 151) | def run(rank, n_gpus, hps): function train_and_evaluate (line 221) | def train_and_evaluate(rank, epoch, hps, nets, optims, schedulers, scale... function evaluate (line 355) | def evaluate(hps, generator, eval_loader, writer_eval): FILE: train_whisper_emo.py function main (line 41) | def main(): function run (line 54) | def run(rank, n_gpus, hps): function train_and_evaluate (line 124) | def train_and_evaluate(rank, epoch, hps, nets, optims, schedulers, scale... function evaluate (line 258) | def evaluate(hps, generator, eval_loader, writer_eval): FILE: utils.py function get_content (line 25) | def get_content(cmodel, y): function transform (line 35) | def transform(mel, height): # 68-92 function stretch (line 48) | def stretch(mel, width): # 0.5-2 function load_checkpoint (line 52) | def load_checkpoint(checkpoint_path, model, optimizer=None, strict=False): function save_checkpoint (line 82) | def save_checkpoint(model, optimizer, learning_rate, iteration, checkpoi... function summarize (line 95) | def summarize(writer, global_step, scalars={}, histograms={}, images={},... function latest_checkpoint_path (line 106) | def latest_checkpoint_path(dir_path, regex="G_*.pth"): function plot_spectrogram_to_numpy (line 114) | def plot_spectrogram_to_numpy(spectrogram): function plot_alignment_to_numpy (line 140) | def plot_alignment_to_numpy(alignment, info=None): function load_wav_to_torch (line 169) | def load_wav_to_torch(full_path): function load_filepaths_and_text (line 174) | def load_filepaths_and_text(filename, split="|"): function get_hparams (line 180) | def get_hparams(init=True): function get_hparams_from_dir (line 210) | def get_hparams_from_dir(model_dir): function get_hparams_from_file (line 221) | def get_hparams_from_file(config_path): function check_git_hash (line 230) | def check_git_hash(model_dir): function get_logger (line 250) | def get_logger(model_dir, filename="train.log"): class HParams (line 265) | class HParams(): method __init__ (line 266) | def __init__(self, **kwargs): method keys (line 272) | def keys(self): method items (line 275) | def items(self): method values (line 278) | def values(self): method __len__ (line 281) | def __len__(self): method __getitem__ (line 284) | def __getitem__(self, key): method __setitem__ (line 287) | def __setitem__(self, key, value): method __contains__ (line 290) | def __contains__(self, key): method __repr__ (line 293) | def __repr__(self): FILE: whisper/audio.py function load_audio (line 22) | def load_audio(file: str, sr: int = SAMPLE_RATE): function pad_or_trim (line 52) | def pad_or_trim(array, length: int = N_SAMPLES, *, axis: int = -1): function mel_filters (line 77) | def mel_filters(device, n_mels: int = N_MELS) -> torch.Tensor: function log_mel_spectrogram (line 92) | def log_mel_spectrogram(audio: Union[str, np.ndarray, torch.Tensor], n_m... FILE: whisper/decoding.py function detect_language (line 19) | def detect_language(model: "Whisper", mel: Tensor, tokenizer: Tokenizer ... class DecodingOptions (line 72) | class DecodingOptions: class DecodingResult (line 104) | class DecodingResult: class Inference (line 116) | class Inference: method logits (line 117) | def logits(self, tokens: Tensor, audio_features: Tensor) -> Tensor: method rearrange_kv_cache (line 121) | def rearrange_kv_cache(self, source_indices) -> None: method cleanup_caching (line 125) | def cleanup_caching(self) -> None: class PyTorchInference (line 130) | class PyTorchInference(Inference): method __init__ (line 131) | def __init__(self, model: "Whisper", initial_token_length: int): method logits (line 137) | def logits(self, tokens: Tensor, audio_features: Tensor) -> Tensor: method cleanup_caching (line 147) | def cleanup_caching(self): method rearrange_kv_cache (line 154) | def rearrange_kv_cache(self, source_indices): class SequenceRanker (line 160) | class SequenceRanker: method rank (line 161) | def rank(self, tokens: List[List[Tensor]], sum_logprobs: List[List[flo... class MaximumLikelihoodRanker (line 169) | class MaximumLikelihoodRanker(SequenceRanker): method __init__ (line 175) | def __init__(self, length_penalty: Optional[float]): method rank (line 178) | def rank(self, tokens: List[List[Tensor]], sum_logprobs: List[List[flo... class TokenDecoder (line 195) | class TokenDecoder: method reset (line 196) | def reset(self): method update (line 199) | def update(self, tokens: Tensor, logits: Tensor, sum_logprobs: Tensor)... method finalize (line 224) | def finalize( class GreedyDecoder (line 249) | class GreedyDecoder(TokenDecoder): method __init__ (line 250) | def __init__(self, temperature: float, eot: int): method update (line 254) | def update(self, tokens: Tensor, logits: Tensor, sum_logprobs: Tensor)... method finalize (line 271) | def finalize(self, tokens: Tensor, sum_logprobs: Tensor): class BeamSearchDecoder (line 277) | class BeamSearchDecoder(TokenDecoder): method __init__ (line 278) | def __init__(self, beam_size: int, eot: int, inference: Inference, pat... method reset (line 288) | def reset(self): method update (line 291) | def update(self, tokens: Tensor, logits: Tensor, sum_logprobs: Tensor)... method finalize (line 347) | def finalize(self, preceding_tokens: Tensor, sum_logprobs: Tensor): class LogitFilter (line 367) | class LogitFilter: method apply (line 368) | def apply(self, logits: Tensor, tokens: Tensor) -> None: class SuppressBlank (line 383) | class SuppressBlank(LogitFilter): method __init__ (line 384) | def __init__(self, tokenizer: Tokenizer, sample_begin: int): method apply (line 388) | def apply(self, logits: Tensor, tokens: Tensor): class SuppressTokens (line 393) | class SuppressTokens(LogitFilter): method __init__ (line 394) | def __init__(self, suppress_tokens: Sequence[int]): method apply (line 397) | def apply(self, logits: Tensor, tokens: Tensor): class ApplyTimestampRules (line 401) | class ApplyTimestampRules(LogitFilter): method __init__ (line 402) | def __init__( method apply (line 409) | def apply(self, logits: Tensor, tokens: Tensor): class DecodingTask (line 444) | class DecodingTask: method __init__ (line 450) | def __init__(self, model: "Whisper", options: DecodingOptions): method _verify_options (line 499) | def _verify_options(self, options: DecodingOptions) -> DecodingOptions: method _get_initial_tokens (line 512) | def _get_initial_tokens(self) -> Tuple[int]: method _get_suppress_tokens (line 534) | def _get_suppress_tokens(self) -> Tuple[int]: method _get_audio_features (line 557) | def _get_audio_features(self, mel: Tensor): method _detect_language (line 575) | def _detect_language(self, audio_features: Tensor, tokens: Tensor): method _main_loop (line 587) | def _main_loop(self, audio_features: Tensor, tokens: Tensor): method run (line 619) | def run(self, mel: Tensor) -> List[DecodingResult]: function decode (line 684) | def decode(model: "Whisper", mel: Tensor, options: DecodingOptions = Dec... FILE: whisper/model.py class ModelDimensions (line 15) | class ModelDimensions: class LayerNorm (line 28) | class LayerNorm(nn.LayerNorm): method forward (line 29) | def forward(self, x: Tensor) -> Tensor: class Linear (line 33) | class Linear(nn.Linear): method forward (line 34) | def forward(self, x: Tensor) -> Tensor: class Conv1d (line 40) | class Conv1d(nn.Conv1d): method _conv_forward (line 41) | def _conv_forward(self, x: Tensor, weight: Tensor, bias: Optional[Tens... function sinusoids (line 47) | def sinusoids(length, channels, max_timescale=10000): class MultiHeadAttention (line 56) | class MultiHeadAttention(nn.Module): method __init__ (line 57) | def __init__(self, n_state: int, n_head: int): method forward (line 65) | def forward( method qkv_attention (line 87) | def qkv_attention(self, q: Tensor, k: Tensor, v: Tensor, mask: Optiona... class ResidualAttentionBlock (line 103) | class ResidualAttentionBlock(nn.Module): method __init__ (line 104) | def __init__(self, n_state: int, n_head: int, cross_attention: bool = ... method forward (line 117) | def forward( class AudioEncoder (line 131) | class AudioEncoder(nn.Module): method __init__ (line 132) | def __init__(self, n_mels: int, n_ctx: int, n_state: int, n_head: int,... method forward (line 143) | def forward(self, x: Tensor): class TextDecoder (line 165) | class TextDecoder(nn.Module): method __init__ (line 166) | def __init__(self, n_vocab: int, n_ctx: int, n_state: int, n_head: int... method forward (line 180) | def forward(self, x: Tensor, xa: Tensor, kv_cache: Optional[dict] = No... class Whisper (line 200) | class Whisper(nn.Module): method __init__ (line 201) | def __init__(self, dims: ModelDimensions): method embed_audio (line 219) | def embed_audio(self, mel: torch.Tensor): method logits (line 222) | def logits(self, tokens: torch.Tensor, audio_features: torch.Tensor): method forward (line 225) | def forward(self, mel: torch.Tensor, tokens: torch.Tensor) -> Dict[str... method device (line 229) | def device(self): method is_multilingual (line 233) | def is_multilingual(self): method install_kv_cache_hooks (line 236) | def install_kv_cache_hooks(self, cache: Optional[dict] = None): FILE: whisper/normalizers/basic.py function remove_symbols_and_diacritics (line 27) | def remove_symbols_and_diacritics(s: str, keep=""): function remove_symbols (line 46) | def remove_symbols(s: str): class BasicTextNormalizer (line 55) | class BasicTextNormalizer: method __init__ (line 56) | def __init__(self, remove_diacritics: bool = False, split_letters: boo... method __call__ (line 60) | def __call__(self, s: str): FILE: whisper/normalizers/english.py class EnglishNumberNormalizer (line 12) | class EnglishNumberNormalizer: method __init__ (line 23) | def __init__(self): method process_words (line 160) | def process_words(self, words: List[str]) -> Iterator[str]: method preprocess (line 381) | def preprocess(self, s: str): method postprocess (line 410) | def postprocess(self, s: str): method __call__ (line 435) | def __call__(self, s: str): class EnglishSpellingNormalizer (line 443) | class EnglishSpellingNormalizer: method __init__ (line 450) | def __init__(self): method __call__ (line 454) | def __call__(self, s: str): class EnglishTextNormalizer (line 458) | class EnglishTextNormalizer: method __init__ (line 459) | def __init__(self): method __call__ (line 519) | def __call__(self, s: str): FILE: whisper/tokenizer.py class Tokenizer (line 130) | class Tokenizer: method encode (line 137) | def encode(self, text, **kwargs): method decode (line 140) | def decode(self, token_ids: Union[int, List[int], np.ndarray, torch.Te... method decode_with_timestamps (line 143) | def decode_with_timestamps(self, tokens) -> str: method eot (line 161) | def eot(self) -> int: method sot (line 166) | def sot(self) -> int: method sot_lm (line 171) | def sot_lm(self) -> int: method sot_prev (line 176) | def sot_prev(self) -> int: method no_speech (line 181) | def no_speech(self) -> int: method no_timestamps (line 186) | def no_timestamps(self) -> int: method timestamp_begin (line 191) | def timestamp_begin(self) -> int: method language_token (line 196) | def language_token(self) -> int: method all_language_tokens (line 215) | def all_language_tokens(self) -> Tuple[int]: method all_language_codes (line 227) | def all_language_codes(self) -> Tuple[str]: method sot_sequence_including_notimestamps (line 232) | def sot_sequence_including_notimestamps(self) -> Tuple[int]: method non_speech_tokens (line 237) | def non_speech_tokens(self) -> Tuple[int]: method _get_single_token_id (line 267) | def _get_single_token_id(self, text) -> int: function build_tokenizer (line 274) | def build_tokenizer(name: str = "gpt2"): function get_tokenizer (line 295) | def get_tokenizer( FILE: whisper/utils.py function make_safe (line 10) | def make_safe(string): function make_safe (line 15) | def make_safe(string): function exact_div (line 20) | def exact_div(x, y): function str2bool (line 25) | def str2bool(string): function optional_int (line 33) | def optional_int(string): function optional_float (line 37) | def optional_float(string): function compression_ratio (line 41) | def compression_ratio(text) -> float: function format_timestamp (line 46) | def format_timestamp(seconds: float, always_include_hours: bool = False,... class ResultWriter (line 63) | class ResultWriter: method __init__ (line 66) | def __init__(self, output_dir: str): method __call__ (line 69) | def __call__(self, result: dict, audio_path: str): method write_result (line 76) | def write_result(self, result: dict, file: TextIO): class WriteTXT (line 80) | class WriteTXT(ResultWriter): method write_result (line 83) | def write_result(self, result: dict, file: TextIO): class WriteVTT (line 88) | class WriteVTT(ResultWriter): method write_result (line 91) | def write_result(self, result: dict, file: TextIO): class WriteSRT (line 102) | class WriteSRT(ResultWriter): method write_result (line 105) | def write_result(self, result: dict, file: TextIO): class WriteTSV (line 118) | class WriteTSV(ResultWriter): method write_result (line 129) | def write_result(self, result: dict, file: TextIO): class WriteJSON (line 137) | class WriteJSON(ResultWriter): method write_result (line 140) | def write_result(self, result: dict, file: TextIO): function get_writer (line 144) | def get_writer(output_format: str, output_dir: str) -> Callable[[dict, T...