Skip to content

Conversation

@ghkim9213
Copy link
Collaborator

@ghkim9213 ghkim9213 commented Feb 21, 2025

This PR:

  • Integrates multiple types of modality classes into one
    • Changes the data input method
    • Adds ModelWrapper according to the data input method change
    • Modifies the explainers and metrics based on the data input method change
    • Changes the input method for utility functions
    • As a result, consolidates multiple auto-explanation classes based on modality types into one
  • Modifies the suggest method in the optimization module
  • Modifies repr
  • Test
    • Image
    • Tabular
    • Text
    • Vqa
    • Time-series
    • Visualizer
  • Documentation
    p.s. scripts/test_*.py may help to understand the purposes or directions of these modifications.

Copy link
Collaborator

@enver1323 enver1323 left a comment

Choose a reason for hiding this comment

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

The PR looks great. Thank you so much for your hard work! My only concern is that relying on number of dimensions and the data type may not always be representative enough to detect the correct modality. As written in comments, TS and Tabular data modalities might have more than 2 dimensions. This might limit users' data types, and workflows, if the modality is determined implicitly. Other than this, the code looks great! Thank you once again!

def util_functions(self):
return self._util_functions

def _set_util_functions(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about this function public (with the first underscore)? I am not sure, if my thinking is correct, but by making this function public users would be able to customize the modality class without a need to extend it


@property
def device(self):
return self._device
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about making this dynamic? Thus, the code will not break, if model changes its device mid experiment.
return next(iter(self.model.parameters())).device



DATA_MODALITY_MAYBE = {
(float, 2): 'tabular or time-series',
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think, both tabular, and time-series can have 3 and more dimensions? What do you think could be another way to distinguish the data modalities?

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.

3 participants