Skip to content
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

Merged
merged 27 commits into from
Jun 2, 2019

Conversation

warshallrho
Copy link
Member

@warshallrho warshallrho commented May 25, 2019

Checklist

  • I've tested that my changes are compatible with the latest version of Tensorflow.
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

Description

Please review.

@warshallrho warshallrho changed the title [WIP] change network config format May 25, 2019
_act_dict = {
"relu": tf.nn.relu,
"relu6": tf.nn.relu6,
"leaky_relu": tf.nn.leaky_relu,
Copy link
Member

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'

@@ -84,6 +94,13 @@ def __init__(self, name=None, *args, **kwargs):
_global_layer_name_dict[name] = 0

self.name = name
if haveact:
Copy link
Member

@zsdonghao zsdonghao May 25, 2019

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))
"relu": tf.nn.relu,
"relu6": tf.nn.relu6,
"leaky_relu": tf.nn.leaky_relu,
"lrelu0.2": tf.nn.leaky_relu,
Copy link
Member

@zsdonghao zsdonghao May 29, 2019

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zsdonghao fixed

@zsdonghao zsdonghao changed the title [WIP] change network config format, and update layer act Jun 2, 2019
@zsdonghao zsdonghao merged commit 299046e into tensorlayer:master Jun 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants