Indirect Training Algorithms for Spiking Neural Networks based on Spiking Timing Dependent Plasticity and Their Applications