danchern97 / LossTop

Skoltech DL 2021 course project "Investigation of topological losses for neural text generation"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LossTop

Repository for Skoltech Deep Learning course project "Investigation of topological losses for neural text generation" 2021

The distribution of feature for natural and generated texts during training on 4 layer, 11 head

Authors

Daniil Cherniavskii, Saveliy Galochkin, Yehor Kravets, Lev Kosolapov, Ramilya Sharifullina, Dmitry Kryukov, Georgiy Kozhevniko

Requirements installation

The code was test on Python 3.8.5; the requirements can be installed in a new enviroment with:

pip3 install -r requirements.txt

GPT-2 finetuning

To finetune GPT-2 on ShortJokes dataset, as was done during the project, please refer to GPT-2 finetune notebook.

To examine the MST calculation functions we tried using, refer to mst.py.

Finetuned models

Both default finetuned GPT-2 and the one trained with topological loss are localted here

Some explanations

Calculating original topological features is very time consuming, so we used an approximation to H0s, that is the sum of weights above threshold:

equation

The final topological loss is defined as

equation

About

Skoltech DL 2021 course project "Investigation of topological losses for neural text generation"


Languages

Language:Jupyter Notebook 86.6%Language:Python 13.4%