Identifying topology of leaky photonic lattices with machine learning