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
8fb0438d
Commit
8fb0438d
authored
Mar 28, 2022
by
A. Unique TensorFlower
Browse files
Merge pull request #10564 from exx8:master
PiperOrigin-RevId: 437890828
parents
428a156b
611abda1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
official/projects/vit/modeling/vit.py
official/projects/vit/modeling/vit.py
+16
-0
No files found.
official/projects/vit/modeling/vit.py
View file @
8fb0438d
...
@@ -173,6 +173,22 @@ class Encoder(tf.keras.layers.Layer):
...
@@ -173,6 +173,22 @@ class Encoder(tf.keras.layers.Layer):
x
=
self
.
_norm
(
x
)
x
=
self
.
_norm
(
x
)
return
x
return
x
def
get_config
(
self
):
config
=
{
'num_layers'
:
self
.
_num_layers
,
'mlp_dim'
:
self
.
_mlp_dim
,
'num_heads'
:
self
.
_num_heads
,
'dropout_rate'
:
self
.
_dropout_rate
,
'attention_dropout_rate'
:
self
.
_attention_dropout_rate
,
'kernel_regularizer'
:
self
.
_kernel_regularizer
,
'inputs_positions'
:
self
.
_inputs_positions
,
'init_stochastic_depth_rate'
:
self
.
_init_stochastic_depth_rate
,
'kernel_initializer'
:
self
.
_kernel_initializer
,
'add_pos_embed'
:
self
.
_add_pos_embed
,
}
base_config
=
super
().
get_config
()
return
base_config
.
update
(
config
)
class
VisionTransformer
(
tf
.
keras
.
Model
):
class
VisionTransformer
(
tf
.
keras
.
Model
):
"""Class to build VisionTransformer family model."""
"""Class to build VisionTransformer family model."""
...
...
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