Modeling Time-Varying Networks with Applications to Neural Flow and Genetic Regulation