How to take HTK format datas as features and labels to train the networks?
I have knew the way to do this in brainscripts, but how to do this in python?The python API only recommends me the function 'HTKFeatureDeserializer(streams)'.I want know more about it.Is there a code for that?
You can combine several HTKFeatureDeserializers in the same minibatch source, i.e. if you have both features and labels in htk format, just create a minibatch source like this: fd = HTKFeatureDeserializer(StreamDefs( features = StreamDef(shape=feature_dim, context=(context,context), scp=features_file))) ld = HTKFeatureDeserializer(StreamDefs( labels = StreamDef(shape=label_dim, scp=labels_file)))
mbSource = MinibatchSource([fd,ld], max_samples=total_number_of_samples)
Then next_minibatch will give you the data for features and labels. There are plenty of samples how to use deserializers in the tutorials, HTK one is not different.
I.e. you can have a look at https://github.com/Microsoft/CNTK/blob/master/Examples/Speech/AN4/Python/HTK_LSTM_Truncated_Distributed.py
Thank you for your answer! It comes to a problem : every feature frame correspond to label frame between two htk files, seting feature's context (3,3) so when calling next_minibatch() firstly, we'll get first features(7 frames) and labels(1 frame), the problem is that I want the features(first 7 frames) correspond to labels(4th frames not the first frames), is there a way to do that?
so you need the forth or the first four? can you get the first four (context (3, 0)) and drop the first three already inside the network, no?
you can give a context to the second deserializer in a similar manner as to the first one.
I just need the fourth!
Maybe I've got it! Thank you very much!