Neural Defence

Aleksey Tikhonov
Mar 24, 2018 · 2 min read

TLDR: I started it as a tutorial project to make myself familiar with RNN and Tensorflow — teach the neural network to generate a poetry in style of some famous authors. Suddenly it gave some results with a reasonable quality and we with my colleague and friend Ivan Yamschikov spontaneously decided to record a tribute album to our favorite cult Russian punk-rock singer Egor Letov. The release got 300 000 listeners in the first week and a considerable attention of Russian media and IT community.

Image for post
Image for post
the album cover based on a draft by

When back in 2016 I decided to dive into a contemporary neural network technology, I started with this project without any hesitation from the poetry generation since in my past I already made several NLG projects with the poetry, for example, . The friend of mine, my ex-colleague gave me several valuable lessons on today’s neural networks technologies and some links on online courses and tutorials to start with.

The core of the Neural Defence project is a language model built as LSTM-based RNN with some bells and whistles. Some of the important tricks were the conditioning with the metainformation like the author and the poem. Another useful technique was the usage of hybrid word-based and char-based embeddings together with the phonetic transcription — to give the network the idea of rhymes and rhythm.

Altogether each word representation looked like this:

Image for post
Image for post

Then I used 130 Mb of Russian classical poetry and Russian song lyrics as a learning data with approximately 400K unique words. After something like 15 epochs, it has obtained certain compatibility of the words that could be regarded as some kind of a morphology model and poetry rhymes. The network also was able to learn specific features of individual authors. The more poems of a given author there were in the learning dataset the better it was “represented” by the network.

As far as I showed the results to the other friend of mine, , he was very excited and proposed to record a tribute album to our favorite cult Russian punk-rock singer Egor Letov. Ivan wrote and played all the music on the album and we record the voices together in his home studio in Leipzig.

You can listen to the whole album on or .

The release got 300 000 listeners in the first week and a . Later we used the same network to .

Altsoph’s blog

Random notes on people and machines

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store