LSTM implementation in keras Using specific dataset
<p>I am trying to understand how LSTM RNNs work and how they can be implemented in Keras in order to be able to solve a binary classification problem. My code and the dataset i use are visible below. When i compilr the code i get an error <code>TypeError: __init__() got multiple values for keyword argument 'input_dim'</code>, Can anybody help?</p>

<pre><code>   from keras.models import Sequential
from keras.layers import LSTM
from keras.layers.embeddings import Embedding
from keras.layers import Dense
from sklearn.cross_validation import train_test_split
import numpy
from sklearn.preprocessing import StandardScaler # data normalization

seed = 7
numpy.random.seed(seed)
dataset = numpy.loadtxt("sorted output.csv", delimiter=",")
X = dataset[:,0:4]
scaler = StandardScaler(copy=True, with_mean=True, with_std=True ) #data normalization
X = scaler.fit_transform(X) #data normalization
Y = dataset[:4]
# split into 67% for train and 33% for test
X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.33, random_state=seed)
# create model
model = Sequential()
model.add(Embedding(12,input_dim=4,init='uniform',activation='relu'))
model.add(Dense(4, init='uniform', activation='relu'))
model.add(LSTM(100))
model.add(Dense(1, init='uniform', activation='sigmoid'))
# Compile model
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
# Fit the model
model.fit(X_train, y_train, validation_data=(X_test,y_test), nb_epoch=150, batch_size=10)
</code></pre>

<p><a href="http://i.stack.imgur.com/70UWR.png" rel="nofollow"><img src="http://i.stack.imgur.com/70UWR.png" alt="enter image description here"></a></p>

<p>Looks like two separate questions here. </p>

<p>Regarding how to use LSTMs / Keras, there are some good tutorials around. Try <a href="http://machinelearningmastery.com/binary-classification-tutorial-with-the-keras-deep-learning-library/" rel="nofollow">this one</a> which also describes a binary classification problem. If you have a specific issue or area that you don't understand, let me know.</p>

<p>Regarding the file opening issue, perhaps the whitespace in the filename is causing an issue. Check out <a href="http://stackoverflow.com/questions/14852140/whitespaces-in-the-path-of-windows-filepath">this answer</a> to see if it helps.</p>

python neural-network theano keras