Gamma-hadron discrimination in extensive air showers using a neural network