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

DM-34264: Design Task for applying real-bogus scoring #4

Merged
merged 4 commits into from
Jul 7, 2022

Conversation

parejkoj
Copy link
Collaborator

@parejkoj parejkoj commented Jul 1, 2022

This implements a working Task (tested with a mock of interface.inter), and what should be a viable API for the model interface.

The weights loading is currently a hack, using a config field. We won't want that in production, but until we have a better sense of the size of the weights file (both on disk and in-memory), we won't know whether we will need this to be in a separate process (e.g. a REST API server somewhere else), or how we will keep the pytorch model instantiated in memory between jobs. This at least should be enough to let us start testing real/bogus in a working pipeline.

Copy link
Contributor

@NimSed NimSed left a comment

Choose a reason for hiding this comment

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

I added a couple of comments. I tried to limit them to naming, docstrings, etc., and only on the preexisting files.

models/testModel.py Show resolved Hide resolved
""" Constructor
"""
super(dummyClassifier, self).__init__()
super().__init__()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove the docstring? You wanted to suggest corrections?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No docstrings on __init__ methods, and docstrings should contain information you wouldn't otherwise get from the method name.

https://developer.lsst.io/python/numpydoc.html#placement-of-class-docstrings

@@ -21,9 +19,6 @@ def __init__(self):
self.fc2 = nn.Linear(128, 1)

def forward(self, x):
""" Forward pass
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove the docstring? You wanted to suggest corrections?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This docstring doesn't contain any real information. The method docstring in the parent class is more informative, so we should let the system default to that.

https://pytorch.org/docs/stable/generated/torch.nn.Module.html

python/lsst/meas/transiNet/rbTransiNetInterface.py Outdated Show resolved Hide resolved
python/lsst/meas/transiNet/rbTransiNetInterface.py Outdated Show resolved Hide resolved
The interface will need to be fleshed out and have an actual test suite to go
with it (the current test will fail); this provides an API for the Task to
code against.
@parejkoj
Copy link
Collaborator Author

parejkoj commented Jul 6, 2022

I've responed to your comments and rebased everything. Please take a look at the rest of the task as well.

@NimSed
Copy link
Contributor

NimSed commented Jul 7, 2022

I've responed to your comments and rebased everything. Please take a look at the rest of the task as well.

Looks good. I'll start testing the functionality after this is merged, and capture potential needed changes along the way.

@parejkoj parejkoj merged commit 2987d80 into main Jul 7, 2022
parejkoj added a commit that referenced this pull request Dec 24, 2022
DM-34264: Design Task for applying real-bogus scoring
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.

None yet

2 participants