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-35540: Make the real-bogus Task and Interface run and pass the existing tests #5

Merged
merged 4 commits into from
Jul 13, 2022

Conversation

NimSed
Copy link
Contributor

@NimSed NimSed commented Jul 11, 2022

It is just about making the code not fail. Has nothing to do with the real-bogus classification accuracy, etc.

Copy link
Collaborator

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

Some style comments and suggestions about the tests.

models/testModel.py Show resolved Hide resolved
python/lsst/meas/transiNet/rbTransiNetInterface.py Outdated Show resolved Hide resolved
tests/test_TransiNetInterface.py Outdated Show resolved Hide resolved
tests/test_TransiNetInterface.py Show resolved Hide resolved
tests/test_TransiNetInterface.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

A few more adjustments, but otherwise you can merge.

inputs = CutoutInputs(science=data, difference=data, template=data)
result = self.interface.infer([inputs])
# TODO: I think this should return a score of identically zero?
self.assertEqual(result, [0])
self.assertTupleEqual(result.shape, (1, 1)) # Result is an array, even if we pass a signle sample
Copy link
Collaborator

Choose a reason for hiding this comment

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

signle->single

# TODO: I think this should return a score of identically zero?
self.assertEqual(result, [0])
self.assertTupleEqual(result.shape, (1, 1)) # Result is an array, even if we pass a signle sample
self.assertAlmostEqual(result[0][0], 0.5011908)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's note that this is a purely empirical value.

Now checks against an empirical (but meaningless) value, as well as
the size of the returned array.
Note: this assumes a fixed model+checkpoint file, which may change in
the future.
It is also squeezed to prevent the checkpoint from growing too big.
Updated checkpoint uploaded too.
@NimSed NimSed merged commit 243c3d1 into main Jul 13, 2022
parejkoj pushed a commit that referenced this pull request Dec 24, 2022
DM-35540: Make the real-bogus Task and Interface run and pass the existing tests
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