docker pull neeze/devilwhisper:v1.1nvidia-docker run -itd neeze/devilwhisper:v1.1 /bin/bashcd /home/testDevilWhisper/kaldi/egs/mini_librispeech/s5/bin/nvidia-docker exec -it ... /bin/bash
hopsize: sample_rate * 0.01seg_size: sample_rate * 0.025
aspire.p
def tdnn(dnnInput, param_folder, n_frame=50):return final_relu_ppdef l0reformat(examples, ivectors):return h0def 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):"""main function for IBM-ASPIRE model:param l_sample_path: last sample path while using aspire with mini, or music path instead:param music_path: music path, use it to limit the wav modification:param noise_value: noise value in integer:param t_comm_pdf_path: target command pdf-id path:param platform: platform name, in ["IBM", "GOOGLE", "BING", "ALEXA"]:param gen_root_name: the root folder's name for current generation, Default is current timestamp string:param epoch: epoch number in string, Default is "0":param step_num: total step number for one epoch, Default is 100:param mod_thre: modify threshold, Default is 6500:param gen_only: only generate adversary samples, not print the nn output decoded by kaldi.:param kaldi_print_scr: whether let kaldi print on screen. Default is False.:param early_stop: whether early stop when the changes are very small, Default is True.:param stop_thre: the stop threthold. Default is -0.01.:return: last generated sample's path"""
model_utl.py
def read_param_s(file_path):"""read parameter from file with only single line:param file_p1ath: file path:return: param in list"""
def read_param_m(file_path):"""read parameter from file with multi lines:param file_path: file path:return: param in list"""
def wavwrite(audio_signal, cur_iter, s_folder, sample_rate, platform, model, epoch, a_type="WAA"):
def povel_window(signal, pad_len):""":param signal: wav signal:param pad_len: pad length, 256 for aspire, 512 for mini"""
def dct(M_m, progress_bar):
ef coe_lift(mfcc, seg_num, num_filt=40, lift_num=22, progress_bar=None):
def acoustic_model(signal, seg_num, mel_f_path, hop_size, seg_size, pad_len, progress_bar):
def adamOpt(x, grads, m, v, t, delta, original_wav, lr=100, beta1=0.9, beta2=0.99, epsilon=1e-08, m_threshold=6500):
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):
class GDFile(object):"""Generation Detail File"""
