-
Notifications
You must be signed in to change notification settings - Fork 50
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logical bug in IRTNet.forward #31
Comments
Thank you for your bug report, we will reply you as soon as possible. |
15 tasks
Thanks for reporting the bug and you provided very useful advice on the improvement of our framework .We fix the bug by removing the sigmoid function. We also add constrains that ensures a>=0 and 0 <= c <= 1. |
@ViviHong200709 - thanks! I added two comments to the PR that I think should be looked at. |
15 tasks
15 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
馃悰 Description
I was browsing this repo for IRT implementations and found (I think) a theoretical bug in the implementation of IRTNet.
IRTNet.forward
is defined herehttps://github.com/bigdata-ustc/EduCDM/blob/main/EduCDM/IRT/GD/IRT.py#L30
And the logic is that the output of
irf
is passed through the sigmoid function. This is fine if the output ofirf
itself is a "logit".The IRF function is defined here:
https://github.com/bigdata-ustc/EduCDM/blob/main/EduCDM/IRT/irt.py#L10
If you look at this you can see that it is already depicting sigmoid behaviour (assuming, of course, that
0 <= c <= 1
). In other words,irf
is returning probabilities, and not logits. As a result, the forward function above is actually doing this:which I think is probably a bug.
If I haven't misunderstood, I have two recommendations:
torch.sigmoid
call fromforward
c
through a sigmoid function to ensure it doesn't go negative or above 1. (Perhaps selectable inirf_kwargs
?)i.e.
Edit: I noticed that this
torch.sigmoid(irf(...))
pattern also happens in MIRT, and possible elsewhere too.Edit 2: I also realise that because sigmoid is monotonic, it doesn't really change the optimal solution. However, it does seem unnecessary to differentiate through sigmoid twice.
Error Message
NA
To Reproduce
NA
Environment
Environment Information
Operating System: NA
Python Version: NA
Additional context
The text was updated successfully, but these errors were encountered: