Multi-Layer Perceptron Neural Networks (MLP NNs) are the commonly used NNs for target classification. They purposes not only in simulated environments, but also in actual situations. Training such NNs has significant importance in a way that many researchers have been attracted to this field recently. Conventional gradient descent and recursive method has long been used to train NNs. Improper classification accuracy, slow convergence speed and trapping in local minimums are disadvantages of the traditional methods. In order to overcome these issues, in recent years heuristic and meta-heuristic algorithms are widely used. This paper uses Gray Wolf Optimization (GWO) algorithm for training the NN. This algorithm is inspired by lifestyle and hunting method of GWs. GWO has a superior ability to solve the high-dimension problems, so we try to classify the Sonar dataset using this algorithm. To test the proposed method, this algorithm is compared to Particle Swarm Optimization (PSO) algorithm, Gravitational Search Algorithm (GSA) and the hybrid algorithm (i.e. PSOGSA) using three sets of data. Measured metrics are convergence speed, the possibility of trapping in local minimum and classification accuracy. The results show that the proposed algorithm in most cases provides better or comparable performance compared to the other mentioned algorithms.