<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Tensorflow on mapletree.moe</title><link>https://mapletree.moe/tags/tensorflow/</link><description>Recent content in Tensorflow on mapletree.moe</description><generator>Hugo -- 0.160.1</generator><language>en-us</language><copyright>This work is licensed under the MIT0 License.</copyright><lastBuildDate>Sun, 21 Oct 2018 16:00:00 -0600</lastBuildDate><atom:link href="https://mapletree.moe/tags/tensorflow/index.xml" rel="self" type="application/rss+xml"/><item><title>A Gift for a Friend's Den</title><link>https://mapletree.moe/posts/a-gift-for-a-friends-den/</link><pubDate>Sun, 21 Oct 2018 16:00:00 -0600</pubDate><author>bakayuki</author><guid>https://mapletree.moe/posts/a-gift-for-a-friends-den/</guid><description>&amp;lt;no value&amp;gt;</description><content type="text/html" mode="escaped"><![CDATA[<p><strong>EDIT (2026/04/25):</strong> <em>This project was done long before current LLMs and the
animosity around them. It was also all compiled locally, and everything was
open source. For various reasons, this project is no longer available in source
form.</em></p>
<p>Once again it has been quite a while since I updated this blog. Strangely, the
last time it happened was also in October. There must be something in the air
around this time of year. Like cold. There&rsquo;s cold in the air.</p>
<p>Anyways this post is due to a gift I am working on for <a href="https://twitter.com/urbanfriendden" title="Ruben's Twitter Timeline">UrbanFriendDen</a>, aka
Ruben. While I don&rsquo;t talk to Ruben often, he is an absurdly talented writer and
all around Good Dude(TM). He <a href="https://twitter.com/urbanfriendden/status/1054101745134194688" title="Birthday Tweet!">recently tweeted</a> that tomorrow is his
birthday. Technically, he asked people to overthrow the American Imperialist
Regime, but I am very tired and still in bed at 4PM, so I proposed something a
little different.</p>
<p>The following blog post will detail two separate projects, one of which Ruben
already knows about and the other he does not. In the first project, we will
create a corpus of his <a href="https://www.thefriendden.net/2016/10/20/the-adventures-of-dick-hardboiled-in-neo-noir-dark-noir-city/" title="Dick Hardboiled Series">DICKHARDBOILED Series</a> and the
<a href="https://www.gutenberg.org/cache/epub/61/pg61.txt" title="Project Gutenberg's Copy of the Communist Manifesto">Communist Manifesto</a>. We will then train a <a href="https://en.wikipedia.org/wiki/TensorFlow" title="TensorFlow Wikipedia Page">TensorFlow</a> network on this
corpus following the <a href="https://minimaxir.com/2018/05/text-neural-networks/" title="How to Quickly Train a Text-Generating Neural Network for Free">wonderful article</a> written by Max Woolf. While I would
normally like to roll my own network, that takes an absurd amount of time and
Ruben&rsquo;s birthday is tomorrow.</p>
<p>In the second project, we will using the same training guide as used for project
one. The difference is that we will first be scraping Ruben&rsquo;s [wordpress site]
and downloading all of his writings. Once done, they will be assembled into a
corpus which the network will be trained on. We should end up with an
interesting little network that sounds quite a bit like his fantastic writing
style.</p>
<p>As a side note in which I gush, I&rsquo;m such a huge fan of Ruben that I&rsquo;ve planned
on commissioning him to write corpus texts to train another neural network I&rsquo;m
building as a hobby. If anyone reading this remembers the original version of
Seara, a sassy little helper robot/chat bot that did moderation on the Collegi
Pixelmon server, this would be version 2.0 of her. Her new model will have a
generative text backend that responds when her retrieval model doesn&rsquo;t have
a programmed solution, but to do so it requires a LOT of text. I&rsquo;m hoping to be
able to commission Ruben to write me text in her voice. I reached out to him
once before, but alas, money is tight, and artists should always be compensated.</p>
<p>Anyways, off we go to work.</p>
<h1 id="important-considerations">Important Considerations<a href="#important-considerations" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<p>While all of my writing is available under CC0/Public Domain (See the &ldquo;No Rights
Reserved&rdquo; link in the sidebar), Ruben&rsquo;s writing remains HIS OWN. Nothing in this
article should be construed as sub-licensing his work or making it available in
the public domain. I have asked for permission to release the training data,
but even if the data is released it still remains his intellectual property.
Don&rsquo;t be an ass, credit artists for their work.</p>
<h1 id="additional-update">Additional Update<a href="#additional-update" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<p>While I was writing this, Ruben granted permission for me to upload the data
sets so that they are publicly available. I will be posting the link to the
github repository once I&rsquo;ve finished this article. These files are made
available with permission from Ruben. If you attempt to use them to produce
any derivative works that you intend to publish, please contact him before
doing so. He&rsquo;s fairly chill, but again this is his intellectual property.</p>
<h1 id="project-one---workers-of-neo-noir-dark-noir-city-unite">Project One - Workers of Neo Noir Dark Noir City&hellip; UNITE<a href="#project-one---workers-of-neo-noir-dark-noir-city-unite" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<p>This one is actually fairly simple for us to get started on. I created a new
directory inside my development workspace named &ldquo;Ruben_Present&rdquo;, and opened
that up inside the <a href="https://atom.io" title="Atom.io Home">Atom</a> editor. Once I had defined it as a project
directory, I created a subdirectory named &ldquo;Project_1.&rdquo;</p>
<p>Then I copied all of the text from Project Gutenberg&rsquo;s copy of the Communist
Manifesto that was linked to above and saved it to &ldquo;manifesto.txt.&rdquo; Once done,
we just had to go through and remove extraneous information. Everything inside
the file will be used to train the neural network, and it is incapable of
distinguishing between headers, sub-headers, or body text. Since we write
headers differently, they need to go. Formatting doesn&rsquo;t honestly matter.</p>
<p>During that stage I also updated anything the spellchecker flagged to modern
day spelling. Part of training a neural network is related to vectorization,
and different spellings of the same word would be treated as different words,
introducing unneeded complexity into the model. If there was no equivalent word,
I left it alone.</p>
<p>After doing this, I took a look at the total size of manifesto.txt. We had a
72KB file, which meant that I would need at least 72KB of Ruben&rsquo;s writing to
be able to cross balance the two.</p>
<p>First I pulled down the <a href="https://www.thefriendden.net/2016/10/20/the-adventures-of-dick-hardboiled-in-neo-noir-dark-noir-city/" title="Dick Hardboiled Series">original story</a>. I applied the same process that
was applied to the manifesto, checking for text marked by the spell checker,
removing extraneous formatting (legs woman&rsquo;s atypical font, for example), and
reducing everything to 80 characters per line. (I feel it is worth noting that
during this process I attempted to smoke two vaporizers simultaneously &ndash; it
seemed appropriate for the subject matter &ndash; but my significant other frowned at
me until I went back to just a single one. I still made sure that smoke was
leaving my face at the maximum possible velocity. It&rsquo;s worth noting that I
choked at &ldquo;inject an epi-pen of smoke directly into my lungs.&rdquo; I really need
to quit.)</p>
<p>After processing the original story, I took a look at the file size. We only
had 10KB of data versus the 72KB of the manifesto. Luckily, Ruben has written
more than one story for Mr. Hardboiled. Puffing furiously on my nicotine
delivery device, Noir-inspired inspiration inspired me. I smoked the&ndash; sorry,
I added the additional stories. You can find <a href="https://www.thefriendden.net/2015/11/07/dick-hardboiled-and-the-meaning-of-love/" title="Dick Hardboiled and the Meaning of Love">the first additional story
here</a>. The second one is <a href="https://www.thefriendden.net/2015/12/19/dick-hardboiled-has-an-off-day/" title="Dick Hardboiled has an off day">located here</a>.</p>
<p>After working on this, I once again checked our total data quantity. We had
22KB of Dick Hardboiled. 50KB short of what we would need to have a
semi-balanced model. I spent a long time thinking about what to do. I could
scrape some of Ruben&rsquo;s other writing, but that would infringe on surprise number
two. I decided that I would scrape Ruben&rsquo;s twitter and put a piece of himself
into the engine. The easiest way it seemed to do this was a python library
called <a href="https://github.com/kennethreitz/twitter-scraper" title="Twitter Scraper">twitter-scraper</a>. So I needed to create a throwaway python
environment, install twitter scraper, and then pull down as many of Ruben&rsquo;s
tweets as I could. This is somewhat of a process so you can watch an ASCIInema
of the process below. Remember, you can directly copy from this playing video
if you wanted to do this yourself. You can find my comments in the video stream.</p>
<p>This is about a 12 minute video, and isn&rsquo;t really needed unless you want to see
how I obtained the twitter data.</p>
<p><a href="https://asciinema.org/a/gpQn8si0ctr59fqrtWTKkbz9j"><img src="https://asciinema.org/a/gpQn8si0ctr59fqrtWTKkbz9j.png" alt="asciicast"></a></p>
<p>The initial scrape yielded approximately 57KB of data. So I got to be a bit
selective with what I kept. I spent a period of time processing the tweets by
hand according to the same rules as listed above.</p>
<p>While doing this however, I realized that I also had scraped retweets. Part of
the idea in doing this was to ensure that Ruben&rsquo;s voice would stay at the for
front. Also, you can tell this article was a stream of work from beginning to
end and I am so sorry. Anyways, after looking at the data I had collected,
I decided to pull down some additional stories from Ruben&rsquo;s website to get to
the amount of data I needed. I discarded the twitter scrape.</p>
<p>The most appropriate story to scrape to flesh out the data requirement was
&ldquo;A Cyber Punk.&rdquo; To ensure hardboiled wouldn&rsquo;t be drowned out, I duplicated the
text twice within the hardboiled file. This may come back to bite me. The end
result is that I needed approximately 30KB.</p>
<p>I ended up pulling down parts 1-6 to get a sufficient quantity of data. I then
began the process of formatting the text to 80 characters per line, correcting
any spelling &ldquo;mistakes&rdquo; and generally removing extraneous formatting. Around
this time I decided I would actually end up making two models for this first
project.</p>
<p>The first model will be JUST the manifesto and Hardboiled, which will lead to
a&hellip; neo-noir inspired Karl Marx, and the second will be the manifesto with
hardboiled and A Cyberpunk. This should give us half/half karl marx and Ruben.</p>
<p>Both models will be made available and I will post the resulting 1000 words from
each model in this article.</p>
<p>I&rsquo;m also out of nicotine at this point. My blood is more blood than nicotine.</p>
<p>It&rsquo;s fuckin terrible.</p>
<p>(As a fun side note, I&rsquo;m processing the text as I write this, which means this
article also has a bizarre number of stream of consciousness interactions. One
neat thing I&rsquo;ve noticed is Ruben&rsquo;s texts lend well to division by 80 Characters.
This implies that he frequently writes with words that are a factor of 80. Neat!
)</p>
<p>When the github repository goes live you will be able to find the raw files used
to assemble the corpus under Project_1/Raw-Data. They are labeled text files
according to their contents.</p>
<p>Now that we have all the needed plain text, it&rsquo;s time to assemble them.
Corpus-1.txt contains the Communist Manifesto and Dick Hardboiled. Corpus-2
contains the Communist Manifesto, Dick Hardboiled, and A Cyber Punk.</p>
<p>Now that we have the assembled data, we just need to follow the directions
in the <a href="https://minimaxir.com/2018/05/text-neural-networks/" title="How to Quickly Train a Text-Generating Neural Network for Free">aforementioned article</a> to generate our network. The reason we are
using that notebook is because it gives us access to free compute power that
will dramatically speed up the learning process. It isn&rsquo;t as cool as doing it
by hand, but time is getting away from me, and having access to google&rsquo;s servers
for free is pretty chill.</p>
<p>I ran corpus 1 over 10 epochs. Took approximately 15 minutes to fully execute.</p>
<p>The dataset is so small that the system needs longer to learn. The following
output shows the process with only 10 epochs of iteration.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-txt" data-lang="txt"><span class="line"><span class="cl">Training new model w/ 4-layer, 128-cell Bidirectional LSTMs
</span></span><span class="line"><span class="cl">Training on 91,072 character sequences.
</span></span><span class="line"><span class="cl">Epoch 1/10
</span></span><span class="line"><span class="cl">88/88 [==============================] - 34s 389ms/step - loss: 3.6865
</span></span><span class="line"><span class="cl">Epoch 2/10
</span></span><span class="line"><span class="cl">88/88 [==============================] - 31s 355ms/step - loss: 2.5044
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 0.2
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">e the of the the at ont the the the the the the the the that the the the the the ant the the the the the the the the an the the tit the the ant the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the allint the t
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">he ant the atist the ther the tit at the the the the the the the the that the the the the the the ond the the the the an the the the the the the the the the the the inge the thes the the the the the the the the the and the the the the the the ant the the the the the the the the ant ant the the the t
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">he the the to the the the the the at the the the at the the the the the the that the the an the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the the at the the the alle the the the the the
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 0.5
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">r tande the praly ont to tha tre anses atse taint at the the at ins the ang tit the alet tinge therre theat the at the of
</span></span><span class="line"><span class="cl">ride ter pere ind tians thetterat pe iret there annt ant an tilouritis the ond thee theast tit the ante hal thatt tite to the the thationt pret, atitinge iteve dorectit thes
</span></span><span class="line"><span class="cl">cess
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">thers ato tourer the toant the antiald the ang the tas the ang inge, catralationt ses all ont the the letet to the tuerte the tater itare ant at thiond I an stes thed indetins the thes the thed the and al thes acaren theres ind the te then thitast the the a anta the re on the
</span></span><span class="line"><span class="cl">cke tar of the ter al t
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">end to pe ingentis the theins ther pent thestitint as issit alllind and thexat the the thet the the ant ant at thete erorin ta ofr tallse ithe the tint ant atiallind thet ants, allen the the to of the theeis thin thess thary the is the ancet an pay te the then mis fate olind tourind thel the thed as
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 1.0
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">a.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">betess dete an ta. I of loto te Saved,, The iny ono tiousge
</span></span><span class="line"><span class="cl">Acet mt moweve
</span></span><span class="line"><span class="cl">I lI is tiherlpet BeLtay, onctly batitysmpemdt kut, da Fre thalt ta buls larisstam staliase rins sothestin the cheith itimet,
</span></span><span class="line"><span class="cl"> do featialyin ancer the eptl plaoclouty fo aiteieboc she. Siis
</span></span><span class="line"><span class="cl">ank.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">I trours tthe aboumawatl
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">nd toe ive of
</span></span><span class="line"><span class="cl">ctm
</span></span><span class="line"><span class="cl">“Wes, oftian atamel, iy PI mut die, ar sad.
</span></span><span class="line"><span class="cl">It this couleicol wie tarinten
</span></span><span class="line"><span class="cl">bomabulawa tra piitio pan tareroftisttt I tret sithienk
</span></span><span class="line"><span class="cl">Ivase
</span></span><span class="line"><span class="cl">ant
</span></span><span class="line"><span class="cl">vurs I IxEcjushat as. mole
</span></span><span class="line"><span class="cl">tid atane las se thancitind, tho caporinnskin worre.
</span></span><span class="line"><span class="cl">plabed grery ther iomat at oveang an.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">ketres ave I Thied ap
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Hen mtory anticogeied, ad, ediss tecitho ithereby tis
</span></span><span class="line"><span class="cl">buto
</span></span><span class="line"><span class="cl">Belkenst alte ties aiy ste ase timy, mtatehemingighe, mes, there way,
</span></span><span class="line"><span class="cl">ither thiss.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">coont cand ito e, twy groas.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">eda iewpter,
</span></span><span class="line"><span class="cl">antal ic tf t.
</span></span><span class="line"><span class="cl"> lied med, talariont,
</span></span><span class="line"><span class="cl">rs.
</span></span><span class="line"><span class="cl"> mtat sas tadse
</span></span><span class="line"><span class="cl">The Yarre cte semptoropahat ialptotse, to spaprans… wacay
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Epoch 3/10
</span></span><span class="line"><span class="cl">88/88 [==============================] - 31s 355ms/step - loss: 2.3817
</span></span><span class="line"><span class="cl">Epoch 4/10
</span></span><span class="line"><span class="cl">88/88 [==============================] - 31s 353ms/step - loss: 2.2756
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 0.2
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">he the the the the the the the the the and an and an and an and the and and an the the an the the and and and and an the the the the an and the the the the the the the the the and an the the the an the the the and an the an an the the the the the the the the the the the the the the the the the the a
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">e the the the an and and the an the the the the the the the the of the soce and an the the the the an the and the the the and and an the the the the the the the the the the the the the the and the the an the the the the the the and an the the the the the the the the the the the al the the and and an
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">of the and the the the the the the and and and an and al and the the an the the of an an the an of the and and the an the the an the the the the the the the the the al an the the an an the the the the the the and an and the and an the and an an the the the the the the the the the the the the the the
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 0.5
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">he in the and than polly and at on and an ang of the of an the thing manercall an pan an cond ad laris ald the of we the the the of the the con in the an the the the the an the the the and to an the socend the beve the the and in and the an the the the ape se the of ach and the the the the the is ay
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">on fin cans and and as sitry the an as of an of to the the trall the an and the cond at the and thit the, the the the far of as to abore an sed the as to popectan at abere to the an the the the so pen the to and ind of al of socing and an the ferty and all e of the the the the in an the antent ond f
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">ith the the an the in and in an the hang ant an to ande cand sontion acand in, the of al the ond the fin the ind the che an the the nes the the pre in and and and and all to the an alivermas ant efran aban of the the
</span></span><span class="line"><span class="cl">ans the land al the in ton of of the of and bolly cant and to and an the coris inte
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 1.0
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">at a ince, aspon of cllitlal
</span></span><span class="line"><span class="cl">I sen, the shatarsiasis, halin, itth berer, ducles nom.”
</span></span><span class="line"><span class="cl">The fmads yo mewarily kinty an ond of peraterif henst worevisoss aldakel ior acs, ith kurgel opronge, on ag
</span></span><span class="line"><span class="cl">the eprnif to an fatke poud the farissir collith-reain: sretacats ow she th Gerle
</span></span><span class="line"><span class="cl">be any thanis alf crangh
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">rer. I rusap, aby a and banod foverrey wich ind wont me boled waby a inditicte bolf by giations ghaprpiticaser siltian as the the ad a tais of land on reut athes and gugne a them inucthendonng love yats, ton th is forked.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">I ta the wie the ebome sorg of lory ftoicim and ectage.  Onuiss the ton er vu
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">cas ond batie, an so os and liciablery
</span></span><span class="line"><span class="cl">ccicit ad ave th at’, and uved inkent smpeceve ughe whe fis don tat er thate ant sud efforestisingion, axpest lans fordetals
</span></span><span class="line"><span class="cl">anme.
</span></span><span class="line"><span class="cl">Th’n fin, tot diss ofmbald the an e and dis becoreryials a lagiat, them
</span></span><span class="line"><span class="cl">cacey the ROiof ous a on feby, pnath Nin th goen exsht of
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Epoch 5/10
</span></span><span class="line"><span class="cl">88/88 [==============================] - 31s 355ms/step - loss: 2.1740
</span></span><span class="line"><span class="cl">Epoch 6/10
</span></span><span class="line"><span class="cl">88/88 [==============================] - 31s 353ms/step - loss: 2.0598
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 0.2
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">ll of the propertions of the bourgeoising of the proletered of the bourgeoisingeoising and are and in the bourgeoisingeoising of the prolered and and and of the prolered of the condionged of the prolertare and and and and and of the proletaricall and and of the sociation it of the bourgeoising of th
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">all and and the bourgeoising of the socially of the prolered and of the proletaricall and of the bourgeoising and and and and of the bourgeoising of the ware and social and and and the proletarial of the and and and the proletaries of the the conding and and the berection, of the proletaricall of th
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">e bourgeoising of the proletaricall the proletered of the bourgeoisingeoising of the bourgeoising and of and of the condere at of the bere of the contered and of the prolere and the sociall of the proletaricall of and and of the conderers and of the the prolentaring the conding of the proletaricall
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 0.5
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">iatingsicall
</span></span><span class="line"><span class="cl">the nenther of the poluctioningeoiss.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">The pracentry of the
</span></span><span class="line"><span class="cl">goling the leargeois of the countion the momeral all
</span></span><span class="line"><span class="cl">condernote of the nasertensens and and are as the socation.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">The and age itsence of and courgeoisically of
</span></span><span class="line"><span class="cl">the condernolition the of
</span></span><span class="line"><span class="cl">mourgeoisingeoises of the
</span></span><span class="line"><span class="cl">recainers the t
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">.  The prole, the condif lether the and the prerentorer the proletenticall the co manderaction
</span></span><span class="line"><span class="cl">con and contered the socout of that beresetion in the and to ginto the bourgeoisinalially for at and in that the seace at bourgeoisition to and bere proletaly
</span></span><span class="line"><span class="cl">con ragen pourgeoisition in the clation
</span></span><span class="line"><span class="cl">gelath
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">d an sepistorial the ine on of the the ine in to mourgeoising cand the contung apreroped and mourgeoising the the andernere arestions abourgeois of meacentungeoision, a sule of bertorgeoisie. I prole the more safling the caring of approlopre at of and compilartion.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">The bourgeoinition
</span></span><span class="line"><span class="cl">the and with a
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 1.0
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">er conder of
</span></span><span class="line"><span class="cl">graigion
</span></span><span class="line"><span class="cl">sindo iar for ougllly. Thithe listlizatall.  Thoudsh DAllllg
</span></span><span class="line"><span class="cl">nanke courne ce retill atser. It I in forgatings to
</span></span><span class="line"><span class="cl">than furnerich-poivaingel, vasist ackeander.  Freack abardeing igneave to
</span></span><span class="line"><span class="cl">acher mase of
</span></span><span class="line"><span class="cl">a
</span></span><span class="line"><span class="cl">moverc of
</span></span><span class="line"><span class="cl">thee orelve, fin marecoret. Ind eay’t I’maef
</span></span><span class="line"><span class="cl">a efrae the a yolved
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">onating wintsh pures the prolever themed pre an owst engaved curadecten. I fore ay letachiated of ital the free loithar.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">“rominat, da deck!”
</span></span><span class="line"><span class="cl">Incosetion&#34; of by reegent gera weremominioust reeader.
</span></span><span class="line"><span class="cl"> The parke of clacaderered the bugtgheiren wapionual hquin rithe mopestoracully cotiond dould’s ho clar
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">thole meantoretion. ’vend wheses hemomerlize.
</span></span><span class="line"><span class="cl">E’s blolll and offichetery.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">The madterainduing aganiby horefaricatal the niabusical are andernevend, dave reomenc
</span></span><span class="line"><span class="cl">to
</span></span><span class="line"><span class="cl">pentary ith rive, rig andemens an jus worm vare us phan’se alition.
</span></span><span class="line"><span class="cl"> Therys then they ore bourgeoinsimales of iner casterepreteoas..”, e
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Epoch 7/10
</span></span><span class="line"><span class="cl">88/88 [==============================] - 31s 354ms/step - loss: 1.9494
</span></span><span class="line"><span class="cl">Epoch 8/10
</span></span><span class="line"><span class="cl">88/88 [==============================] - 31s 353ms/step - loss: 1.8507
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 0.2
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">n the working and the proletarial and in the proletaries of the proletaries of the proletaries of the conding of the proletaries and mover the proletaries the sellice of the proletaries of the proletaries and and the proletaries and in the modern of the proletaries of the wat and and and the and in
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">the proletaries of the conding of the proletaries of the bourgeoisie of the for in the proletaries of the modern of the proletaries of the modern of the proletaries of the competion of the proletaries of the proletariat of the proletaries of the proletariat and and the modentry and and the proletari
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">e modern of the proletaries society and the with and and and in the proletaries of the conding of the bourgeois in the proletaries of the proletaries of the proletaries of the conding of the proletariat and the proletaries of the proletaries of the proletaries of the proletariat of the modern of the
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 0.5
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl"> the clolution and in the condings of the down the now proletaries introductions she proleved in social and of the and in the ore mover the bourgeoisies, the property and rastion of the condine worne.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">And the mounder the she proletariat sitered the society, in the nevernoption the and and in a hise
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">ry histred cits of mench ine conderne the do class with the larling of the proletaring and the proletaring in the modern on the wat of my the wast of her the clansss of the leverty on the mere the in bourgeois and the ine productions of the
</span></span><span class="line"><span class="cl">movent of the destrence nother the class, when and the into
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">ore in the pastion the country the prolutions of the reepentions of the whis clas for cleass of the proletarion of the conding in the class class achered society society it apprers, and lition mence of the proletariate, society factions the smenetion and by
</span></span><span class="line"><span class="cl">modern the commention of the production pr
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 1.0
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">t sepres tingh proda,
</span></span><span class="line"><span class="cl">They the isncited – I lollicazal seations and leath herrover of hizder hathed’tion, wat selyre ourde of thee sunn’in retently steansy.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">The coundend and and and ove cind-alod.
</span></span><span class="line"><span class="cl"> The
</span></span><span class="line"><span class="cl">proletaringé
</span></span><span class="line"><span class="cl">fat adident in labe tot and for pate. The agelopede the clallf the hallibal the clod
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> tacel, an whis Fen the moabile her, the gected-veren an freforen the lacinticalilly. In jentalizally feat the well.  Thion you apond her prises of the smostiver of it iny
</span></span><span class="line"><span class="cl">bearthing awituall purolever the stanbleciatly bentor feous, upe the naze out in antivent. Ho dion. Mand sins.” I lew nistay her
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">thee anal bourgeoismings the at pelode proder an
</span></span><span class="line"><span class="cl">but
</span></span><span class="line"><span class="cl">shear
</span></span><span class="line"><span class="cl">be reash indietion the wactes, im?
</span></span><span class="line"><span class="cl"> I heand whis Stas ust. I when’sel my treea sepre of the Socuce esindy.  In the haver forsered sou’ly and of an
</span></span><span class="line"><span class="cl">the pornations withs cinsh wornountive no. Hhe
</span></span><span class="line"><span class="cl">Ger the senc the ame of sother form and
</span></span><span class="line"><span class="cl">dithh w
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Epoch 9/10
</span></span><span class="line"><span class="cl">88/88 [==============================] - 31s 354ms/step - loss: 1.7696
</span></span><span class="line"><span class="cl">Epoch 10/10
</span></span><span class="line"><span class="cl">88/88 [==============================] - 31s 352ms/step - loss: 1.7040
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 0.2
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">iat of the working of the proletariat of the counding of the proletariat of the bourgeoisie of the social of the proletariat of the proletariat the proletariat of the modern of the proletariat of the compintence of the proletariat of the comment of the proletariat of the proletariat of the proletari
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">e proletariat in the conditions of the proletariat of the proletariat of the proletariat of the working of the proletariat of the working of the proletariat of the proletariat of the proletariat, the proletariat of the modern of the modern of the proletariat of the proletariat the proletariat of the
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">rking the proletariat of the proletariat of the proletariat of the selfice of the proletariat of the countriations of the proletariat the proletariat of the working on the bourgeoisie of the proletariat of the social of the proletariat in society of the proletariat of the bourgeois the proletariat o
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 0.5
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">ordaw.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">I class of the proletariat and it the classs of the proletariat has the cas. The itsurs of mans and becases, in the popcetent of the proletariat up class bourgeois condition the socialisty, in the to the workers of inderation the proletariat and of the modern and of the complete of the repan
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">he socialism of the bourgeoisie, the proletariat a society.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">The country, and barling the carst the the working and the rever of ont the bourgeoisie of the prentence of the lother production, the bourgeoisie of the comment condition of the ore have sead inderation of and no her for its with mange th
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">n onterant of the modern the
</span></span><span class="line"><span class="cl">French of all and in the proletariat of the proletarian of the the proletariat of the politial in the shanke shourgeois head of wall with inding of
</span></span><span class="line"><span class="cl">standing of the complosition to was the down you existion of the canists of production of inting condernation the groletari
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">Temperature: 1.0
</span></span><span class="line"><span class="cl">####################
</span></span><span class="line"><span class="cl">ongual moust, mut the Cohm more whom belopred that, the bourgeois ine of impepencant wivicums and
</span></span><span class="line"><span class="cl">and
</span></span><span class="line"><span class="cl">more to bourgeed us of the not like in the coin cramborer, but fir and polterians, with the useving one the suringain frieas, ce on the revolking pullivale predevenct in the worting a cocorets, no g
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">dms it the sonsing widss, the the fromen hich peconce of the onalilutions
</span></span><span class="line"><span class="cl">crose dive and feudtory poterte,
</span></span><span class="line"><span class="cl">fell bess mave stomence in heroms,
</span></span><span class="line"><span class="cl">class and
</span></span><span class="line"><span class="cl">miss of
</span></span><span class="line"><span class="cl">untam, indeed had the clich but is drestroopres her, and
</span></span><span class="line"><span class="cl">gontername musep-codustrie, the the wag.  They Oust when for by lasucts a socust &#34;P
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">f mand to shaire sup the chifaped of but bemaning and of voing.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Neo lonje circtious yrair?
</span></span><span class="line"><span class="cl">Gerss a’lly theypp foure on make fifferent slucks its, of abrongior its inuce,
</span></span><span class="line"><span class="cl">der.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">I a Neir
</span></span><span class="line"><span class="cl">dis shey lorks you polition, raking where noger of her I moter squelling sacke?
</span></span><span class="line"><span class="cl">The beemed
</span></span><span class="line"><span class="cl">of the prolutical conpr
</span></span></code></pre></div><p>The higher the temperature the more creative the model is allowed to be. Around
this time I began to panic that there might not be enough data to properly
train such an advanced network.</p>
<p>I quickly decided to make some changes to the model. To begin with, I had been
training the model to learn how to spell. With such a small dataset, it would
likely be a better idea to teach it how to construct sentences. To do so, I set
the neural network to learn at the &ldquo;word level&rdquo; versus the character level.</p>
<p>To account for this learning change, I also modified the maximum number of
previous words the model would be allowed to consider before generating a new
word from 40 to 8. This is approximately the number of words in a basic
sentence.</p>
<p>Second, looking at our data reveals that it follows three very different
schemas, or formats. I had initially tried to train the model so that it would
learn forwards and backwards, but without more concrete and stable formatting
this was inefficient. I disabled bidirectional learning for the LSTM.</p>
<p>Finally, in QUINTUPLED the number of epochs to 50. I then executed the changes
against corpus 1. While this also produced highly amusing output, I spent
some additional time tweaking the neural network.</p>
<h1 id="some-time-later">Some time later<a href="#some-time-later" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<p>After playing with a bunch of settings, I ended up modifying a lot. The first
thing I did was increase the Hardboiled:Manifesto ratio in Corpus 1. Once
I increased the ratio, I duplicated the resulting text to get over 10,000 lines.</p>
<p>I then did the same thing and duplicated all the content in Corpus 2 until I
also had over 10,000 lines. Finally, I did a bunch of customization to the
neural network. At one point I had gone so focused that it was only capable of
learning the word of. Here&rsquo;s the resulting configuration:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-txt" data-lang="txt"><span class="line"><span class="cl">model_cfg = {
</span></span><span class="line"><span class="cl">    &#39;rnn_size&#39;: 128,
</span></span><span class="line"><span class="cl">    &#39;rnn_layers&#39;: 4,
</span></span><span class="line"><span class="cl">    &#39;rnn_bidirectional&#39;: True,
</span></span><span class="line"><span class="cl">    &#39;max_length&#39;: 10,
</span></span><span class="line"><span class="cl">    &#39;max_words&#39;: 10000,
</span></span><span class="line"><span class="cl">    &#39;dim_embeddings&#39;: 100,
</span></span><span class="line"><span class="cl">    &#39;word_level&#39;: True,
</span></span><span class="line"><span class="cl">}
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">train_cfg = {
</span></span><span class="line"><span class="cl">    &#39;line_delimited&#39;: False,
</span></span><span class="line"><span class="cl">    &#39;num_epochs&#39;: 700,
</span></span><span class="line"><span class="cl">    &#39;gen_epochs&#39;: 50,
</span></span><span class="line"><span class="cl">    &#39;batch_size&#39;: 1024,
</span></span><span class="line"><span class="cl">    &#39;train_size&#39;: 0.75,
</span></span><span class="line"><span class="cl">    &#39;dropout&#39;: 0.0,
</span></span><span class="line"><span class="cl">    &#39;max_gen_length&#39;: 300,
</span></span><span class="line"><span class="cl">    &#39;validation&#39;: True,
</span></span><span class="line"><span class="cl">    &#39;is_csv&#39;: False
</span></span><span class="line"><span class="cl">}
</span></span></code></pre></div><p>The model is currently trianing, and I expect it to take approximately 3-4
hours. I plan to update this post with new information as I compile it, but
I do work tomorrow so I have to be responsible. :(</p>
]]></content></item></channel></rss>