Updated report

This commit is contained in:
Maciej Krzyżanowski 2023-05-29 01:29:29 +02:00
parent dece511664
commit f715bdeb88
13 changed files with 1858 additions and 0 deletions

BIN
report/images/beta_gru.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
report/images/beta_lstm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

119
report/report.aux Normal file
View File

@ -0,0 +1,119 @@
\relax
\providecommand\hyper@newdestlabel[2]{}
\providecommand\babel@aux[2]{}
\@nameuse{bbl@beforestart}
\catcode `"\active
\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
\global\let\oldcontentsline\contentsline
\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
\global\let\oldnewlabel\newlabel
\gdef\newlabel#1#2{\newlabelxx{#1}#2}
\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
\AtEndDocument{\ifx\hyper@anchor\@undefined
\let\contentsline\oldcontentsline
\let\newlabel\oldnewlabel
\fi}
\fi}
\global\let\hyper@last\relax
\gdef\HyperFirstAtBeginDocument#1{#1}
\providecommand\HyField@AuxAddToFields[1]{}
\providecommand\HyField@AuxAddToCoFields[2]{}
\babel@aux{polish}{}
\@writefile{toc}{\contentsline {section}{\numberline {1}Wstęp}{3}{section.1}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {2}Łańcuchy Markova}{4}{section.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Wstęp}{4}{subsection.2.1}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Przykład łańcucha Markova, dla zdania "The quick brown fox jumps over the lazy dog and the angry dog chase the quick brown fox.", dla wartości $ngram = 1$, oznaczającej stany jako pojedyncze słowama oraz wartoścami prawdopodobieństw przejść pomiędzy stanami obliczonych na podstawie zdania wejściowego.\relax }}{5}{figure.caption.2}\protected@file@percent }
\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
\newlabel{fig:mesh1}{{1}{5}{Przykład łańcucha Markova, dla zdania "The quick brown fox jumps over the lazy dog and the angry dog chase the quick brown fox.", dla wartości $ngram = 1$, oznaczającej stany jako pojedyncze słowama oraz wartoścami prawdopodobieństw przejść pomiędzy stanami obliczonych na podstawie zdania wejściowego.\relax }{figure.caption.2}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Prawo Zipfa}{6}{subsection.2.2}\protected@file@percent }
\newlabel{fig:mesh1}{{2a}{7}{Wykres 1000 najczęściej pojawiających się słów dla zbioru danych $somemix.csv$.\relax }{figure.caption.3}{}}
\newlabel{sub@fig:mesh1}{{a}{7}{Wykres 1000 najczęściej pojawiających się słów dla zbioru danych $somemix.csv$.\relax }{figure.caption.3}{}}
\newlabel{fig:mesh1}{{2b}{7}{Wykres stałej $constant = ranga * wystapienia$ dla zbioru danych $somemix.csv$\relax }{figure.caption.3}{}}
\newlabel{sub@fig:mesh1}{{b}{7}{Wykres stałej $constant = ranga * wystapienia$ dla zbioru danych $somemix.csv$\relax }{figure.caption.3}{}}
\newlabel{fig:mesh1}{{3a}{8}{Wykres 1000 najczęściej pojawiających się słów dla piosenki wygenerowanej na podstawie $somemix.csv$ o 100 wersach po 500 słów.\relax }{figure.caption.4}{}}
\newlabel{sub@fig:mesh1}{{a}{8}{Wykres 1000 najczęściej pojawiających się słów dla piosenki wygenerowanej na podstawie $somemix.csv$ o 100 wersach po 500 słów.\relax }{figure.caption.4}{}}
\newlabel{fig:mesh1}{{3b}{8}{Wykres stałej $constant = ranga * wystapienia$ dla piosenki wygenerowanej na podstawie $somemix.csv$ o 100 wersach po 500 słów\relax }{figure.caption.4}{}}
\newlabel{sub@fig:mesh1}{{b}{8}{Wykres stałej $constant = ranga * wystapienia$ dla piosenki wygenerowanej na podstawie $somemix.csv$ o 100 wersach po 500 słów\relax }{figure.caption.4}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Prawo Heapsa}{9}{subsection.2.3}\protected@file@percent }
\newlabel{fig:mesh1}{{\caption@xref {fig:mesh1}{ on input line 117}}{10}{Prawo Heapsa}{figure.caption.5}{}}
\newlabel{sub@fig:mesh1}{{}{10}{Prawo Heapsa}{figure.caption.5}{}}
\newlabel{fig:mesh1}{{\caption@xref {fig:mesh1}{ on input line 123}}{10}{Prawo Heapsa}{figure.caption.5}{}}
\newlabel{sub@fig:mesh1}{{}{10}{Prawo Heapsa}{figure.caption.5}{}}
\newlabel{fig:mesh1}{{\caption@xref {fig:mesh1}{ on input line 129}}{10}{Prawo Heapsa}{figure.caption.5}{}}
\newlabel{sub@fig:mesh1}{{}{10}{Prawo Heapsa}{figure.caption.5}{}}
\newlabel{fig:mesh1}{{\caption@xref {fig:mesh1}{ on input line 135}}{10}{Prawo Heapsa}{figure.caption.5}{}}
\newlabel{sub@fig:mesh1}{{}{10}{Prawo Heapsa}{figure.caption.5}{}}
\newlabel{fig:mesh1}{{\caption@xref {fig:mesh1}{ on input line 141}}{10}{Prawo Heapsa}{figure.caption.5}{}}
\newlabel{sub@fig:mesh1}{{}{10}{Prawo Heapsa}{figure.caption.5}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces Wykres zależności liczby stanów unikalnych od rozmiaru tekstu oraz wartości $ngram$ dla zbiorów danych: $kyuss.csv, led\_zeppelin.csv, Black Sabbath.csv, ac\_dc.csv$.\relax }}{10}{figure.caption.5}\protected@file@percent }
\newlabel{fig:mesh1}{{4}{10}{Wykres zależności liczby stanów unikalnych od rozmiaru tekstu oraz wartości $ngram$ dla zbiorów danych: $kyuss.csv, led\_zeppelin.csv, Black Sabbath.csv, ac\_dc.csv$.\relax }{figure.caption.5}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Entropia Krzyżowa}{11}{subsection.2.4}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Wykres wartości entropii krzyżowej dla tekstu generowanego na podstawie zbioru danych $somemix.csv$, zależnie od rozmiaru wygenerowanego tekstu.\relax }}{12}{figure.caption.6}\protected@file@percent }
\newlabel{fig:mesh1}{{5}{12}{Wykres wartości entropii krzyżowej dla tekstu generowanego na podstawie zbioru danych $somemix.csv$, zależnie od rozmiaru wygenerowanego tekstu.\relax }{figure.caption.6}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.5}Perpleksja}{12}{subsection.2.5}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Wykres wartości perpleksji dla tekstu generowanego na podstawie zbioru danych $somemix.csv$, zależnie od rozmiaru wygenerowanego tekstu.\relax }}{13}{figure.caption.7}\protected@file@percent }
\newlabel{fig:mesh1}{{6}{13}{Wykres wartości perpleksji dla tekstu generowanego na podstawie zbioru danych $somemix.csv$, zależnie od rozmiaru wygenerowanego tekstu.\relax }{figure.caption.7}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.6}Self-BLEU}{13}{subsection.2.6}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces Wykres wartości Self-BLEU dla tekstu generowanego na podstawie zbioru danych $somemix.csv$, zależnie od rozmiaru wygenerowanego tekstu.\relax }}{14}{figure.caption.8}\protected@file@percent }
\newlabel{fig:mesh1}{{7}{14}{Wykres wartości Self-BLEU dla tekstu generowanego na podstawie zbioru danych $somemix.csv$, zależnie od rozmiaru wygenerowanego tekstu.\relax }{figure.caption.8}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.7}Przykładowe wyniki}{14}{subsection.2.7}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {3}Rekurencyjne Sieci Neuronowe}{16}{section.3}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Wstęp o rekurencyjnych sieciach neuronowych}{16}{subsection.3.1}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {8}{\ignorespaces Obrazek przedstawia schemat działania Recurrent Neural Network.\relax }}{17}{figure.caption.9}\protected@file@percent }
\newlabel{fig:mesh1}{{8}{17}{Obrazek przedstawia schemat działania Recurrent Neural Network.\relax }{figure.caption.9}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}LSTM}{17}{subsection.3.2}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces Obrazek przedstawia schemat działania Long-Short Term Memory.\relax }}{18}{figure.caption.10}\protected@file@percent }
\newlabel{fig:mesh1}{{9}{18}{Obrazek przedstawia schemat działania Long-Short Term Memory.\relax }{figure.caption.10}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}GRU}{18}{subsection.3.3}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {10}{\ignorespaces Obrazek przedstawia schemat działania Gated Recurrent Unit.\relax }}{19}{figure.caption.11}\protected@file@percent }
\newlabel{fig:mesh1}{{10}{19}{Obrazek przedstawia schemat działania Gated Recurrent Unit.\relax }{figure.caption.11}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Różnice między LSTM, a GRU}{19}{subsection.3.4}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.5}Problem znikającego gradientu}{19}{subsection.3.5}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.6}Embedding}{19}{subsection.3.6}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {4}Sieci neuronowe na transformatorach}{21}{section.4}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Przykładowe wykorzystanie sieci neuronowych na transformatoarach:}{21}{subsection.4.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Analiza działania transformera:}{21}{subsection.4.2}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {11}{\ignorespaces Obrazek przedstawia schemat działania tranformera z opisami potrzebnymi do dalszego opisu.\relax }}{21}{figure.caption.12}\protected@file@percent }
\newlabel{fig:mesh1}{{11}{21}{Obrazek przedstawia schemat działania tranformera z opisami potrzebnymi do dalszego opisu.\relax }{figure.caption.12}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {12}{\ignorespaces Obrazek przedstawia schemat działania wekotra uwagi.\relax }}{22}{figure.caption.13}\protected@file@percent }
\newlabel{fig:mesh1}{{12}{22}{Obrazek przedstawia schemat działania wekotra uwagi.\relax }{figure.caption.13}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {13}{\ignorespaces Obrazek przedstawia schemat działania wekotra uwagi.\relax }}{22}{figure.caption.14}\protected@file@percent }
\newlabel{fig:mesh1}{{13}{22}{Obrazek przedstawia schemat działania wekotra uwagi.\relax }{figure.caption.14}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {14}{\ignorespaces Obrazek przedstawia schemat działania maskowania na przykładzie zdania po języku hiszpańskim, które ma być przetłumaczone na inny język.\relax }}{23}{figure.caption.15}\protected@file@percent }
\newlabel{fig:mesh1}{{14}{23}{Obrazek przedstawia schemat działania maskowania na przykładzie zdania po języku hiszpańskim, które ma być przetłumaczone na inny język.\relax }{figure.caption.15}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.3}Wady i zalety:}{23}{subsection.4.3}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {5}GPT-2}{25}{section.5}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {15}{\ignorespaces Obrazek przedstawia schemat działania gpt-2 na obrazach.\relax }}{26}{figure.caption.16}\protected@file@percent }
\newlabel{fig:mesh1}{{15}{26}{Obrazek przedstawia schemat działania gpt-2 na obrazach.\relax }{figure.caption.16}{}}
\@writefile{toc}{\contentsline {section}{\numberline {6}Realizacja praktyczna z wykorzystaniem RNN}{27}{section.6}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1}Użyte narzędzia}{27}{subsection.6.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {6.2}Struktura kodu}{27}{subsection.6.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {6.3}Dane uczące}{27}{subsection.6.3}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {6.4}Modele RNN}{28}{subsection.6.4}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {6.4.1}default\_lstm}{28}{subsubsection.6.4.1}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {16}{\ignorespaces Metryki modelu default\_lstm\relax }}{28}{figure.caption.17}\protected@file@percent }
\newlabel{fig:default_lstm}{{16}{28}{Metryki modelu default\_lstm\relax }{figure.caption.17}{}}
\@writefile{toc}{\contentsline {paragraph}{Przykład generacji}{28}{section*.18}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {6.4.2}beta\_lstm}{29}{subsubsection.6.4.2}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {17}{\ignorespaces Metryki modelu beta\_lstm\relax }}{29}{figure.caption.19}\protected@file@percent }
\newlabel{fig:beta_lstm}{{17}{29}{Metryki modelu beta\_lstm\relax }{figure.caption.19}{}}
\@writefile{toc}{\contentsline {paragraph}{Przykład generacji}{29}{section*.20}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {6.4.3}gamma\_lstm}{30}{subsubsection.6.4.3}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {18}{\ignorespaces Metryki modelu gamma\_lstm\relax }}{30}{figure.caption.21}\protected@file@percent }
\newlabel{fig:gamma_lstm}{{18}{30}{Metryki modelu gamma\_lstm\relax }{figure.caption.21}{}}
\@writefile{toc}{\contentsline {paragraph}{Przykład generacji}{30}{section*.22}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {6.4.4}omicron\_lstm}{31}{subsubsection.6.4.4}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {19}{\ignorespaces Metryki modelu omicron\_lstm\relax }}{31}{figure.caption.23}\protected@file@percent }
\newlabel{fig:omicron_lstm}{{19}{31}{Metryki modelu omicron\_lstm\relax }{figure.caption.23}{}}
\@writefile{toc}{\contentsline {paragraph}{Przykład generacji}{31}{section*.24}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {6.4.5}default\_gru}{32}{subsubsection.6.4.5}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {20}{\ignorespaces Metryki modelu default\_gru\relax }}{32}{figure.caption.25}\protected@file@percent }
\newlabel{fig:default_gru}{{20}{32}{Metryki modelu default\_gru\relax }{figure.caption.25}{}}
\@writefile{toc}{\contentsline {paragraph}{Przykład generacji}{32}{section*.26}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {6.4.6}beta\_gru}{33}{subsubsection.6.4.6}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {21}{\ignorespaces Metryki modelu beta\_gru\relax }}{33}{figure.caption.27}\protected@file@percent }
\newlabel{fig:beta_gru}{{21}{33}{Metryki modelu beta\_gru\relax }{figure.caption.27}{}}
\@writefile{toc}{\contentsline {paragraph}{Przykład generacji}{33}{section*.28}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {6.4.7}Dotrenowany model GPT-2}{34}{subsubsection.6.4.7}\protected@file@percent }
\gdef \@abspage@last{34}

1398
report/report.log Normal file

File diff suppressed because it is too large Load Diff

33
report/report.out Normal file
View File

@ -0,0 +1,33 @@
\BOOKMARK [1][-]{section.1}{\376\377\000W\000s\000t\001\031\000p}{}% 1
\BOOKMARK [1][-]{section.2}{\376\377\001\101\000a\001\104\000c\000u\000c\000h\000y\000\040\000M\000a\000r\000k\000o\000v\000a}{}% 2
\BOOKMARK [2][-]{subsection.2.1}{\376\377\000W\000s\000t\001\031\000p}{section.2}% 3
\BOOKMARK [2][-]{subsection.2.2}{\376\377\000P\000r\000a\000w\000o\000\040\000Z\000i\000p\000f\000a}{section.2}% 4
\BOOKMARK [2][-]{subsection.2.3}{\376\377\000P\000r\000a\000w\000o\000\040\000H\000e\000a\000p\000s\000a}{section.2}% 5
\BOOKMARK [2][-]{subsection.2.4}{\376\377\000E\000n\000t\000r\000o\000p\000i\000a\000\040\000K\000r\000z\000y\001\174\000o\000w\000a}{section.2}% 6
\BOOKMARK [2][-]{subsection.2.5}{\376\377\000P\000e\000r\000p\000l\000e\000k\000s\000j\000a}{section.2}% 7
\BOOKMARK [2][-]{subsection.2.6}{\376\377\000S\000e\000l\000f\000-\000B\000L\000E\000U}{section.2}% 8
\BOOKMARK [2][-]{subsection.2.7}{\376\377\000P\000r\000z\000y\000k\001\102\000a\000d\000o\000w\000e\000\040\000w\000y\000n\000i\000k\000i}{section.2}% 9
\BOOKMARK [1][-]{section.3}{\376\377\000R\000e\000k\000u\000r\000e\000n\000c\000y\000j\000n\000e\000\040\000S\000i\000e\000c\000i\000\040\000N\000e\000u\000r\000o\000n\000o\000w\000e}{}% 10
\BOOKMARK [2][-]{subsection.3.1}{\376\377\000W\000s\000t\001\031\000p\000\040\000o\000\040\000r\000e\000k\000u\000r\000e\000n\000c\000y\000j\000n\000y\000c\000h\000\040\000s\000i\000e\000c\000i\000a\000c\000h\000\040\000n\000e\000u\000r\000o\000n\000o\000w\000y\000c\000h}{section.3}% 11
\BOOKMARK [2][-]{subsection.3.2}{\376\377\000L\000S\000T\000M}{section.3}% 12
\BOOKMARK [2][-]{subsection.3.3}{\376\377\000G\000R\000U}{section.3}% 13
\BOOKMARK [2][-]{subsection.3.4}{\376\377\000R\000\363\001\174\000n\000i\000c\000e\000\040\000m\000i\001\031\000d\000z\000y\000\040\000L\000S\000T\000M\000,\000\040\000a\000\040\000G\000R\000U}{section.3}% 14
\BOOKMARK [2][-]{subsection.3.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\000z\000n\000i\000k\000a\000j\001\005\000c\000e\000g\000o\000\040\000g\000r\000a\000d\000i\000e\000n\000t\000u}{section.3}% 15
\BOOKMARK [2][-]{subsection.3.6}{\376\377\000E\000m\000b\000e\000d\000d\000i\000n\000g}{section.3}% 16
\BOOKMARK [1][-]{section.4}{\376\377\000S\000i\000e\000c\000i\000\040\000n\000e\000u\000r\000o\000n\000o\000w\000e\000\040\000n\000a\000\040\000t\000r\000a\000n\000s\000f\000o\000r\000m\000a\000t\000o\000r\000a\000c\000h}{}% 17
\BOOKMARK [2][-]{subsection.4.1}{\376\377\000P\000r\000z\000y\000k\001\102\000a\000d\000o\000w\000e\000\040\000w\000y\000k\000o\000r\000z\000y\000s\000t\000a\000n\000i\000e\000\040\000s\000i\000e\000c\000i\000\040\000n\000e\000u\000r\000o\000n\000o\000w\000y\000c\000h\000\040\000n\000a\000\040\000t\000r\000a\000n\000s\000f\000o\000r\000m\000a\000t\000o\000a\000r\000a\000c\000h\000:}{section.4}% 18
\BOOKMARK [2][-]{subsection.4.2}{\376\377\000A\000n\000a\000l\000i\000z\000a\000\040\000d\000z\000i\000a\001\102\000a\000n\000i\000a\000\040\000t\000r\000a\000n\000s\000f\000o\000r\000m\000e\000r\000a\000:}{section.4}% 19
\BOOKMARK [2][-]{subsection.4.3}{\376\377\000W\000a\000d\000y\000\040\000i\000\040\000z\000a\000l\000e\000t\000y\000:}{section.4}% 20
\BOOKMARK [1][-]{section.5}{\376\377\000G\000P\000T\000-\0002}{}% 21
\BOOKMARK [1][-]{section.6}{\376\377\000R\000e\000a\000l\000i\000z\000a\000c\000j\000a\000\040\000p\000r\000a\000k\000t\000y\000c\000z\000n\000a\000\040\000z\000\040\000w\000y\000k\000o\000r\000z\000y\000s\000t\000a\000n\000i\000e\000m\000\040\000R\000N\000N}{}% 22
\BOOKMARK [2][-]{subsection.6.1}{\376\377\000U\001\174\000y\000t\000e\000\040\000n\000a\000r\000z\001\031\000d\000z\000i\000a}{section.6}% 23
\BOOKMARK [2][-]{subsection.6.2}{\376\377\000S\000t\000r\000u\000k\000t\000u\000r\000a\000\040\000k\000o\000d\000u}{section.6}% 24
\BOOKMARK [2][-]{subsection.6.3}{\376\377\000D\000a\000n\000e\000\040\000u\000c\000z\001\005\000c\000e}{section.6}% 25
\BOOKMARK [2][-]{subsection.6.4}{\376\377\000M\000o\000d\000e\000l\000e\000\040\000R\000N\000N}{section.6}% 26
\BOOKMARK [3][-]{subsubsection.6.4.1}{\376\377\000d\000e\000f\000a\000u\000l\000t\000\137\000l\000s\000t\000m}{subsection.6.4}% 27
\BOOKMARK [3][-]{subsubsection.6.4.2}{\376\377\000b\000e\000t\000a\000\137\000l\000s\000t\000m}{subsection.6.4}% 28
\BOOKMARK [3][-]{subsubsection.6.4.3}{\376\377\000g\000a\000m\000m\000a\000\137\000l\000s\000t\000m}{subsection.6.4}% 29
\BOOKMARK [3][-]{subsubsection.6.4.4}{\376\377\000o\000m\000i\000c\000r\000o\000n\000\137\000l\000s\000t\000m}{subsection.6.4}% 30
\BOOKMARK [3][-]{subsubsection.6.4.5}{\376\377\000d\000e\000f\000a\000u\000l\000t\000\137\000g\000r\000u}{subsection.6.4}% 31
\BOOKMARK [3][-]{subsubsection.6.4.6}{\376\377\000b\000e\000t\000a\000\137\000g\000r\000u}{subsection.6.4}% 32
\BOOKMARK [3][-]{subsubsection.6.4.7}{\376\377\000D\000o\000t\000r\000e\000n\000o\000w\000a\000n\000y\000\040\000m\000o\000d\000e\000l\000\040\000G\000P\000T\000-\0002}{subsection.6.4}% 33

Binary file not shown.

BIN
report/report.synctex.gz Normal file

Binary file not shown.

View File

@ -9,6 +9,14 @@
\usepackage{placeins} \usepackage{placeins}
\usepackage{caption} \usepackage{caption}
\usepackage{subcaption} \usepackage{subcaption}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows}
\tikzstyle{terminator} = [rectangle, draw, text centered, rounded corners, minimum height=2em]
\tikzstyle{process} = [rectangle, draw, text centered, minimum height=2em]
\tikzstyle{decision} = [diamond, draw, text centered, minimum height=2em]
\tikzstyle{data}=[trapezium, draw, text centered, trapezium left angle=60, trapezium right angle=120, minimum height=2em]
\tikzstyle{connector} = [draw, -latex']
\title{Generacja tekstów piosenek} \title{Generacja tekstów piosenek}
\author{Maciej Krzyżanowski, Sebastian Kutny, Tomasz Lewandowski} \author{Maciej Krzyżanowski, Sebastian Kutny, Tomasz Lewandowski}
@ -338,4 +346,264 @@ Jeśli dać mu fragmet obrazu to wytworzy spójny stylistycznie ciąg dalszy i t
\caption{Obrazek przedstawia schemat działania gpt-2 na obrazach.} \caption{Obrazek przedstawia schemat działania gpt-2 na obrazach.}
\label{fig:mesh1} \label{fig:mesh1}
\end{figure} \end{figure}
\pagebreak
\section{Realizacja praktyczna z wykorzystaniem RNN}
\subsection{Użyte narzędzia}
\begin{itemize}
\item Python3
\item Tensorflow
\item Keras i Keras\_NLP
\item Embedding GloVe (6B.100d)
\item Gotowy model GPT-2 (za pomocą pakietu gpt\_2\_simple)
\item Teksty piosenek AC/DC, Metalliki i Jimiego Hendrixa
\end{itemize}
\subsection{Struktura kodu}
\begin{itemize}
\item main.py - plik obsługujący pobieranie danych od użytkownika i wykorzystujący inne moduły do ładowania i trenowania lub generacji tekstów z modeli.
\item models.py - zawiera definicje poniżej opisanych modeli.
\item data\_processor.py - impementacja klasy służącej do obróbki danych m.in. przygotowania danych treningowych i testowych
\item song\_generator.py - generator piosenek, który wykorzystuje przekazany model i instancję klasy DataProcessor
\item edit\_distances.py - kod obliczający metryki edit distance
\item plots.py - kod rysujący wykresy metryk
\item transformer.py - kod trenujący i generujący piosenki za pomocą GPT-2
\end{itemize}
\subsection{Dane uczące}
Zbiory danych wykorzystane do treningu i oceny rekurencyjnych sieci neuronowych to łącznie kilkaset tekstów utworów:
\begin{itemize}
\item Tekty piosenek AC/DC do treningu sieci opartych o LSTM lub GRU (ac\_dc.csv)
\item Połączenie tekstów Metalliki i Hendrixa do dotrenowania modelu GPT-2 (metallica\_hendrix.txt)
\end{itemize}
\newpage
\subsection{Modele RNN}
Opisując metrykę Edit Distance wartości rozdzielone średnikami oznaczają generacje odpowiednio dla 4 wersów po 6 słów, 2 wersów po 6 słów, 1 wersu składajacego się z 6 słów i 1 wersu składającego się z 2 słów.
\subsubsection{default\_lstm}
\textbf{Warstwy modelu} \\ \\
\begin{tikzpicture}[node distance = 2.2cm]
\node [process, fill=blue!20] (we) {\textbf{We}};
\node [process, fill=green!20, right of=we] (lstm1) {LSTM(256)};
\node [process, fill=green!20, right of=lstm1] (dropout1) {Dropout(0.2)};
\node [process, fill=green!20, right of=dropout1] (lstm2) {LSTM(256)};
\node [process, fill=green!20, right of=lstm2] (dropout2) {Dropout(0.2)};
\node [process, fill=blue!20, right of=dropout2] (wy) {\textbf{Wy}};
\path [connector] (we) -- (lstm1);
\path [connector] (lstm1) -- (dropout1);
\path [connector] (dropout1) -- (lstm2);
\path [connector] (lstm2) -- (dropout2);
\path [connector] (dropout2) -- (wy);
\end{tikzpicture} \\ \\
\textbf{Ocena modelu}
\begin{figure}[h]
\makebox[\textwidth][c]{\includegraphics[width=1.1\textwidth]{default_lstm}}%
\caption{Metryki modelu default\_lstm}
\label{fig:default_lstm}
\end{figure}
\FloatBarrier
Wynik edit distance (po normalizacji) dla w pełni wytrenowanego modelu: \\
Średni ED: 0.98 ; 0.97 ; 0.95 ; 0.8125 \\
Minimalny ED: 0.88 ; 0.83 ; 0.67 ; 0.0 \\
Maksymalny ED: 1.0 ; 1.0 ; 1.0 ; 1.0 \\
\paragraph{Przykład generacji}
\leavevmode\\
\textsl{
Of broad for the way shes \\
Love out the gotta rock all \\
Reputation up all yeah on down \\
Finally oh a man you gotta}
\leavevmode\\\leavevmode\\
\leavevmode\\
\newpage
\subsubsection{beta\_lstm}
\textbf{Warstwy modelu} \\ \\
\begin{tikzpicture}[node distance = 2.4cm]
\node [process, fill=blue!20] (we) {\textbf{We}};
\node [process, fill=green!20, right of=we] (lstm1) {LSTM(256)};
\node [process, fill=green!20, right of=lstm1] (dropout1) {Dropout(0.36)};
\node [process, fill=green!20, right of=dropout1] (lstm2) {LSTM(256)};
\node [process, fill=green!20, right of=lstm2] (dropout2) {Dropout(0.2)};
\node [process, fill=blue!20, right of=dropout2] (wy) {\textbf{Wy}};
\path [connector] (we) -- (lstm1);
\path [connector] (lstm1) -- (dropout1);
\path [connector] (dropout1) -- (lstm2);
\path [connector] (lstm2) -- (dropout2);
\path [connector] (dropout2) -- (wy);
\end{tikzpicture} \\ \\
\textbf{Ocena modelu}
\begin{figure}[h]
\makebox[\textwidth][c]{\includegraphics[width=1.1\textwidth]{beta_lstm}}%
\caption{Metryki modelu beta\_lstm}
\label{fig:beta_lstm}
\end{figure}
\FloatBarrier
Wynik edit distance (po normalizacji) dla w pełni wytrenowanego modelu: \\
Średni ED: 0.98 ; 0.98 ; 0.99 ; 0.97 \\
Minimalny ED: 0.91 ; 0.92 ; 0.83 ; 0.5 \\
Maksymalny ED: 1.0 ; 1.0 ; 1.0 ; 1.0 \\
\paragraph{Przykład generacji}
\leavevmode\\
\textsl{
Blood sideway up a right I'm \\
Up love and fight got the \\
Dark oh rock a with feel \\
What go come your a can}
\leavevmode\\\leavevmode\\
\leavevmode\\
\newpage
\subsubsection{gamma\_lstm}
\textbf{Warstwy modelu} \\ \\
\begin{tikzpicture}[node distance = 2.4cm]
\node [process, fill=blue!20] (we) {\textbf{We}};
\node [process, fill=green!20, right of=we] (lstm1) {LSTM(512)};
\node [process, fill=green!20, right of=lstm1] (dropout1) {Dropout(0.2)};
\node [process, fill=green!20, right of=dropout1] (lstm2) {LSTM(512)};
\node [process, fill=green!20, right of=lstm2] (dropout2) {Dropout(0.2)};
\node [process, fill=blue!20, right of=dropout2] (wy) {\textbf{Wy}};
\path [connector] (we) -- (lstm1);
\path [connector] (lstm1) -- (dropout1);
\path [connector] (dropout1) -- (lstm2);
\path [connector] (lstm2) -- (dropout2);
\path [connector] (dropout2) -- (wy);
\end{tikzpicture} \\ \\
\textbf{Ocena modelu}
\begin{figure}[h]
\makebox[\textwidth][c]{\includegraphics[width=1.1\textwidth]{gamma_lstm}}%
\caption{Metryki modelu gamma\_lstm}
\label{fig:gamma_lstm}
\end{figure}
\FloatBarrier
Wynik edit distance (po normalizacji) dla w pełni wytrenowanego modelu: \\
Średni ED: 0.98 ; 0.97 ; 0.99 ; 1.0 \\
Minimalny ED: 0.83 ; 0.83 ; 0.83 ; 1.0 \\
Maksymalny ED: 1.0 ; 1.0 ; 1.0 ; 1.0 \\
\paragraph{Przykład generacji}
\leavevmode\\
\textsl{
You got her this it the \\
Fire what we're like chorus me \\
All come she yeah the way \\
Shes commin all the way prowler}
\leavevmode\\\leavevmode\\
\leavevmode\\
\newpage
\subsubsection{omicron\_lstm}
\textbf{Warstwy modelu} \\ \\
\begin{tikzpicture}[node distance = 0.75cm]
\node [process, fill=blue!20] (we) {\textbf{We}};
\node [process, fill=yellow!20, below of=we] (glove) {GloVe.6B.100d};
\node [process, fill=green!20, below of=glove] (lstm1) {LSTM(512)};
\node [process, fill=green!20, below of=lstm1] (dropout1) {Dropout(0.2)};
\node [process, fill=green!20, below of=dropout1] (lstm2) {LSTM(512)};
\node [process, fill=green!20, below of=lstm2] (dropout2) {Dropout(0.2)};
\node [process, fill=blue!20, below of=dropout2] (wy) {\textbf{Wy}};
\path [connector] (we) -- (glove);
\path [connector] (glove) -- (lstm1);
\path [connector] (lstm1) -- (dropout1);
\path [connector] (dropout1) -- (lstm2);
\path [connector] (lstm2) -- (dropout2);
\path [connector] (dropout2) -- (wy);
\end{tikzpicture} \\ \\
\textbf{Ocena modelu}
\begin{figure}[h]
\makebox[\textwidth][c]{\includegraphics[width=1.1\textwidth]{omicron_lstm}}%
\caption{Metryki modelu omicron\_lstm}
\label{fig:omicron_lstm}
\end{figure}
\FloatBarrier
\paragraph{Przykład generacji}
\leavevmode\\
\textsl{
Twilight sting time who crown pain \\
In a legless need no tears \\
Yours a take yours lovin' million \\
Woods lovin' trip a hearts that}
\leavevmode\\\leavevmode\\
\leavevmode\\
\newpage
\subsubsection{default\_gru}
\textbf{Warstwy modelu} \\ \\
\begin{tikzpicture}[node distance = 2.2cm]
\node [process, fill=blue!20] (we) {\textbf{We}};
\node [process, fill=green!20, right of=we] (lstm1) {GRU(256)};
\node [process, fill=green!20, right of=lstm1] (dropout1) {Dropout(0.2)};
\node [process, fill=green!20, right of=dropout1] (lstm2) {GRU(256)};
\node [process, fill=green!20, right of=lstm2] (dropout2) {Dropout(0.2)};
\node [process, fill=blue!20, right of=dropout2] (wy) {\textbf{Wy}};
\path [connector] (we) -- (lstm1);
\path [connector] (lstm1) -- (dropout1);
\path [connector] (dropout1) -- (lstm2);
\path [connector] (lstm2) -- (dropout2);
\path [connector] (dropout2) -- (wy);
\end{tikzpicture} \\ \\
\textbf{Ocena modelu}
\begin{figure}[h]
\makebox[\textwidth][c]{\includegraphics[width=1.1\textwidth]{default_gru}}%
\caption{Metryki modelu default\_gru}
\label{fig:default_gru}
\end{figure}
\FloatBarrier
Wynik edit distance (po normalizacji) dla w pełni wytrenowanego modelu: \\
Średni ED: 0.99 ; 0.99 ; 0.99 ; 1.0 \\
Minimalny ED: 0.96 ; 0.92 ; 0.83 ; 1.0 \\
Maksymalny ED: 1.0 ; 1.0 ; 1.0 ; 1.0
\paragraph{Przykład generacji}
\leavevmode\\
\textsl{
Sunset but got on have call \\
I pull shook oh a can \\
Of conduct known back satisfy out \\
You bustin' himself the handful run}
\leavevmode\\\leavevmode\\
\leavevmode\\
\newpage
\subsubsection{beta\_gru}
\textbf{Warstwy modelu} \\ \\
\begin{tikzpicture}[node distance = 2.2cm]
\node [process, fill=blue!20] (we) {\textbf{We}};
\node [process, fill=green!20, right of=we] (lstm1) {GRU(128)};
\node [process, fill=green!20, right of=lstm1] (dropout1) {Dropout(0.2)};
\node [process, fill=green!20, right of=dropout1] (lstm2) {GRU(128)};
\node [process, fill=green!20, right of=lstm2] (dropout2) {Dropout(0.2)};
\node [process, fill=blue!20, right of=dropout2] (wy) {\textbf{Wy}};
\path [connector] (we) -- (lstm1);
\path [connector] (lstm1) -- (dropout1);
\path [connector] (dropout1) -- (lstm2);
\path [connector] (lstm2) -- (dropout2);
\path [connector] (dropout2) -- (wy);
\end{tikzpicture} \\ \\
\textbf{Ocena modelu}
\begin{figure}[h]
\makebox[\textwidth][c]{\includegraphics[width=1.1\textwidth]{beta_gru}}%
\caption{Metryki modelu beta\_gru}
\label{fig:beta_gru}
\end{figure}
\FloatBarrier
Wynik edit distance (po normalizacji) dla w pełni wytrenowanego modelu: \\
Średni ED: 0.98 ; 0.96 ; 0.99 ; 1.0 \\
Minimalny ED: 0.92 ; 0.83 ; 0.83 ; 1.0 \\
Maksymalny ED: 1.0 ; 1.0 ; 1.0 ; 1.0 \\
\paragraph{Przykład generacji}
\leavevmode\\
\textsl{
Into from rock way down the \\
Way the go jack which train \\
Play when down just I'm the \\
Way restless makin' and like damnation}
\leavevmode\\\leavevmode\\
\leavevmode\\
\newpage
\subsubsection{Dotrenowany model GPT-2}
Do generacji określonego rodzaju tekstów można też wykorzystać już gotowe modele. Jednym z nich jest wcześniej opisany GPT-2.
Wykorzystując pakiet gpt-2-simple dotrenowaliśmy model wykorzystując połączenie zbioru piosenek Metalliki i Jimiego Hendrixa.
Poniżej znajduje się przykład generacji tekstu przez takie rozwiązanie: \\
\leavevmode\\
\textsl{
Got to stay up through tonight \\
Nobody's fool around tonight \\
Yeah, yeah, ya better get over yourself \\
Yeah, ya better get over yourself \\
Everybody's gotta live together \\
Under the same bed \\
Every night \\
Night falls over o'er the Sun}
\leavevmode\\\leavevmode\\
\leavevmode\\
\end{document} \end{document}

40
report/report.toc Normal file
View File

@ -0,0 +1,40 @@
\babel@toc {polish}{}\relax
\contentsline {section}{\numberline {1}Wstęp}{3}{section.1}%
\contentsline {section}{\numberline {2}Łańcuchy Markova}{4}{section.2}%
\contentsline {subsection}{\numberline {2.1}Wstęp}{4}{subsection.2.1}%
\contentsline {subsection}{\numberline {2.2}Prawo Zipfa}{6}{subsection.2.2}%
\contentsline {subsection}{\numberline {2.3}Prawo Heapsa}{9}{subsection.2.3}%
\contentsline {subsection}{\numberline {2.4}Entropia Krzyżowa}{11}{subsection.2.4}%
\contentsline {subsection}{\numberline {2.5}Perpleksja}{12}{subsection.2.5}%
\contentsline {subsection}{\numberline {2.6}Self-BLEU}{13}{subsection.2.6}%
\contentsline {subsection}{\numberline {2.7}Przykładowe wyniki}{14}{subsection.2.7}%
\contentsline {section}{\numberline {3}Rekurencyjne Sieci Neuronowe}{16}{section.3}%
\contentsline {subsection}{\numberline {3.1}Wstęp o rekurencyjnych sieciach neuronowych}{16}{subsection.3.1}%
\contentsline {subsection}{\numberline {3.2}LSTM}{17}{subsection.3.2}%
\contentsline {subsection}{\numberline {3.3}GRU}{18}{subsection.3.3}%
\contentsline {subsection}{\numberline {3.4}Różnice między LSTM, a GRU}{19}{subsection.3.4}%
\contentsline {subsection}{\numberline {3.5}Problem znikającego gradientu}{19}{subsection.3.5}%
\contentsline {subsection}{\numberline {3.6}Embedding}{19}{subsection.3.6}%
\contentsline {section}{\numberline {4}Sieci neuronowe na transformatorach}{21}{section.4}%
\contentsline {subsection}{\numberline {4.1}Przykładowe wykorzystanie sieci neuronowych na transformatoarach:}{21}{subsection.4.1}%
\contentsline {subsection}{\numberline {4.2}Analiza działania transformera:}{21}{subsection.4.2}%
\contentsline {subsection}{\numberline {4.3}Wady i zalety:}{23}{subsection.4.3}%
\contentsline {section}{\numberline {5}GPT-2}{25}{section.5}%
\contentsline {section}{\numberline {6}Realizacja praktyczna z wykorzystaniem RNN}{27}{section.6}%
\contentsline {subsection}{\numberline {6.1}Użyte narzędzia}{27}{subsection.6.1}%
\contentsline {subsection}{\numberline {6.2}Struktura kodu}{27}{subsection.6.2}%
\contentsline {subsection}{\numberline {6.3}Dane uczące}{27}{subsection.6.3}%
\contentsline {subsection}{\numberline {6.4}Modele RNN}{28}{subsection.6.4}%
\contentsline {subsubsection}{\numberline {6.4.1}default\_lstm}{28}{subsubsection.6.4.1}%
\contentsline {paragraph}{Przykład generacji}{28}{section*.18}%
\contentsline {subsubsection}{\numberline {6.4.2}beta\_lstm}{29}{subsubsection.6.4.2}%
\contentsline {paragraph}{Przykład generacji}{29}{section*.20}%
\contentsline {subsubsection}{\numberline {6.4.3}gamma\_lstm}{30}{subsubsection.6.4.3}%
\contentsline {paragraph}{Przykład generacji}{30}{section*.22}%
\contentsline {subsubsection}{\numberline {6.4.4}omicron\_lstm}{31}{subsubsection.6.4.4}%
\contentsline {paragraph}{Przykład generacji}{31}{section*.24}%
\contentsline {subsubsection}{\numberline {6.4.5}default\_gru}{32}{subsubsection.6.4.5}%
\contentsline {paragraph}{Przykład generacji}{32}{section*.26}%
\contentsline {subsubsection}{\numberline {6.4.6}beta\_gru}{33}{subsubsection.6.4.6}%
\contentsline {paragraph}{Przykład generacji}{33}{section*.28}%
\contentsline {subsubsection}{\numberline {6.4.7}Dotrenowany model GPT-2}{34}{subsubsection.6.4.7}%