{"action":"opened","issue":{"url":"https://api.github.com/repos/farizrahman4u/recurrentshop/issues/112","repository_url":"https://api.github.com/repos/farizrahman4u/recurrentshop","labels_url":"https://api.github.com/repos/farizrahman4u/recurrentshop/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/farizrahman4u/recurrentshop/issues/112/comments","events_url":"https://api.github.com/repos/farizrahman4u/recurrentshop/issues/112/events","html_url":"https://github.com/farizrahman4u/recurrentshop/issues/112","id":391447462,"node_id":"MDU6SXNzdWUzOTE0NDc0NjI=","number":112,"title":"Installation issue","user":{"login":"mg64ve","id":22278227,"node_id":"MDQ6VXNlcjIyMjc4MjI3","avatar_url":"https://avatars1.githubusercontent.com/u/22278227?v=4","gravatar_id":"","url":"https://api.github.com/users/mg64ve","html_url":"https://github.com/mg64ve","followers_url":"https://api.github.com/users/mg64ve/followers","following_url":"https://api.github.com/users/mg64ve/following{/other_user}","gists_url":"https://api.github.com/users/mg64ve/gists{/gist_id}","starred_url":"https://api.github.com/users/mg64ve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mg64ve/subscriptions","organizations_url":"https://api.github.com/users/mg64ve/orgs","repos_url":"https://api.github.com/users/mg64ve/repos","events_url":"https://api.github.com/users/mg64ve/events{/privacy}","received_events_url":"https://api.github.com/users/mg64ve/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-16T08:51:03Z","updated_at":"2018-12-16T08:51:03Z","closed_at":null,"author_association":"NONE","body":"Hello, I have just done the following installation:\r\n\r\n```\r\ngit clone https://www.github.com/farizrahman4u/recurrentshop.git\r\ncd recurrentshop\r\npython setup.py install\r\n```\r\n\r\nbut if I execute the following code:\r\n\r\n```\r\n# The RNN logic is written using Keras's functional API.\r\n# Which means we use Keras layers instead of theano/tensorflow ops\r\nfrom keras.layers import *\r\nfrom keras.models import *\r\nfrom recurrentshop import *\r\n\r\nx_t = Input(shape=(5,)) # The input to the RNN at time t\r\nh_tm1 = Input(shape=(10,))  # Previous hidden state\r\n\r\n# Compute new hidden state\r\nh_t = add([Dense(10)(x_t), Dense(10, use_bias=False)(h_tm1)])\r\n\r\n# tanh activation\r\nh_t = Activation('tanh')(h_t)\r\n\r\n# Build the RNN\r\n# RecurrentModel is a standard Keras `Recurrent` layer. \r\n# RecurrentModel also accepts arguments such as unroll, return_sequences etc\r\nrnn = RecurrentModel(input=x_t, initial_states=[h_tm1], output=h_t, final_states=[h_t])\r\n# return_sequences is False by default\r\n# so it only returns the last h_t state\r\n\r\n# Build a Keras Model using our RNN layer\r\n# input dimensions are (Time_steps, Depth)\r\nx = Input(shape=(7,5))\r\ny = rnn(x)\r\nmodel = Model(x, y)\r\n\r\n# Run the RNN over a random sequence\r\n# Don't forget the batch shape when calling the model!\r\nout = model.predict(np.random.random((1, 7, 5)))\r\nprint(out.shape)#->(1,10)\r\n\r\n\r\n# to get one output per input sequence element, set return_sequences=True\r\nrnn2 = RecurrentModel(input=x_t, initial_states=[h_tm1], output=h_t, final_states=[h_t],return_sequences=True)\r\n\r\n# Time_steps can also be None to allow variable Sequence Length\r\n# Note that this is not compatible with unroll=True\r\nx = Input(shape=(None ,5))\r\ny = rnn2(x)\r\nmodel2 = Model(x, y)\r\n\r\nout2 = model2.predict(np.random.random((1, 7, 5)))\r\nprint(out2.shape)#->(1,7,10)\r\n```\r\n\r\nI am getting:\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nNameError                                 Traceback (most recent call last)\r\n<ipython-input-1-50e11461fe1a> in <module>\r\n     17 # RecurrentModel is a standard Keras `Recurrent` layer.\r\n     18 # RecurrentModel also accepts arguments such as unroll, return_sequences etc\r\n---> 19 rnn = RecurrentModel(input=x_t, initial_states=[h_tm1], output=h_t, final_states=[h_t])\r\n     20 # return_sequences is False by default\r\n     21 # so it only returns the last h_t state\r\n\r\nNameError: name 'RecurrentModel' is not defined\r\n```\r\n\r\nIs there any further step for installation?\r\nThanks.\r\n\r\n\r\n"}}
{"actor":{"display_login":"mg64ve"}}