The accurate identification of Non-line of Sight (NLOS) propagation is an important premise to ensure the positioning accuracy in UWB indoor positioning system. In this paper, a network which takes the channel impulse response (CIR) as the input and combines the temporal convolutional network (TCN) and attention mechanism is proposed to identify the NLOS propagation. Based on the framework, particle swarm optimization (PSO) algorithm is used to select the key parameters of the network to achieve higher accuracy and faster process speed. Experiments on the open source dataset show that the identification accuracy of the network reaches 89.80%, which is better than the existing mainstream long short-term memory neural network. The proposed network is further improved by using six extra characteristics and its validation accuracy can reach 91.08% with a relatively high convergence rate. Also, the accuracy and computational amount of the network can be balanced by adjustment of CIR length according to the needs in practical application, indicating that the network has a good application prospect.