Implementation of restricted boltzmann machine