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

customized output instead of just Merge #787

Closed
jeffzhengye opened this issue Oct 5, 2015 · 5 comments
Closed

customized output instead of just Merge #787

jeffzhengye opened this issue Oct 5, 2015 · 5 comments

Comments

@jeffzhengye
Copy link
Contributor

Hi. All
It seems that when there are multiple inputs for a node (graph.add_node), the output can only be something from Merge. Is there any nice workaround if I want to have a customized output? Thanks.

@fchollet
Copy link
Member

fchollet commented Oct 5, 2015

Is there any nice workaround if I want to have a customized output?

Not clear what you mean by "customized output", but maybe you can simply write your own layer?

@jeffzhengye
Copy link
Contributor Author

@fchollet first, thanks for your reply.
See the code here https://github.com/fchollet/keras/blob/master/keras/layers/containers.py#L209
The inputs have to be merged (can only use Merge). What if I want to merge/operate the inputs in a customized way?
Writing my own layer cannot change 'the Merge' at line L209.

@fchollet
Copy link
Member

fchollet commented Oct 5, 2015

Technically, you could concatenate your inputs (Merge -> concat), then in your own custom layer you could retrieve the original inputs from the concatenated ones.

In the near future, we have plans to support custom multi-input layers (see #620 (comment)). But it's not supported for now.

@jeffzhengye
Copy link
Contributor Author

@fchollet The problem is Merge is not applicable due to the dimension of the inputs.
My current walk-around is to extend Graph to have a customized add_node method, in which we don't use a fixed Merge. But it's kinda ugly to me.

@fchollet
Copy link
Member

fchollet commented Oct 6, 2015

Glad you have a workaround. In the future it will be possible as part of the standard Graph API.

@fchollet fchollet closed this as completed Oct 6, 2015
hubingallin pushed a commit to hubingallin/keras that referenced this issue Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants