generative deep learning probability of sampling element higher temperatures result in sampling distributions of higher entropy that will generate more surprising and unstructured generated datawhereas lower temperature will result in less randomness and much more predictable generated data (see figure temperature temperature temperature temperature temperature discrete elements (characterstemperature figure different reweight ings of one probability dist ribut ion low temperature more deterministichigh emperat ure more random implementing character-level lstm text generation let' put these ideas into practice in keras implementation the first thing you need is lot of text data that you can use to learn language model you can use any sufficiently large text file or set of text files--wikipediathe lord of the ringsand so on in this exampleyou'll use some of the writings of nietzschethe late-nineteenth century german philosopher (translated into englishthe language model you'll learn will thus be specifically model of nietzsche' writing style and topics of choicerather than more generic model of the english language preparing the data let' start by downloading the corpus and converting it to lowercase listing downloading and parsing he init ial ext file import keras import numpy as np path keras utils get_file'nietzsche txt'origin='text open(pathread(lower(print('corpus length:'len(text)licensed to