Skip to content

Conversation

@One-sixth
Copy link
Contributor

@One-sixth One-sixth commented May 16, 2018

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

@One-sixth One-sixth changed the title Add a new layer ElementwiseLambdaLayer [WIP ]Add a new layer ElementwiseLambdaLayer May 16, 2018
@One-sixth One-sixth changed the title [WIP ]Add a new layer ElementwiseLambdaLayer [WIP] Add a new layer ElementwiseLambdaLayer May 16, 2018
@One-sixth One-sixth changed the title [WIP] Add a new layer ElementwiseLambdaLayer Add a new layer ElementwiseLambdaLayer May 16, 2018
@DEKHTIARJonathan DEKHTIARJonathan self-requested a review May 16, 2018 09:22
Copy link
Member

@DEKHTIARJonathan DEKHTIARJonathan left a comment

Choose a reason for hiding this comment

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

Please add an entry in the Changelog following the existing formating and syntax.

self,
layers,
fn,
fn_args=None,
Copy link
Member

Choose a reason for hiding this comment

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

please add parameter

  • act=None

fn_args = {}

self.inputs = [layer.outputs for layer in layers]
with tf.variable_scope(name) as vs:
Copy link
Member

Choose a reason for hiding this comment

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

Add a linebreak before the new scope


self.inputs = [layer.outputs for layer in layers]
with tf.variable_scope(name) as vs:
self.outputs = fn(*self.inputs, **fn_args)
Copy link
Member

Choose a reason for hiding this comment

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

self.outputs = fn(*self.inputs, **fn_args)
if act:
    self.outputs = act(self.outputs)

@tensorlayer tensorlayer deleted a comment May 16, 2018
@One-sixth
Copy link
Contributor Author

I have finished modifying it.

CHANGELOG.md Outdated
- CI Tool:
- Danger CI has been added to enforce the update of the changelog (by @lgarithm and @DEKHTIARJonathan in #563)
- https://github.com/apps/stale/ added to clean stale issues (by @DEKHTIARJonathan in #573)
- API:
Copy link
Member

Choose a reason for hiding this comment

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

Change for Layer

CHANGELOG.md Outdated
- Danger CI has been added to enforce the update of the changelog (by @lgarithm and @DEKHTIARJonathan in #563)
- https://github.com/apps/stale/ added to clean stale issues (by @DEKHTIARJonathan in #573)
- API:
- Add new layer ElementwiseLambdaLayer (by @One-sixth in #576)
Copy link
Member

Choose a reason for hiding this comment

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

Incorrect PR number => #579

Please avoid using 'add of blablabla'. We already know you added something thanks to the Changelog Section.

Make smthg like this:



class ElementwiseLambdaLayer(Layer):
"""A layer uses a custom function to join multiple layer inputs.
Copy link
Member

Choose a reason for hiding this comment

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

English Syntax: A layer that use a custom function to combine multiple :class:Layer inputs.

The function that applies to the outputs of previous layer.
fn_args : dictionary or None
The arguments for the function (option).
name : str
Copy link
Member

Choose a reason for hiding this comment

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

Missing:

act : activation function
        The activation function of this layer.

@DEKHTIARJonathan DEKHTIARJonathan dismissed their stale review May 16, 2018 11:52

Wrong Approval

Copy link
Member

@DEKHTIARJonathan DEKHTIARJonathan left a comment

Choose a reason for hiding this comment

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

Please modify the comments.

Other changes need to be made, however let's proceed step by step

@DEKHTIARJonathan DEKHTIARJonathan changed the title Add a new layer ElementwiseLambdaLayer [WIP] Add a new layer ElementwiseLambdaLayer May 16, 2018
@DEKHTIARJonathan DEKHTIARJonathan dismissed their stale review May 16, 2018 12:16

Wrong Approval

@tensorlayer tensorlayer deleted a comment May 16, 2018
@One-sixth
Copy link
Contributor Author

Have any other problems?

@DEKHTIARJonathan
Copy link
Member

DEKHTIARJonathan commented May 16, 2018

@One-sixth I was first focusing on the "cosmetic" aspects.

Now I see two major issues before merging:

  1. The layer you implemented is missing some unittest to make sure everything works as planned: test_layers_merge.py

  2. You need to update the documentation to insert this layer:
    https://github.com/tensorlayer/tensorlayer/edit/master/docs/modules/layers.rst#L326

CHANGELOG.md Outdated
- Danger CI has been added to enforce the update of the changelog (by @lgarithm and @DEKHTIARJonathan in #563)
- https://github.com/apps/stale/ added to clean stale issues (by @DEKHTIARJonathan in #573)
- Layer:
- ElementwiseLambdaLayer added to use custom function to connect multiple layer inputs. (by @One-sixth in #579)
Copy link
Member

Choose a reason for hiding this comment

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

remove "." before "(by @One-sixth in #579)"

@tensorlayer tensorlayer deleted a comment May 16, 2018
@DEKHTIARJonathan
Copy link
Member

DEKHTIARJonathan commented May 16, 2018

Error with YAPF, run the following:
yapf -i --style=setup.cfg tests/test_layers_merge.py

@DEKHTIARJonathan DEKHTIARJonathan changed the title [WIP] Add a new layer ElementwiseLambdaLayer Add a new layer ElementwiseLambdaLayer May 16, 2018
@DEKHTIARJonathan
Copy link
Member

@One-sixth congratulation on this PR! I merge immediately :D

@DEKHTIARJonathan DEKHTIARJonathan merged commit 9933525 into tensorlayer:master May 16, 2018
@One-sixth
Copy link
Contributor Author

Good

@One-sixth One-sixth deleted the patch-1 branch May 16, 2018 14:45
luomai pushed a commit that referenced this pull request Nov 21, 2018
* Add a new layer ElementwiseLambdaLayer

* delete assert

* fix style

* add act parameter, fix style

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update merge.py

* Update test_layers_merge.py

* Update test_layers_merge.py

* Update layers.rst

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants