Added rbm.train()

Optional valid_patterns and test_patterns