Neural networks and the separation of cosmic microwave background and astrophysical signals in sky maps