Hardware implementation of re-configurable Restricted Boltzmann Machines for image recognition