Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Swish #799

Merged
merged 1 commit into from
Apr 1, 2019
Merged

Swish #799

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions dual_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@
'SE_ratio', 2,
help='Squeeze and Excitation ratio.')

flags.DEFINE_bool(
'use_swish', False,
help=('Use Swish activation function inplace of ReLu. '
'https://arxiv.org/pdf/1710.05941.pdf'))


# TODO(seth): Verify if this is still required.
flags.register_multi_flags_validator(
Expand Down Expand Up @@ -406,6 +411,9 @@ def model_inference_fn(features, training, params):
data_format="channels_last")

def mg_activation(inputs):
if FLAGS.use_swish:
return tf.nn.swish(inputs)

return tf.nn.relu(inputs)


Expand Down