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

multimodality example #70

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

multimodality example #70

wants to merge 7 commits into from

Conversation

taltlusty
Copy link
Collaborator

please review , thanks

Copy link
Collaborator

@mosheraboh mosheraboh left a comment

Choose a reason for hiding this comment

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

Hi! Looks good.
The main question we should ask ourselves is what do we want to create here?
end to end example/template for multimodality /shared technology?
If all of them (which is my guess), what are the technologies that you want to create? can you separate it from the rest of the example and be extra pedantic with the explanations/type annotations for those components?
As you mentioned in our talk, we need to reorganize the dataset code both to be more simple and also to use fuse2 code.




def IMAGING_dataset():
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one returns augmentor and not a dataset, right?
If yes, lets rename (name should be lower case with underscores) and also add type annotation for the returned value.


def IMAGING_dataset():
"""
Creates Fuse Dataset object for training, validation and test
Copy link
Collaborator

Choose a reason for hiding this comment

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

comment not up to date I guess.

return augmentor


def TABULAR_dataset(tabular_processor,df,tabular_features,sample_key):
Copy link
Collaborator

Choose a reason for hiding this comment

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

type annotations, name with lower case letters (tabular processor). and comments.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed this func

validation_dataset.create() # use ThreadPool to create this dataset, to avoid cv2 problems in multithreading
test_dataset.create() # use ThreadPool to create this dataset, to avoid cv2 problems in multithreading

lgr.info(f'- Load and cache data:')
Copy link
Collaborator

Choose a reason for hiding this comment

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

move this line to line 158

self.categorical_tabular_input = categorical_tabular_input
self.backbone_categorical_tabular = backbone_categorical_tabular
self.backbone_cat_tabular = backbone_continuous_tabular
# self.add_module('backbone', self.backbone)
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove

self.backbone_cat_tabular = backbone_continuous_tabular
# self.add_module('backbone', self.backbone)
self.heads = torch.nn.ModuleList(heads)
self.add_module('heads', self.heads)
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove

self.tabular_inputs = tabular_inputs
self.tabular_backbone = tabular_backbone
if self.tabular_backbone:
self.add_module('tabular_backbone', self.tabular_backbone)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you need the add_module?

tabular_backbone: torch.nn.Module=None,
imaging_backbone: torch.nn.Module=None,
multimodal_backbone: torch.nn.Module=None,
tabular_heads: Sequence[torch.nn.Module]=None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you care if it's imaging, tabular or multimodal heads?
If you don't care, you can maintain a single list for all heads.

return batch_dict['model']


if __name__ == '__main__':
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove. add it as a unitest if it's important

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will remove at the end of the review

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.

2 participants