Skip to content

Conversation

@divyashreepathihalli
Copy link
Collaborator

No description provided.

@mattdangerw
Copy link
Member

@divyashreepathihalli I think you need to move this to the keras-hub directory now after the rename

@divyashreepathihalli
Copy link
Collaborator Author

@divyashreepathihalli I think you need to move this to the keras-hub directory now after the rename

done

Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

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

Thanks! Left some comments, look like they might show up in the old location sadly.

self.bottom_right_corner_embed = keras.layers.Embedding(
1, hidden_size, name="bottom_right_corner_embed"
)
self.not_a_point_embed = keras.layers.Embedding(
Copy link
Member

Choose a reason for hiding this comment

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

what is a "not a point embed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here is the original implementation of this. - self.not_a_point_embed = nn.Embedding(1, embed_dim)

When you use SAM without providing explicit point prompts, , the model still needs some input to represent the "absence" of point information. This is where not_a_point_embed is used. not_a_point_embed acts like a placeholder or default value when you don't specify point prompts. It allows the model to function correctly even without explicit point guidance.

@divyashreepathihalli divyashreepathihalli marked this pull request as draft September 20, 2024 21:42
@divyashreepathihalli divyashreepathihalli added the kokoro:force-run Runs Tests on GPU label Sep 23, 2024
@divyashreepathihalli divyashreepathihalli marked this pull request as ready for review September 23, 2024 20:14
Copy link
Member

@SamanehSaadat SamanehSaadat left a comment

Choose a reason for hiding this comment

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

Thanks, Divya!
Left some nit comments!

(batch_size, 0, image_size, image_size, 1)
),
}
# todo: update preset name
Copy link
Member

Choose a reason for hiding this comment

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

Is this for later? Or the presets are uploaded and this can be updated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is for later. The weights are yet to be added. I will update the name once we have them uploaded.

query=queries, value=queries, key=queries
)
else:
queries_with_pe = queries + query_pe
Copy link
Member

Choose a reason for hiding this comment

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

What does pe stand for here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

positional embeddings. I updated the names wherever we have _pe

@divyashreepathihalli divyashreepathihalli merged commit 3fbbeea into keras-team:master Sep 24, 2024
@divyashreepathihalli divyashreepathihalli deleted the sam_hub branch October 7, 2024 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kokoro:force-run Runs Tests on GPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants