Instructions to use keras-io/Image-Classification-using-EANet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TF-Keras
How to use keras-io/Image-Classification-using-EANet with TF-Keras:
# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy), and from_pretrained_keras was removed in huggingface_hub 1.0. # See https://github.com/keras-team/tf-keras for more details. # !pip install "huggingface_hub<1.0" tf_keras from huggingface_hub import from_pretrained_keras model = from_pretrained_keras("keras-io/Image-Classification-using-EANet") - Notebooks
- Google Colab
- Kaggle
Commit ·
4c24885
1
Parent(s): 50404f1
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,4 +10,5 @@ This example implements the EANet model for image classification, and demonstrat
|
|
| 10 |
|
| 11 |
|
| 12 |
**Implement the EANet model**
|
|
|
|
| 13 |
The EANet model leverages external attention. The computational complexity of traditional self attention is O(d * N ** 2), where d is the embedding size, and N is the number of patch. the authors find that most pixels are closely related to just a few other pixels, and an N-to-N attention matrix may be redundant. So, they propose as an alternative an external attention module where the computational complexity of external attention is O(d * S * N). As d and S are hyper-parameters, the proposed algorithm is linear in the number of pixels. In fact, this is equivalent to a drop patch operation, because a lot of information contained in a patch in an image is redundant and unimportant.
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
**Implement the EANet model**
|
| 13 |
+
|
| 14 |
The EANet model leverages external attention. The computational complexity of traditional self attention is O(d * N ** 2), where d is the embedding size, and N is the number of patch. the authors find that most pixels are closely related to just a few other pixels, and an N-to-N attention matrix may be redundant. So, they propose as an alternative an external attention module where the computational complexity of external attention is O(d * S * N). As d and S are hyper-parameters, the proposed algorithm is linear in the number of pixels. In fact, this is equivalent to a drop patch operation, because a lot of information contained in a patch in an image is redundant and unimportant.
|