  We train artificial neural networks to distinguish the geometric phases of a
set of bands in 1D photonic crystals. We find that the trained network yields
remarkably accurate predictions of the topological phases for 1D photonic
crystals, even for the geometric and material parameters that are outside of
the range of the trained dataset. Another remarkable capability of the trained
network is to predict the boundary of topological transition in the parameter
space, where a large portion of trained data in the vicinity of that boundary
is excluded purposely. The results indicate that the network indeed learns the
very essence of the structure of Maxwell's equations, and has the ability of
predicting the topological invariants beyond the range of the training dataset.
