jcatw / scnn

Implementation of search-convolutional neural networks (SCNNs)
MIT License
51 stars 9 forks source link

#Compile function for 1D convolutional neural networks #2

Closed nalamotse1 closed 8 years ago

nalamotse1 commented 8 years ago

Hello guys, I am working on a time series data, fitting it into a 1D convolutional neural network but I seem to not find the right compile model. My net is configured in the following way: model = Sequential()

model.add(Convolution1D(21, 1, 7,activation='relu',init='uniform')) model.add(MaxPooling1D(pool_length=2)) model.add(Dropout(0.2))

model.add(Flatten()) model.add(Dense(7,1, activation='sigmoid'))

nb_timesteps = 7 # 2 (previous) + 1 (current) nb_sequences = input_var.shape[0] - nb_timesteps #8-3=5

input_3D = np.array([input_var[i:i+nb_timesteps] for i in range(nb_sequences)]) model.compile(loss='mean_squared_error', optimizer='adadelta') model.fit(input_3D, targetValue, batch_size=450, nb_epoch=10, validation_split=0.05,show_accuracy=True,verbose = 0)

And I do get this kind of error: model.fit(input_3D, targetValue, batch_size=450, nb_epoch=10, validation_split=0.05,show_accuracy=True,verbose = 0) File "build/bdist.linux-x86_64/egg/keras/models.py", line 490, in fit File "build/bdist.linux-x86_64/egg/keras/models.py", line 211, in fit File "/usr/local/lib/python2.7/dist-packages/Theano-0.8.0rc1-py2.7.egg/theano/compile/function_module.py", line 871, in _call storage_map=getattr(self.fn, 'storage_map', None)) File "/usr/local/lib/python2.7/dist-packages/Theano-0.8.0rc1-py2.7.egg/theano/gof/link.py", line 314, in raise_with_op reraise(exc_type, exc_value, exc_trace) File "/usr/local/lib/python2.7/dist-packages/Theano-0.8.0rc1-py2.7.egg/theano/compile/function_module.py", line 859, in call outputs = self.fn()

jcatw commented 8 years ago

I think you have the wrong repo - scnn doesn't (directly) provide timeseries modeling or a 'Sequential' class. Closing.