Supervised and unsupervised learning of directed percolation.