<p dir="auto">Hi, I try to add shared layer in Graph, but facing this problem:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from keras.models import Graph
from keras.layers import containers

block = containers.Sequential()
block.add(Dense(8, input_dim=20, activation='relu'))
block.add(Dense(1))


graph = Graph()
graph.add_input(name='input1', input_shape=(2,))
graph.add_input(name='input2', input_shape=(2,))

graph.add_shared_node(block, name='blocks', inputs=['input1', 'input2'], merge_mode='sum')
graph.add_node(Activation('sigmoid'), name='sigm', input='blocks')

graph.add_output(name='output', input='sigm')
graph.compile('rmsprop', {'output':'binary_crossentropy'})



---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
&lt;ipython-input-18-501bebb9a4df&gt; in &lt;module&gt;()
      8 graph.add_input(name='input2', input_shape=(2,))
      9 
---&gt; 10 graph.add_shared_node(block, name='blocks', inputs=['input1', 'input2'], merge_mode='sum')
     11 graph.add_node(Activation('sigmoid'), name='sigm', input='blocks')
     12 

/usr/local/lib/python2.7/site-packages/Keras-0.3.0-py2.7.egg/keras/layers/containers.pyc in add_shared_node(self, layer, name, inputs, merge_mode, concat_axis, dot_axes, outputs, create_output)
    327                 raise Exception('Unknown identifier: ' + input)
    328         s = Siamese(layer, layers, merge_mode, concat_axis=concat_axis, dot_axes=dot_axes)
--&gt; 329         s.set_name(name)
    330         self.namespace.add(name)
    331         self.nodes[name] = s

AttributeError: 'Siamese' object has no attribute 'set_name'"><pre class="notranslate"><code class="notranslate">from keras.models import Graph
from keras.layers import containers

block = containers.Sequential()
block.add(Dense(8, input_dim=20, activation='relu'))
block.add(Dense(1))


graph = Graph()
graph.add_input(name='input1', input_shape=(2,))
graph.add_input(name='input2', input_shape=(2,))

graph.add_shared_node(block, name='blocks', inputs=['input1', 'input2'], merge_mode='sum')
graph.add_node(Activation('sigmoid'), name='sigm', input='blocks')

graph.add_output(name='output', input='sigm')
graph.compile('rmsprop', {'output':'binary_crossentropy'})



---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
&lt;ipython-input-18-501bebb9a4df&gt; in &lt;module&gt;()
      8 graph.add_input(name='input2', input_shape=(2,))
      9 
---&gt; 10 graph.add_shared_node(block, name='blocks', inputs=['input1', 'input2'], merge_mode='sum')
     11 graph.add_node(Activation('sigmoid'), name='sigm', input='blocks')
     12 

/usr/local/lib/python2.7/site-packages/Keras-0.3.0-py2.7.egg/keras/layers/containers.pyc in add_shared_node(self, layer, name, inputs, merge_mode, concat_axis, dot_axes, outputs, create_output)
    327                 raise Exception('Unknown identifier: ' + input)
    328         s = Siamese(layer, layers, merge_mode, concat_axis=concat_axis, dot_axes=dot_axes)
--&gt; 329         s.set_name(name)
    330         self.namespace.add(name)
    331         self.nodes[name] = s

AttributeError: 'Siamese' object has no attribute 'set_name'
</code></pre></div>
<p dir="auto">Is it my misunderstanding of using pattern or problem in code?</p>
<p dir="auto">Hi,</p>
<p dir="auto">I have been going through the latest the LSTM model for the text generation example from Andrej Kaparthy.  It's pretty cool and works pretty well.  Now, I am wondering if the LSTM model by Junhua Mao (<a href="http://arxiv.org/abs/1412.6632" rel="nofollow">http://arxiv.org/abs/1412.6632</a>) can be supported easily.  The reason i am asking this is the duplication of an embedding layer before the RNN (figure2).  I guess one can use the RepeatVector, but I havent seen enough examples to be sure.  So some clarification will be helpful.</p>
<p dir="auto">Thanks!  Keras rocks!</p>