Walleclipse / Deep_Speaker-speaker_recognition_system

Keras implementation of ‘’Deep Speaker: an End-to-End Neural Speaker Embedding System‘’ (speaker recognition)
247 stars 81 forks source link

关于model.train_on_batch #16

Closed MichelleYang2017 closed 5 years ago

MichelleYang2017 commented 5 years ago

版主您好,看了您的代码很受用.我有几个问题想向您请教,还望您的解答: 1.关于train.py中,选择最优batch之后,   x, _ = select_batch.best_batch(model, batch_size=c.BATCH_SIZE) print("select_batch_time:", time() - orig_time) y = np.random.uniform(size=(x.shape[0], 1)) logging.info('== Presenting step #{0}'.format(grad_steps)) orig_time = time() loss = model.train_on_batch(x, y) 您在训练的时候为什么y是随机生成的,按理说,不应该该是label吗? 2.我想我想用softmax预训练的时候,我是不是只要把PRE_TRAIN改成True即可对吧. 谢谢

Walleclipse commented 5 years ago

你好,

  1. 对于 speaker embedding 或者 speaker recognition而言,是通过 triplet-loss 训练的。 triplet-loss只需要找出anchor,positive,negative sample,不需要label。详情请查看 Deep Speaker论文的 3.3 部分 和 triplet loss

  2. 如果想预训练,运行 pretraining.py 就行了。随后设置 PRE_TRAIN =True 运行 train.py 。网络会从预训练过的模型里面加载(去掉最后一层),并且用 triplet loss 训练

MichelleYang2017 commented 5 years ago

感谢