Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
7c917ef2
Commit
7c917ef2
authored
Jul 19, 2022
by
Liangzhe Yuan
Committed by
A. Unique TensorFlower
Jul 19, 2022
Browse files
Register ViT architecture hyperparams.
PiperOrigin-RevId: 461964298
parent
ddc9bce0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
official/projects/vit/modeling/vit.py
official/projects/vit/modeling/vit.py
+6
-0
No files found.
official/projects/vit/modeling/vit.py
View file @
7c917ef2
...
...
@@ -263,6 +263,12 @@ class VisionTransformer(tf.keras.Model):
original_init
:
bool
=
True
,
pos_embed_shape
:
Optional
[
Tuple
[
int
,
int
]]
=
None
):
"""VisionTransformer initialization function."""
self
.
_mlp_dim
=
mlp_dim
self
.
_num_heads
=
num_heads
self
.
_num_layers
=
num_layers
self
.
_hidden_size
=
hidden_size
self
.
_patch_size
=
patch_size
inputs
=
tf
.
keras
.
Input
(
shape
=
input_specs
.
shape
[
1
:])
x
=
layers
.
Conv2D
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment