class_docstr: FastPitch model (https://arxiv.org/abs/2006.06873) that is used to generate mel spectrogram from text.
class_docstr_tok: ["FastPitch","model","(","https",":","\/\/arxiv.org\/abs\/2006.06873",")","that","is","used","to","generate","mel","spectrogram","from","text","."]
docstr: This method performs speaker interpolation between two original speakers the model is trained on.
  
  Inputs:
      original_speaker_1: Integer speaker ID of first existing speaker in the model
      original_speaker_2: Integer speaker ID of second existing speaker in the model
      weight_speaker_1: Floating point weight associated in to first speaker during weight combination
      weight_speaker_2: Floating point weight associated in to second speaker during weight combination
      new_speaker_id: Integer speaker ID of new interpolated speaker in the model
docstr_tok: ["This","method","performs","speaker","interpolation","between","two","original","speakers","the","model","is","trained","on",".","Inputs",":","original_speaker_1",":","Integer","speaker","ID","of","first","existing","speaker","in","the","model","original_speaker_2",":","Integer","speaker","ID","of","second","existing","speaker","in","the","model","weight_speaker_1",":","Floating","point","weight","associated","in","to","first","speaker","during","weight","combination","weight_speaker_2",":","Floating","point","weight","associated","in","to","second","speaker","during","weight","combination","new_speaker_id",":","Integer","speaker","ID","of","new","interpolated","speaker","in","the","model"]
code: def interpolate_speaker(
      self,
      original_speaker_1,
      original_speaker_2,
      weight_speaker_1,
      weight_speaker_2,
      new_speaker_id,
  ):
      """
      This method performs speaker interpolation between two original speakers the model is trained on.
  
      Inputs:
          original_speaker_1: Integer speaker ID of first existing speaker in the model
          original_speaker_2: Integer speaker ID of second existing speaker in the model
          weight_speaker_1: Floating point weight associated in to first speaker during weight combination
          weight_speaker_2: Floating point weight associated in to second speaker during weight combination
          new_speaker_id: Integer speaker ID of new interpolated speaker in the model
      """
      if self.fastpitch.speaker_emb is None:
          raise Exception(
              "Current FastPitch model is not a multi-speaker FastPitch model. Speaker interpolation can only \
                  be performed with a multi-speaker model"
          )
      n_speakers = self.fastpitch.speaker_emb.weight.data.size()[0]
      if (
          original_speaker_1 >= n_speakers
          or original_speaker_2 >= n_speakers
          or new_speaker_id >= n_speakers
      ):
          raise Exception(
              f"Parameters original_speaker_1, original_speaker_2, new_speaker_id should be less than the total \
                  total number of speakers FastPitch was trained on (n_speakers = {n_speakers})."
          )
      speaker_emb_1 = (
          self.fastpitch.speaker_emb(
              torch.tensor(original_speaker_1, dtype=torch.int32).cuda()
          )
          .clone()
          .detach()
      )
      speaker_emb_2 = (
          self.fastpitch.speaker_emb(
              torch.tensor(original_speaker_2, dtype=torch.int32).cuda()
          )
          .clone()
          .detach()
      )
      new_speaker_emb = (
          weight_speaker_1 * speaker_emb_1
          + weight_speaker_2 * speaker_emb_2
      )
      self.fastpitch.speaker_emb.weight.data[
          new_speaker_id
      ] = new_speaker_emb
  
imports: import contextlib
  from dataclasses import dataclass, field
  from pathlib import Path
  from typing import List, Optional
  import torch
  from hydra.utils import instantiate
  from omegaconf import DictConfig, OmegaConf, open_dict
  from pytorch_lightning import Trainer
  from pytorch_lightning.loggers import TensorBoardLogger
  from nemo.collections.common.parts.preprocessing import parsers
  from nemo.collections.tts.losses.aligner_loss import BinLoss, ForwardSumLoss
  from nemo.collections.tts.losses.fastpitchloss import DurationLoss, EnergyLoss, MelLoss, PitchLoss
  from nemo.collections.tts.models.base import SpectrogramGenerator
  from nemo.collections.tts.modules.fastpitch import FastPitchModule
  from nemo.collections.tts.parts.mixins import FastPitchAdapterModelMixin
  from nemo.collections.tts.parts.utils.callbacks import LoggingCallback
  from nemo.collections.tts.parts.utils.helpers import batch_from_ragged, g2p_backward_compatible_support, plot_alignment_to_numpy, plot_spectrogram_to_numpy, process_batch, sample_tts_input
  from nemo.core.classes import Exportable
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types.elements import Index, LengthsType, MelSpectrogramType, ProbsType, RegressionValuesType, TokenDurationType, TokenIndex, TokenLogDurationType
  from nemo.core.neural_types.neural_type import NeuralType
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 28 for calling the FastPitchModel obj's underlying member method code with example usage: obj.interpolate_speaker(original_speaker_1, original_speaker_2, weight_speaker_1, weight_speaker_2, new_speaker_id) without return types