Fast code to learn deep belief networks in R.