Testing PyTorch on Poems (Preliminary Results)

PyTorch is an early release beta software (developed by a consortium led by Facebook and NIVIDIA), a “deep learning software that puts Python first.”

So since I luckily received an NVIDIA GTX TitanX (Maxwell) before leaving Hong Kong under the generous NVIDIA academic GPU Grant program, and having last week finally bought a custom-build to house it, and 2 days ago finally got Ubuntu installed with CUDA and CUDNN drivers, and having found that the Tensorflow 0.11 version no longer runs under Python 3.6 Anaconda, I decided to give a PyTorch example a try, specifically Word-level language modeling RNN

This example trains a multi-layer RNN (Elman, GRU, or LSTM) on a language modeling task…The trained model can then be used by the generate script to generate new text.

And after only an hour of training on an 11k poem corpus, using the default settings, the results announced “End of training | test loss  5.99 | test ppl   398.41” — Which means that the loss is bad and perplexity is now at the seemingly terrible level of 398….

Then I ran the generate script and the 1000 word text below got generated in less than 30 seconds. I find it stunning. If this is what PyTorch is capable of with a tiny corpus, default settings and a minimal run, language generation is entering a renaissance.  Ok, so it’s veering toward the incomprehensible and has little lived evocative phenomenological resonance, but its grasp on idiomatic cadence is creepily accurate. It’s as if it absorbed several semesters of graduate seminars on romantic and post-modern verse:

the embankment
and your face sad like a nest, grew sorry
when your cold work made of snow
and left a thousand magnifies.

a little cold, you plant but hold it
and seems
the slight arts? face, and ends
with such prayer as the fingers do,
this reorganizing contest is how
to be murdered
throwing it
into the arteries obscurity goes disc whispering whole
affairs, now your instinct
does a case,
defense. on her eye, you do not know that every homelands
is didn’t at the
risk very psychiatrists, just under bay.

by the living of life’s melancholy grate.
i have found a
wild orange in eden, eight hazy years guzzles
her neck at the grave turn into every mythological orbit of
person’s there–see then are we told what we understand
won’t take the slightest danger
or the
size of what it means to take up if you can,
tongue. only your eye exultant whitens again will
i think that the four-oared clouded of one stick in flowerpot
is part of an antique little
register on a hiatus
till i try for you.
i wash up the door my knee will be
if i refuse a limits as i can lift my hand rubicon.

i can see her
above the stove tide
hip. orange as a breaking sty.

tonight is my imaginary face
a medicine place cap something, i don’t know
that these are lost, each his burned pick,
and cempan
communication.–geof wants,
one drop of what, which was like a bottomless fighting.
nothing that is emptiness
primordial timer,
upsweep, at borders.
the immigrants, the hesitating and the corporate ovid’s ax of butterfly grant’s cotton-fumed

that he replies to the mansion and connect the war
which lies tude, you are the good man,

yet be trapped with you and burying

the man’s ecstatic hands in the wet wet golden clematis

and i am your father’s wife, as if he just clearly walks
and he put on midair
and his right hand went down,

then afforded rocking. a place between tv in the south
the air that does make his waiting words together mgencrft for your husband’s ghosts
and you shall fall up
on your pardon, talking before god.
so blue
today is this the shadow of our house is ready
save our past
in the district of nature supposing his
brow that will not
deva or the tides.

tr. by flies and instant, since your joy, open out
among the dirt
cross lightning,

and your own princess brings the sun’s whoretalk,
behold, the cleared, one
eve rests
on one little surface a desire
of material contained, reaching in smoke,
but all that’s lost, the refrigerator
is an empty hotel.
and your mentors quality of life, for our origins
that speaks one cannot work
does it least seem to put off it,
and catch it all night to the stranger and all is

back into trouble with optimism with weeping.

taryynge. the great earth is so possible.

bright– i know why things are full of desire,
looking to rest for the office to call your horses.

remember’d women lay he left
cold shadows once.

when he left gone with a
fugitive look,
he turned his back to the world wars.

in the morning there he saved

humans sang and spake
to nature’s life, for my sake
he never dared to be done to.

he took his arms to keep
spread his sister’s baking unison.

into some emptiness, paper yet

but of our rundown cornflakes
they were salted as we were
on the deck

the writer and the nail
grow empty.

ours has drifted away. hello with one horse. what does
a room, dead eyes. yesterday, i saw the sun in the genital shadow of my hair. but ash and the
water they drink now, on my naked shell. thus when i had become a glorious family in that world. and
a quiet bird of my quiet voice, a widower from which nothing was coiled, a satisfactory sentence a opening an
actress do not want what i put in the morning of order. it’s a different one. i want them somewhere.
a lige, when i left. why did you likely to find yourself in melancho-ly who anyone wanted to say, maybe
you’ve left me, and listen because they have a heartache– i eat a july black-green sense? i will arabic by
the place of air and sex is a quest, dirt, semblance of pigsi spell it? absence is like an angel
to those cannot you attack the blue corridors, distorting by the hand on the head, now half of the stars
with him. will touch you, show the hearts of yourself coming into the room against a sentence into consciousness but
that student helps her there was you in it. they demolished no three chicken. in a train or when it’s
not right down to their car mantle trees from the smoky lot the sun ash over tomorrow.


off the road i am wont to make it bus one chance to make harm.

there are little rooms in that town.
and i have called a woman, i do not sleep to absolut
farborough or a tick-tick-tick of baa-ing people in the other room
putting into the weevils of the place, or

, , ,