1. docker pull neeze/devilwhisper:v1.1
    2. nvidia-docker run -itd neeze/devilwhisper:v1.1 /bin/bash
    3. cd /home/testDevilWhisper/kaldi/egs/mini_librispeech/s5/bin/
    4. nvidia-docker exec -it ... /bin/bash
    1. hopsize: sample_rate * 0.01
    2. seg_size: sample_rate * 0.025

    aspire.p

    1. def tdnn(dnnInput, param_folder, n_frame=50):
    2. return final_relu_pp
    3. def l0reformat(examples, ivectors):
    4. return h0
    5. def aspire(l_sample_path, music_path, noise_value, t_comm_pdf_path, platform, gen_root_name=str(int(time.time())), epoch="0", step_num=100, mod_thre=6500, gen_only=False, kaldi_print_scr=False, early_stop=True, stop_thre=-0.01):
    6. """
    7. main function for IBM-ASPIRE model
    8. :param l_sample_path: last sample path while using aspire with mini, or music path instead
    9. :param music_path: music path, use it to limit the wav modification
    10. :param noise_value: noise value in integer
    11. :param t_comm_pdf_path: target command pdf-id path
    12. :param platform: platform name, in ["IBM", "GOOGLE", "BING", "ALEXA"]
    13. :param gen_root_name: the root folder's name for current generation, Default is current timestamp string
    14. :param epoch: epoch number in string, Default is "0"
    15. :param step_num: total step number for one epoch, Default is 100
    16. :param mod_thre: modify threshold, Default is 6500
    17. :param gen_only: only generate adversary samples, not print the nn output decoded by kaldi.
    18. :param kaldi_print_scr: whether let kaldi print on screen. Default is False.
    19. :param early_stop: whether early stop when the changes are very small, Default is True.
    20. :param stop_thre: the stop threthold. Default is -0.01.
    21. :return: last generated sample's path
    22. """

    model_utl.py

    1. def read_param_s(file_path):
    2. """
    3. read parameter from file with only single line
    4. :param file_p1ath: file path
    5. :return: param in list
    6. """
    1. def read_param_m(file_path):
    2. """
    3. read parameter from file with multi lines
    4. :param file_path: file path
    5. :return: param in list
    6. """
    1. def wavwrite(audio_signal, cur_iter, s_folder, sample_rate, platform, model, epoch, a_type="WAA"):
    1. def povel_window(signal, pad_len):
    2. """
    3. :param signal: wav signal
    4. :param pad_len: pad length, 256 for aspire, 512 for mini
    5. """
    1. def dct(M_m, progress_bar):
    1. ef coe_lift(mfcc, seg_num, num_filt=40, lift_num=22, progress_bar=None):
    1. def acoustic_model(signal, seg_num, mel_f_path, hop_size, seg_size, pad_len, progress_bar):
    1. def adamOpt(x, grads, m, v, t, delta, original_wav, lr=100, beta1=0.9, beta2=0.99, epsilon=1e-08, m_threshold=6500):
    1. def fgm(x, preds, m_adam, v_adam, t_adam, delta_adam, pdf_path, original_wav, clip_min=-32767, clip_max=32767, m_thre=6500, progress_bar=None):
    1. class GDFile(object):
    2. """Generation Detail File"""