Specifically, provide a simple example, including code for sampling, as well as simple code examples for training and validation.