Implement all functions in RBM.
Fine-tune example.