x = training_set_scaled
x = x.reshape(-1,1,12)
y = lab.to_numpy()
y = y.reshape(-1,1)
print(x)
print(y)
##(1127, 1,12)
##(1127, 1)
model = Sequential()
model.add(LSTM(units=128,activation='relu',return_sequences=True,
input_shape=(1,12)))
#model.add(Dropout(0.1))
model.add(LSTM(units = 128,activation='relu'))
#model.add(Dropout(0.1))
model.add(Dense(100,activation='relu'))
#model.add(Dropout(0.1))
model.add(Dense(1,activation='softmax'))
opt = tf.keras.optimizers.Adam(lr=1e-3,decay=1e-5)
model.compile(loss='binary_crossentropy',optimizer=opt,metrics=['accuracy'])
print(model.summary())
model.fit(x,y,batch_size=10,epochs=20,verbose=2)
// this is my code but Epoch 1/20 113/113 - 0s - loss: 7.8614 - accuracy: 0.4845 why it is running on only 113 samples
i am trying to build RNN using keras. n.o samples is 1127 and 12 variables in each. output is simple 0 or 1 but when i run the model it runs on only 113 samples. can someone please help me. im stuck here for 3 days thanl you
It is not running on 113 samples, it is running on '113 mini batches' of size 10 each.
model.fit(x,y,batch_size=10,epochs=20,verbose=2)
here you have specified the batch size as 10, hence it trains the model using 10 samples 113 times aka 10*113 = 1130 total samples. (it trains the last mini batch on 7 only since those are the only ones left)