Skip to content
Snippets Groups Projects
Commit 2facc08b authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Avoid rounding the prediction multiple times

parent 3e712482
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,7 @@ features = np.reshape(features, (nb_frames*feature_chunk_size, nb_features))
# Note: the LPC predictor output is now calculated by the loop below, this code was
# for an ealier version that implemented the prediction filter in C
upred = np.zeros((nb_frames*pcm_chunk_size,), dtype='int16')
upred = np.zeros((nb_frames*pcm_chunk_size,), dtype='float32')
# Use 16th order LPC to generate LPC prediction output upred[] and (in
# mu-law form) pred[]
......@@ -136,8 +136,8 @@ periods = (50*features[:,:,36:37]+100).astype('int16')
in_data = np.concatenate([in_data, pred], axis=-1)
# dump models to disk as we go
checkpoint = ModelCheckpoint('lpcnet9c_384_10_G16_{epoch:02d}.h5')
checkpoint = ModelCheckpoint('lpcnet14_384_10_G16_{epoch:02d}.h5')
#model.load_weights('wavenet4f2_30.h5')
#model.load_weights('lpcnet9b_384_10_G16_01.h5')
model.compile(optimizer=Adam(0.001, amsgrad=True, decay=5e-5), loss='sparse_categorical_crossentropy', metrics=['sparse_categorical_accuracy'])
model.fit([in_data, in_exc, features, periods], out_data, batch_size=batch_size, epochs=nb_epochs, validation_split=0.0, callbacks=[checkpoint, lpcnet.Sparsify(2000, 40000, 400, 0.1)])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment