-
Notifications
You must be signed in to change notification settings - Fork 57
AL/math/MaxPooling #407
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
base: develop
Are you sure you want to change the base?
AL/math/MaxPooling #407
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.
I have written some comments.
When I tried the example from the docs, I don't get the output that is written in the docs. So double check that.
And when I try to run the exact same example, but swapping numpy for torch, it doesn't work. Therefore I think that you should either make it work exactly the same for both cases, or write a clear example on what is different.
Related to that: for the torch version to work, the shapes have to be different from when running it with numpy. I can imagine that it might lead to problems when a pipeline has been created with numpy, and the user wants to run it with torch, and then gets a different result or that it doesn't work at all anymore. Maybe this is something to discuss in our next meeting.
feature = math.MaxPooling(ksize=2) | ||
pooled_image = feature.resolve(input_image) | ||
self.assertTrue(np.all(pooled_image == [[6.0, 8.0]])) | ||
|
||
|
||
# Extending the test and setting the backend to torch | ||
@unittest.skipUnless(TORCH_AVAILABLE, "PyTorch is not installed.") |
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.
I can see that you haven't created the layout like this. However, it looks different from how we have done it in test_features.py for example. I personally prefer the style we use in test_feature, as all tests belonging to one class are within the same "def test_....()"
Added docs, torch, tests for math.maxpooling.