mirror of https://github.com/drowe67/LPCNet.git
200413d subset OK but all_8k rough
parent
61056fe6b4
commit
643e0d71eb
|
|
@ -17,7 +17,7 @@ test1=all_speech_subset_8k
|
|||
test2=all_8k
|
||||
test3="birch canadian glue oak separately wanted wia peter"
|
||||
datestamp=$1
|
||||
epochs=5
|
||||
epochs=10
|
||||
log=${1}.txt
|
||||
train=${datestamp}_train
|
||||
|
||||
|
|
@ -66,19 +66,20 @@ experiment() {
|
|||
|
||||
(
|
||||
rm -f $log
|
||||
|
||||
|
||||
# assemble some training speech
|
||||
sox -r 8000 -c 1 ~/Downloads/${train1}.sw \
|
||||
-r 8000 -c 1 ~/Downloads/${train2}.sw \
|
||||
-t sw -r 8000 -c 1 ${train}.sw
|
||||
#cp ~/Downloads/${train1}.sw ${train}.sw
|
||||
|
||||
: '
|
||||
experiment "" "none" # no prediction
|
||||
|
||||
synth_40ms ${test1}
|
||||
synth_40ms ${test2}
|
||||
|
||||
experiment "--first" "first" # first order predictor
|
||||
'
|
||||
experiment "--lpc 10" "lpc" # standard LPC (albiet 10th order)
|
||||
|
||||
) |& tee $log
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ parser.add_argument('prefix', help='.h5 file prefix to easily identify each expe
|
|||
parser.add_argument('--frame_size', type=int, default=160, help='frames size in samples')
|
||||
parser.add_argument('--epochs', type=int, default=20, help='Number of training epochs')
|
||||
parser.add_argument('--no_pitch_embedding', action='store_true', help='disable pitch embedding')
|
||||
parser.add_argument('--load_h5', help='disable pitch embedding')
|
||||
args = parser.parse_args()
|
||||
|
||||
nb_epochs = args.epochs
|
||||
|
|
@ -72,6 +73,10 @@ model, _, _ = lpcnet.new_lpcnet_model(frame_size=args.frame_size, training=True)
|
|||
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['sparse_categorical_accuracy'])
|
||||
model.summary()
|
||||
|
||||
if args.load_h5:
|
||||
print("loading: %s" % (args.load_h5))
|
||||
model.load_weights(args.load_h5)
|
||||
|
||||
feature_file = args.feature_file
|
||||
pcm_file = args.packed_ulaw_file
|
||||
prefix = args.prefix
|
||||
|
|
@ -157,6 +162,5 @@ del in_exc
|
|||
checkpoint = ModelCheckpoint(prefix + '_{epoch:d}.h5')
|
||||
|
||||
# use this to reload a partially trained model
|
||||
#model.load_weights('lpcnet_190203_07.h5')
|
||||
model.compile(optimizer=Adam(0.001, amsgrad=True, decay=5e-5), loss='sparse_categorical_crossentropy')
|
||||
model.fit([in_data, features, periods], out_exc, batch_size=batch_size, epochs=nb_epochs, callbacks=[checkpoint, lpcnet.Sparsify(2000, 40000, 400, (0.05, 0.05, 0.2))])
|
||||
|
|
|
|||
Loading…
Reference in New Issue