Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend feature extraction module to allow for RASR compatible logmel features #40

Merged
merged 10 commits into from
Dec 7, 2023

Conversation

kuacakuaca
Copy link
Collaborator

No description provided.

@albertz
Copy link
Member

albertz commented Nov 15, 2023

I'm curious, did you actually test this, that you really get identical results to RASR (up to numerical errors)

@kuacakuaca
Copy link
Collaborator Author

I'm curious, did you actually test this, that you really get identical results to RASR (up to numerical errors)

there were still small differences. Not sure if that could be further eliminated.

3.922669 4.240274 4.526385 5.040951 4.915504 4.856473 5.144744 <- rasr
3.9254   4.2424   4.5246   5.0411   4.9170   4.8564   5.1468   <- torch module

@albertz
Copy link
Member

albertz commented Nov 15, 2023

Oh, but that looks very good. Can you maybe link the relevant RASR code for comparison?

@kuacakuaca
Copy link
Collaborator Author

Oh, but that looks very good. Can you maybe link the relevant RASR code for comparison?

sure.
https://github.com/rwth-i6/rasr/blob/a3117a2fe4599ea7a371eeefc3d60ba85d17291f/src/Signal/FastFourierTransform.cc#L56

i6_models/primitives/feature_extraction.py Outdated Show resolved Hide resolved
i6_models/primitives/feature_extraction.py Outdated Show resolved Hide resolved
@curufinwe curufinwe merged commit c363a01 into main Dec 7, 2023
2 checks passed
@curufinwe curufinwe deleted the extend_feature_extraction branch December 7, 2023 10:14
Comment on lines +48 to +52
periodic: bool = True
htk: bool = False
norm: Optional[Union[Literal["slaney"], float]] = "slaney"
dtype: DTypeLike = np.float32
spectrum_type: SpectrumType = SpectrumType.STFT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we agreed on not setting any defaults unless it is immediately obvious that that should be a default or for "structural parts"

But I now wonder that the original values had no defaults and what you add does. (Wich is required, I understand, to keep backwards compatibility - But then did we not agree to deprecate the old class and create a new one V2 in cases like this?)
Do we actually need to configure all this? Or are there ever only 2 sets of parameters that are going to be used? ("default", "rasr-compatible"). Is then not a better choice to have a single parameter for "default" vs. "rasr-compatible" that then sets all of these never otherwise touched parameters to the appropriate values?
And if the answer is yes, would it not rather make sense in this case to do create a new class - but not LogMelFeatureExtractionV2 but instead RasrCompatibleLogMelFeatureExtractionV1..? (and then we have no config options, just the two classes do use the correct thing)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curufinwe approved these changes 8 minutes ago
curufinwe merged commit c363a01 into main 8 minutes ago

oh well 🤷

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the defaults are problematic here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not the defaults that are problematic, but adding new parameter automatically breaks setups. I will revert the PR. And then I would be in favor of Willis RasrCompatibleLogMelFeatureExtraction instead of the V2. But I would be fine with both.

Copy link
Member

@albertz albertz Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does adding parameters with default values break anything?

Edit See discussion in #41 about that.

JackTemaki added a commit that referenced this pull request Dec 7, 2023
… logmel features (#40)"

This reverts commit c363a01.

Previous commit breakes hashes/setups.
JackTemaki added a commit that referenced this pull request Dec 7, 2023
… logmel features (#40)" (#41)

This reverts commit c363a01.

Previous commit breakes hashes/setups.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants