I have created an encoder-decoder model with pre-trained 100D glove embedding, to create an abstractive text summarizer. The data set has 4300
article, its summary data. Vocabulary size is 48549
for articles and 19130
for summary. Total memory size of input, output variables = 7.5Gb
Following is the basic encoder-decoder model:
latent_dim = 1024
encoder_inputs = Input(shape=(max_x_len,))
emb1 = Embedding(len(x_voc), 100, weights=[x_voc], trainable = False)(encoder_inputs)
encoder = LSTM(latent_dim, return_state=True)
encoder_outputs, state_h, state_c = encoder(emb1)
decoder_inputs = Input(shape=(None,))
emb2 = Embedding(len(y_voc), 100, weights=[y_voc], trainable = False)(decoder_inputs)
decoder_lstm = LSTM(latent_dim, return_sequences=True, return_state=True)
decoder_outputs0, _, _ = decoder_lstm(emb2, initial_state=[state_h, state_c])
decoder_dense = Dense(len(y_voc), activation='softmax')
decoder_outputs = decoder_dense(decoder_outputs0)
model = Model([encoder_inputs, decoder_inputs], decoder_outputs)
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
When I train on whole data the spyder consumes 99% of the memory and system stops.
My System configuration are as follows:
OS - windows 10 (64-bit)
Ram - 8Gb
Processor - Intel(R) Core(TM) i5-3470
ROM - 300Gb
Further I want to -
- Add more data and layers to the model
- Add attention layer
- Implement Bert
Kindly suggest a solution or an suitable system configuration.