Application of a stochastic representation in numerical studies of the relaxation from a metastable state