-
Notifications
You must be signed in to change notification settings - Fork 0
My feedback and thoughts #1
Comments
@mthrok Thanks a lot for the prompt feedback, very good points. I'll try to respond to as many as I can: Major points
Each Domain library should have its own implementation of base Concerning the use of a parent class within a domain project, I think it can be beneficial because:
Feel free to completely ignore the specific variable. It was meant to be there for illustration purposes of things you could define in the Weights class. If you have no use for it then your base class won't declare it.
Excellent point; Vision doesn't have post-processing. I think this means that your Minor points
Naming is NP-hard. :) I'm open to other naming proposals.
Excellent point. My implementation was meant to be a simple one just to illustrate options but if you want send a PR and we can merge it in!
We are using Enums in multiple places on Vision without problems [1, 2, 3]
Yes, that's true. In domains where the transforms have no memory (like vision typically), it's not a big deal to instantiate the object immediately. But in domains like Text (and Audio?) Lazy loading is critical. This is why I adopted this strategy. I think we can setup a unit-test that fetches |
@mthrok Many of your points raised in this ticket now are being discussed on separate issues. Could you indicate which other of your points are not covered by my response so that we can open separate dedicated issues and then close this one? It might be easier to follow this way. |
So after giving some thought, I think renaming weights to something like bundle would communicate the concept better. With that we can close the issue. |
Thanks @mthrok. I agree that using good names is crucial. Could you please clarify if you propose to rename the TBH I'm not sure that |
It's |
Thanks for the clarification! Cool, my reservation above was about renaming |
Overall, it looks good. Introducing the dedicated class and adding preprocessing transform feels a major improvement.
The following is my thoughts reading through the README and examples.
Major points
Weights
class? I think the proposition can also be anidiom of best practice
for the flexibility, which different project can implement without having a parent class.check_type
method is nice but it is simple enough (isinstance
) to perform the check. Also what do you think of allowing the customize the behavior with duck-typing, say, in-house models?latest: bool
feels a bit tedious for maintenance. When I add a latest model, I would like to be care-free about the previously-latest model. Since only one of them is supposed to be `True, how about simply making it a hard-coded class attribute?latest: bool
might not synthesize well with audio. Say, I have a model architecture for Speech Recognition, I can have multiple of SOTA/latest models because of language / expected environments. (Note it is common to train and deploy multiple models with the same architecture, so that one is optimized for meeting room dictation, another is optimized for phone-conversation etc...)Minor points
Weights
feels slightly off becausetransforms
not only contains weights but also defines the preprocessing operations as well.state_dict
method should accept**kwargs
, which will be passed toload_state_dict_from_url
, so that the downloading process can be customized. (i.e. download location and such)partial
is used for the definition oftransforms
. I think this is good, because it will not instantiate an object. But every maintainer needs to be careful not to accidentally instantiate a transform here, and maintainers have to remember it at code review.The text was updated successfully, but these errors were encountered: