Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add TransducerFullSumAndFramewiseTrainingPipeline #64
base: master
Are you sure you want to change the base?
Add TransducerFullSumAndFramewiseTrainingPipeline #64
Changes from 3 commits
dcafc88
7d55db8
3dc5576
ad7d848
a9a7321
5de3c91
9859714
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you duplicate this here? We already have such a class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here the context is a little broader. Should I give the rest as separated params to the functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no excuse. Then take the base context as an argument here and extend it. But do not duplicate code & logic when not really needed.
But what is really the extension here? Just the
alignment_topology
? For that, you don't need any newContext
type at all. Just pass it as an extra argument where-ever needed.Or maybe extend the base
Context
class. Probably we anyway need it also there?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is true. Should best add it there.
In
transducer_fullsum.py
you only providemake_net()
. But that isn't very flexible especially when you are calling it throughPretrain
. Wouldn't it be more meaningfull to wrap it in a class that holds the parameters non related to thePretrain
? We can then still definemake_net
with the same default params so it doesn't break anything.If so, let me know to open a pr.
Or how have you thought it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use
str.format
. Use f-strings.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is easy to do in this case. How would you do it? the
dataset_name
comes from**opts
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very bad. You should never introduce attribs in non-init functions. (Basic Python rules. I think PyCharm would also warn you about this, or not?)
Also, you should not access the global config in other functions. In the optimal case, it would never be accessed at all, and all relevant context information is passed in
__init__
. If needed, it might be used for default arguments in__init__
. See also other code.