class_docstr: This module calculates alignment prior matrices (based on beta-binomial distribution) using cached popular sizes and image interpolation.
  The implementation is taken from https://github.com/NVIDIA/DeepLearningExamples/blob/master/PyTorch/SpeechSynthesis/FastPitch/fastpitch/data_function.py
class_docstr_tok: ["This","module","calculates","alignment","prior","matrices","(","based","on","beta-binomial","distribution",")","using","cached","popular","sizes","and","image","interpolation",".","The","implementation","is","taken","from","https",":","\/\/github.com\/NVIDIA\/DeepLearningExamples\/blob\/master\/PyTorch\/SpeechSynthesis\/FastPitch\/fastpitch\/data_function.py"]
code: def __init__(
      self, round_mel_len_to=50, round_text_len_to=10, cache_size=500
  ):
      self.round_mel_len_to = round_mel_len_to
      self.round_text_len_to = round_text_len_to
      self.bank = functools.lru_cache(maxsize=cache_size)(
          beta_binomial_prior_distribution
      )
  
imports: import functools
  import os
  import random
  import traceback
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple
  import librosa
  import numpy
  import torch
  from einops import rearrange
  from scipy import ndimage
  from torch.special import gammaln
  from nemo.collections.asr.parts.preprocessing.segment import AudioSegment
label_desc: Use image node_id 1 to create a new BetaBinomialInterpolator object  with example: obj = BetaBinomialInterpolator(round_mel_len_to, round_text_len_to, cache_size)