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
28ce4696
Commit
28ce4696
authored
Jun 03, 2021
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 377422408
parent
0b555eed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
official/modeling/activations/sigmoid.py
official/modeling/activations/sigmoid.py
+1
-1
official/modeling/activations/swish.py
official/modeling/activations/swish.py
+2
-1
No files found.
official/modeling/activations/sigmoid.py
View file @
28ce4696
...
...
@@ -28,4 +28,4 @@ def hard_sigmoid(features):
The activation value.
"""
features
=
tf
.
convert_to_tensor
(
features
)
return
tf
.
nn
.
relu6
(
features
+
tf
.
c
onstant
(
3.
))
*
0.16667
return
tf
.
nn
.
relu6
(
features
+
tf
.
c
ast
(
3.
,
features
.
dtype
))
*
0.16667
official/modeling/activations/swish.py
View file @
28ce4696
...
...
@@ -52,7 +52,8 @@ def hard_swish(features):
The activation value.
"""
features
=
tf
.
convert_to_tensor
(
features
)
return
features
*
tf
.
nn
.
relu6
(
features
+
tf
.
constant
(
3.
))
*
(
1.
/
6.
)
fdtype
=
features
.
dtype
return
features
*
tf
.
nn
.
relu6
(
features
+
tf
.
cast
(
3.
,
fdtype
))
*
(
1.
/
6.
)
@
tf
.
keras
.
utils
.
register_keras_serializable
(
package
=
'Text'
)
...
...
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