Thank you very much, now I get comparable results (6 seconds both with PyTorch and Keras for 100 epochs). So the problem was just my misunderstanding of batch_size’s meaning. I read some articles found on the web that are not clear about it and some of them are wrong!