--
You received this message because you are subscribed to the Google Groups "Keras-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/e12a648e-57ef-452a-8d2e-ccabf22455ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/5B353C7D-1D60-4CC2-B373-51B317372EA8%40gmail.com.
from keras.models import Sequential
from keras.layers import Merge, Dense, Activation
from keras.optimizers import SGD
nu=4
ny=4
nhidden=4
thetaHat = Sequential([
Dense(nhidden, input_dim=nu+ny),
Activation('softmax'),
Dense(nhidden),
Activation('relu'),
Dense(nu)
])
thetaHat.summary()
inputVector=Sequential()
inputVector.add(Dense(nu, input_dim=nu))
inputVector.summary()
dotted=Merge([thetaHat, inputVector] , mode='dot', dot_axes=1)
out = Sequential()
out.add(dotted)
sgd = SGD(lr=0.1, decay=1e-6, momentum=0.9, nesterov=True)
out.compile(loss='mse', optimizer=sgd, metrics=['accuracy'])
___________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
====================================================================================================
dense_1 (Dense) (None, 4) 36 dense_input_1[0][0]
____________________________________________________________________________________________________
activation_1 (Activation) (None, 4) 0 dense_1[0][0]
____________________________________________________________________________________________________
dense_2 (Dense) (None, 4) 20 activation_1[0][0]
____________________________________________________________________________________________________
activation_2 (Activation) (None, 4) 0 dense_2[0][0]
____________________________________________________________________________________________________
dense_3 (Dense) (None, 4) 20 activation_2[0][0]
====================================================================================================
Total params: 76
____________________________________________________________________________________________________
____________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
====================================================================================================
dense_4 (Dense) (None, 4) 20 dense_input_2[0][0]
====================================================================================================
Total params: 20
____________________________________________________________________________________________________
print type(i_train)
print type(i_train[0])
print type(i_train[0][0])
print type(i_train[0][1])
print len(i_train)
print len(i_train[0])
print len(i_train[0][0])
print len(i_train[0][1])
print len(i_train[1])
print i_train[0][0].shape
# out.fit(i_train, o_train, batch_size='128', verbose=1)
<type 'list'>
<type 'list'>
<type 'numpy.ndarray'>
<type 'numpy.ndarray'>
2144970
2
8
4
2
(8L,)
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/899a8d4a-f5ca-4108-8c94-104a97ac2279%40googlegroups.com.