-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
GenerateKeras produces invalid model code if used on a model as shown in the figure below. Since, LSTM has multiple outputs, it is not able to assign any to the actual Model code.

The code generated is the following(Master Branch):
import keras
from keras.models import Model
from keras.layers import *
input2 = Input(shape=(None, 37), batch_shape=None, dtype=None, sparse=False, tensor=None)
input3 = Input(shape=(None, 37), batch_shape=None, dtype=None, sparse=False, tensor=None)
output, hidden_state, cell_state = LSTM(units=256, activation="tanh", recurrent_activation="hard_sigmoid", use_bias=True, kernel_initializer="glorot_uniform", recurrent_initializer="orthogonal", bias_initializer="zeros", unit_forget_bias=True, kernel_regularizer=None, recurrent_regularizer=None, bias_regularizer=None, kernel_constraint=None, recurrent_constraint=None, bias_constraint=None, dropout=0, recurrent_dropout=0, implementation=1, return_sequences=True, return_state=True, go_backwards=False, stateful=False, unroll=False)(inputs=input3)
output2, hidden_state2, cell_state2 = LSTM(units=256, activation="tanh", recurrent_activation="hard_sigmoid", use_bias=True, kernel_initializer="glorot_uniform", recurrent_initializer="orthogonal", bias_initializer="zeros", unit_forget_bias=True, kernel_regularizer=None, recurrent_regularizer=None, bias_regularizer=None, kernel_constraint=None, recurrent_constraint=None, bias_constraint=None, dropout=0, recurrent_dropout=0, implementation=1, return_sequences=False, return_state=True, go_backwards=False, stateful=False, unroll=False)(inputs=input2, initial_state=[hidden_state, cell_state])
custom_objects = {}
model = Model(inputs=[input3,input2], outputs=[])
result = model
model.custom_objects = custom_objects