Neural network ansatz for periodic wave functions and the homogeneous electron gas | Synapse