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

Add basic feature exploration framework #36

Merged
merged 51 commits into from
Feb 5, 2023
Merged

Conversation

DavidLandup0
Copy link
Owner

@DavidLandup0 DavidLandup0 commented Feb 4, 2023

Adds the FeatureAnalyzer class, which accepts:

  • A model (PyTorch or TensorFlow)
  • A dataset (tf.data.Dataset or torch.utils.DataLoader)
  • Components (Learned features -> projected to 2 or 3 using PCA and t-SNE)
  • Batch limit (No need to run through the entire dataset)
  • Backend flag

And outputs a 2D or 3D plot of PCA and t-SNE analysis of the learned features, a la:

feature_analysis = deepvision.evaluation.FeatureAnalyzer(pt_model, 
                                                         train_dataloader, 
                                                         components=3,
                                                         limit_batches=1,
                                                         backend='pytorch')

feature_analysis.visualize()

image

image

This class is meant to be used with any model that has a top (or that has a top taken off, which tends to work much better for general feature analysis)

TODO: look into options of adding human-readable labels besides targets for legends as well as options of plotting images instead of scatter plot markers

@DavidLandup0 DavidLandup0 mentioned this pull request Feb 4, 2023
@DavidLandup0 DavidLandup0 merged commit 8077cf5 into main Feb 5, 2023
@DavidLandup0 DavidLandup0 deleted the feature_exploration branch February 5, 2023 12:32
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

1 participant