A neural data-driven algorithm for smart sampling in wireless sensor networks