Deep learning approach to genome of two-dimensional materials with flat electronic bands