It is difficult to give a robot all possible motions beforehand in a certain environment. Therefore, the robot needs to learn how to recognize others' motions and to generate its own motions autonomously for working well. These learning algorithms need an efficient way to make recognition and generation of motions work together, because they take many computing resources. This paper focuses on a generation-based recognition. Our system consists of recognition and generation modules. The former and latter are constructed from lefl-to-right Hidden Markov Models (HMM) and Reinforcement Learning (RL), respectively. When a HMM in recognition module does not work enough, the model parameters of HMM are re-estimated by using a state-value function of RL in generation module. The proposed method enables us to improve the reliability of the HMM.