#NEWLINE# def test_prob_words( ) : #NEWLINE# #INDENT# context = np . random . randn ( 3 ) #NEWLINE# vocab = np . random . randn ( 10 , 3 ) #NEWLINE# lo = topics . prob_words ( context , vocab , temperature = 1 ) #NEWLINE# hi = topics . prob_words ( context , vocab , temperature = 1000000.0 ) #NEWLINE# msg = 'Lower temperatures should be lower entropy and more concentrated' #NEWLINE# assert ( exp_entropy ( np . log ( lo ) ) < exp_entropy ( np . log ( hi ) ) ) , msg