-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change network config format, and update layer act #980
Conversation
_act_dict = { | ||
"relu": tf.nn.relu, | ||
"relu6": tf.nn.relu6, | ||
"leaky_relu": tf.nn.leaky_relu, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when act = 'lrelu0.2' or 'leaky_relu0.2' act = lambda x : tf.nn.leaky_relu(x, 0.2'
tensorlayer/layers/core.py
Outdated
@@ -84,6 +94,13 @@ def __init__(self, name=None, *args, **kwargs): | |||
_global_layer_name_dict[name] = 0 | |||
|
|||
self.name = name | |||
if haveact: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if isfun(act):
self.act = act
elif act == None:
self.act = lambda x: x
elif instance(act, str):
self.act = str2act(act)
else:
raise Exception("unsupported act {}".format(act))
tensorlayer/layers/core.py
Outdated
"relu": tf.nn.relu, | ||
"relu6": tf.nn.relu6, | ||
"leaky_relu": tf.nn.leaky_relu, | ||
"lrelu0.2": tf.nn.leaky_relu, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is incorrect .. need to parse the number from lrelu222.222
, lambda x : tf.nn.leaky_relu(x, 222.222)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zsdonghao fixed
Checklist
Motivation and Context
Description
Please review.