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

Inigo dev #118

Merged
merged 16 commits into from
May 30, 2024
Merged

Inigo dev #118

merged 16 commits into from
May 30, 2024

Conversation

inigoval
Copy link
Collaborator

  • Add timm ViT fine-tuning support
  • Add sklearn linear regression sanity check to classification finetuning (TODO: add to regression also)
  • Some formatting also

self.encoder = encoder
# work out encoder dim 'manually'
self.encoder_dim = define_model.get_encoder_dim(self.encoder)
if isinstance(self.encoder, timm.models.VisionTransformer):
Copy link
Owner

Choose a reason for hiding this comment

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

TODO for me, I later found out this actually works on all timm models so should add a check like this for everything

Copy link
Owner

Choose a reason for hiding this comment

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

Changed to read attrs

Copy link
Owner

Choose a reason for hiding this comment

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

Changed to read attrs


# Sanity check embeddings with linear evaluation first
def on_train_start(self) -> None:
with torch.no_grad():
Copy link
Owner

Choose a reason for hiding this comment

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

This makes sense for you and I but I'm not sure it should run by default for Zoobot. I think it may confuse astronomers who will now get two separate performance measurements for linear eval. I'm also a bit worried about the potential memory use from encoding everything. Maybe we can just wrap this in a new arg to ZoobotAbstract, linear_sanity_check=False, and an if statement/func here?

Copy link
Owner

Choose a reason for hiding this comment

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

Moved to if statement

@mwalmsley mwalmsley merged commit f00f496 into main May 30, 2024
2 checks passed
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