Skip to content

Conversation

@ahatamiz
Copy link
Contributor

@ahatamiz ahatamiz commented Jun 29, 2021

Signed-off-by: ahatamizadeh ahatamizadeh@nvidia.com

fixes #2403, part of #2394

Description

This pull request adds the following:

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

Signed-off-by: ahatamizadeh <ahatamizadeh@nvidia.com>
@ahatamiz
Copy link
Contributor Author

/black

@ahatamiz
Copy link
Contributor Author

@wyli , @Nic-Ma

@wyli
Copy link
Contributor

wyli commented Jun 29, 2021

Looks nice! Could you help fix the style errors? https://github.com/Project-MONAI/MONAI/runs/2940634277

Signed-off-by: ahatamizadeh <ahatamizadeh@nvidia.com>
@ahatamiz
Copy link
Contributor Author

Looks nice! Could you help fix the style errors? https://github.com/Project-MONAI/MONAI/runs/2940634277

@wyli, fixed those issues. But there are further issues in lint and type checks which I will address.

Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

thanks, the networks mainly support 3d, would be great to add the 2d support. or we could file a separate feature request and address that later.

self.drop2 = nn.Dropout(dropout_rate)

def forward(self, x):
x = self.fn(self.linear1(x))
Copy link
Contributor

Choose a reason for hiding this comment

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

might be more robust if there's a torch.flatten as the first step?

@wyli
Copy link
Contributor

wyli commented Jun 29, 2021

Looks nice! Could you help fix the style errors? https://github.com/Project-MONAI/MONAI/runs/2940634277

@wyli, fixed those issues. But there are further issues in lint and type checks which I will address.

sure, in many cases mypy is not smart enough to infer the types and can be difficult to fix... you can use # type: ignore to skip the checks if needed

ahatamiz added 4 commits June 30, 2021 00:32
Signed-off-by: ahatamizadeh <ahatamizadeh@nvidia.com>
Signed-off-by: ahatamizadeh <ahatamizadeh@nvidia.com>
Signed-off-by: ahatamizadeh <ahatamizadeh@nvidia.com>
Signed-off-by: ahatamizadeh <ahatamizadeh@nvidia.com>
@wyli
Copy link
Contributor

wyli commented Jun 30, 2021

I think the unit tests took too long to finish on cpu-only testing machine, could you reduce the input size/model size in the unit tests? otherwise please add @skip_if_quick to the test cases, for example

MONAI/tests/test_ahnet.py

Lines 128 to 129 in 12f267c

@skip_if_quick
def test_fcn_shape(self, input_param, input_shape, expected_shape):

ahatamiz added 2 commits June 30, 2021 21:32
Signed-off-by: ahatamizadeh <ahatamizadeh@nvidia.com>
@ahatamiz
Copy link
Contributor Author

ahatamiz commented Jul 1, 2021

I think the unit tests took too long to finish on cpu-only testing machine, could you reduce the input size/model size in the unit tests? otherwise please add @skip_if_quick to the test cases, for example

MONAI/tests/test_ahnet.py

Lines 128 to 129 in 12f267c

@skip_if_quick
def test_fcn_shape(self, input_param, input_shape, expected_shape):

Pushed another version with reduced input sizes. Tests seem to be done in reasonable amount of time on CPU.

Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

Thanks! It looks nice. Could you please help create a ticket about supporting 2d patch embedding and networks

@wyli wyli merged commit d41af7e into Project-MONAI:dev Jul 1, 2021
@ahatamiz
Copy link
Contributor Author

ahatamiz commented Jul 1, 2021

Thanks! It looks nice. Could you please help create a ticket about supporting 2d patch embedding and networks

Thanks a lot ! I just created #2499 in response to this.

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.

generic image-based attention modules (6/July)

2 participants