Image Captioning Based on a Hierarchical Attention Mechanism and Policy Gradient Optimization