-
Notifications
You must be signed in to change notification settings - Fork 155
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
Rename classifier (for NRE) to critic #1103
Conversation
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.
Great! thanks a lot Ben 🙏
looks all good. I am just not sure about the renaming to "critic". Technically, I see your point. But I fear it will be less clear for users. It also breaks the API. But I am open to be convinced.
@@ -119,32 +92,32 @@ def build_linear_classifier( | |||
check_embedding_net_device(embedding_net=embedding_net_y, datum=batch_y) | |||
|
|||
# Infer the output dimensionalities of the embedding_net by making a forward pass. | |||
x_numel = embedding_net_x(batch_x[:1]).numel() | |||
y_numel = embedding_net_y(batch_y[:1]).numel() | |||
x_numel = embedding_net_x(batch_x[:1]).size(-1) |
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.
what is the reason for this change? Was this a bug?
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.
.numel()
returns the number t.flatten().shape()[0]
, but this gives only the last dimension. I like thinking about dimensions when I can. Personally I think this makes more sense since we force the user to give (Batched) 1d inputs to these networks.
I will follow up after Friday. |
@janfb, I used let me know how you like it and I'll change to to that so we can get this merged. |
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.
thanks for the update @bkmi !
I see your point of classifier
vs discriminator
vs critic
. However, changing the name would result in a major API change. We would need to make sure it's back compatible, i.e., catch all classifier
in arguments and (user facing) function names etc. and issue a deprecation warning.
I would be hesitant in doing all this unless we really need to :)
@michaeldeistler what do you think?
I would also prefer to not change this right now -- users will already get a bunch of warnings when the new version is released (thinning for MCMC, importing posterior_nn) so I would prefer to not change this. |
okay, I'll follow your lead, but I would argue that maybe having one big change with many warnings will be simpler than adapting code once, then again for a later additional change. |
Hi @bkmi to move on with this PR I suggest the following: As we would prefer to not do the renaming to Thanks a lot! 🙏 |
What does this implement/fix? Explain your changes
The name
classifier
is inaccurate. Rather, a general name such as critic is more appropriate. The critic can be transformed into a classifier using the sigmoid (or other transformation). It can be made to estimate the likelihood-to-evidence ratio by simple evaluation. However, I think keeping the name of the network distinct from theRatioEstimator
class is a good idea.Does this close any currently open issues?
#1079
Any relevant code examples, logs, error output, etc?
Nope
Any other comments?
This cannot be applied until #1097 has been pulled!
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.
guidelines
with
pytest.mark.slow
.guidelines
main
(or there are no conflicts withmain
)