CSTR-Edinburgh / merlin

This is now the official location of the Merlin project.
http://www.cstr.ed.ac.uk/projects/merlin/
Apache License 2.0
1.31k stars 440 forks source link

output dimension order is random, and lead to wrong synthesis #386

Open cloudchenl opened 6 years ago

cloudchenl commented 6 years ago

in composition stage:

for stream_name in list(out_dimension_dict.keys()): if stream_name not in stream_start_index: stream_start_index[stream_name] = stream_dim_index

list(out_dimension_dict.keys()) results in random order, maybe [bap, lf0, vuv, mgc] or [lf0, bap, vuv, mgc]... and cmp features will store as the random order

and in decomposition stage, stream_start_index is assigned another random order, so decomposed lf0, bap, mgc is wrong.

should the code write as: for stream_name in sorted(out_dimension_dict): if stream_name not in stream_start_index: stream_start_index[stream_name] = stream_dim_index

ZackHodari commented 5 years ago

While the ordering in Python 2 and 3 is different, both guarantee a consistent (possibly arbitrary) ordering. Python 2: https://docs.python.org/2/library/stdtypes.html#dict.keys and https://docs.python.org/2/library/stdtypes.html#dict.items Python 3: https://docs.python.org/3/library/stdtypes.html#dict-views

Please re-open this issue if in practice the order does actually vary.

RasmusD commented 5 years ago

I've found the order to vary in practice.

It theoretically SHOULD work fine and it does most of the time. But it's ever so slightly unreliable so it might be worthwhile fixing so the order follows a more consistent scheme. E.g. defined in config or based on alphabetical sorting.

On Thu, 14 Mar 2019, 14:23 ZackHodari, notifications@github.com wrote:

In practice does the order actually vary?

While the ordering in Python 2 and 3 is different, both guarantee a consistent (possibly arbitrary) ordering Python 2: https://docs.python.org/2/library/stdtypes.html#dict.keys and https://docs.python.org/2/library/stdtypes.html#dict.items Python 3: https://docs.python.org/3/library/stdtypes.html#dict-views

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CSTR-Edinburgh/merlin/issues/386#issuecomment-472881210, or mute the thread https://github.com/notifications/unsubscribe-auth/AEyDp0SxF9r4mwgqfAiGxkgwgX0cl96Lks5vWltOgaJpZM4VtjU- .