OpenNMT Forum

Problem with training and validation accuracy

Hello there,
I had processed my data with this command
**

!onmt_preprocess -train_src data/train.src.txt -train_tgt data/train.tgt.txt -valid_src data/valid.src.txt -valid_tgt data/valid.tgt.txt -src_vocab_size 400191 -tgt_vocab_size 62423 -src_words_min_frequency 2 -tgt_words_min_frequency 2 -src_seq_length 200 -tgt_seq_length 30 -save_data data/data -overwrite

**

after that I Trained the model with this command :

**

!onmt_train -batch_size 128 -accum_count 3 -report_every 100 -world_size 1 -gpu_ranks 0 -layers 2 -train_steps 37110 -save_checkpoint_steps 5000 -valid_batch_size 64 -valid_steps 500 -rnn_size 512 -data data/data -pre_word_vecs_enc “data/embeddings.enc.pt” -pre_word_vecs_dec “data/embeddings.dec.pt” -src_word_vec_size 224 -tgt_word_vec_size 336 -fix_word_vecs_enc -fix_word_vecs_dec -save_model data/my_model -encoder_type rnn -decoder_type rnn -rnn_type GRU -tensorboard -optim adam -adam_beta2 0.998 -learning_rate 0.001

**

-> the training accuracy of the first 1000 step , training accuracy quickly increased from 16.0 to 33 after that slowly increased up to 48 and validation accuracy decease slowly and become 32.2196
the model result becomes: BLEU = 10.53, 41.0/21.8/15.7/13.5 (BP=0.505, ratio=0.594, hyp_len=188961, ref_len=318165)

How can I solve this problem and prevent this overfitting and how can I choose loss function?
thanks