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

Converted to Keras Core: A Vision Transformer without Attention #497

Merged
merged 3 commits into from
Jul 17, 2023

Conversation

anas-rz
Copy link
Contributor

@anas-rz anas-rz commented Jul 16, 2023

Remove tensorflow_addons dependency
Fix imports
Update shape computation in DropPath to shape = (tf.shape(x)[0],) + (1,) * (len(x.shape) - 1)
Update loss computation metrics update in subclassed model
Linked Issue: keras-team/keras#18468

@google-cla
Copy link

google-cla bot commented Jul 16, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@anas-rz anas-rz changed the title Port ShiftViT to keras core Port Example: A Vision Transformer without Attention to keras core Jul 17, 2023
@anas-rz anas-rz changed the title Port Example: A Vision Transformer without Attention to keras core Converted to Keras Core: A Vision Transformer without Attention to keras core Jul 17, 2023
@anas-rz anas-rz changed the title Converted to Keras Core: A Vision Transformer without Attention to keras core Converted to Keras Core: A Vision Transformer without Attention Jul 17, 2023
Copy link
Contributor

@fchollet fchollet left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Can you provide the git diff from the original example?

@@ -0,0 +1,880 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove blank line

In this example, we minimally implement the paper with close alignement to the author's
[official implementation](https://github.com/microsoft/SPACH/blob/main/models/shiftvit.py).


Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove empty text lines at the end of text blocks

@anas-rz
Copy link
Contributor Author

anas-rz commented Jul 17, 2023

Here it is.
shiftvit_keras_core-diff.txt

@fchollet
Copy link
Contributor

Thanks! The number of epochs should be reverted to its original value.

@anas-rz
Copy link
Contributor Author

anas-rz commented Jul 17, 2023

Done.

Copy link
Contributor

@fchollet fchollet left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@fchollet fchollet merged commit 1a14806 into keras-team:main Jul 17, 2023
@anas-rz anas-rz deleted the port_shiftvit branch July 17, 2023 21:15
adi-kmt pushed a commit to adi-kmt/keras-core that referenced this pull request Jul 21, 2023
…s-team#497)

* Port ShiftViT to keras core

* remove empty spaces

* Reverted epochs
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