Reinforcement learning for spin torque oscillator tasks