How militaries are using artificial intelligence on and off the battlefield