pollen-robotics / dtw

DTW (Dynamic Time Warping) python module
GNU General Public License v3.0
1.16k stars 233 forks source link

generate train and test report issue. #40

Closed bradning closed 5 years ago

bradning commented 5 years ago

what does function find come from?

it reports error in speech-recognition when train and test data split. NameError: name 'find' is not defined

pierre-rouanet commented 5 years ago

See https://github.com/pierre-rouanet/dtw/issues/39.

Do not hesitate to submit a PR with a fix.

bradning commented 5 years ago

Thanks. I wrote a find function myself, could you check with it?

# the function will return a  list with all index of lables matched para 's'
def find( s ):
     match_result = []
     for i in range(len(labels)):
         if labels[i] == s:
             match_result.append(i)

     return match_result

after that, I made a replacement below. from all = find(labels == s) to my function all = find(s)

I can get recognition rate 75.0% and 66.7% in two seperate run.

pierre-rouanet commented 5 years ago

I've updated the example to use the speech commands TensorFlow dataset and remove the use of this find function.