diff --git a/.gitignore b/.gitignore index 3ce2502..a1070cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ -data/* -./__pycache__/ \ No newline at end of file +# Python: +./__pycache__/ +*.py[cod] +*$py.class +# Recording data: +data/* \ No newline at end of file diff --git a/figures/pathway_stages_feat.pdf b/figures/pathway_stages_feat.pdf new file mode 100644 index 0000000..e9c1090 Binary files /dev/null and b/figures/pathway_stages_feat.pdf differ diff --git a/figures/pathway_stages_pre.pdf b/figures/pathway_stages_pre.pdf new file mode 100644 index 0000000..328353c Binary files /dev/null and b/figures/pathway_stages_pre.pdf differ diff --git a/main.aux b/main.aux index f554375..fef6245 100644 --- a/main.aux +++ b/main.aux @@ -222,7 +222,9 @@ \abx@aux@page{68}{7} \abx@aux@page{69}{7} \newlabel{eq:highpass}{{4}{7}{}{}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Feature extraction by individual neurons}{7}{}\protected@file@percent } +\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces \relax }}{8}{}\protected@file@percent } +\newlabel{fig:pre}{{2}{8}{}{}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Feature extraction by individual neurons}{8}{}\protected@file@percent } \newlabel{eq:conv}{{5}{8}{}{}{}} \newlabel{eq:gabor}{{6}{8}{}{}{}} \abx@aux@cite{0}{ronacher1986routes} @@ -237,23 +239,25 @@ \abx@aux@page{70}{9} \abx@aux@page{71}{9} \abx@aux@page{72}{9} -\newlabel{eq:lowpass}{{10}{9}{}{}{}} -\@writefile{toc}{\contentsline {section}{\numberline {3}Two mechanisms driving the emergence of intensity-invariant song representation}{9}{}\protected@file@percent } +\newlabel{eq:lowpass}{{10}{10}{}{}{}} +\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces \relax }}{10}{}\protected@file@percent } +\newlabel{fig:stages_feat}{{3}{10}{}{}{}} +\@writefile{toc}{\contentsline {section}{\numberline {3}Two mechanisms driving the emergence of intensity-invariant song representation}{10}{}\protected@file@percent } \@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Logarithmic scaling \& spike-frequency adaptation}{10}{}\protected@file@percent } -\newlabel{eq:toy_env}{{11}{10}{}{}{}} -\newlabel{eq:toy_snr}{{12}{10}{}{}{}} -\newlabel{eq:toy_log}{{13}{10}{}{}{}} +\newlabel{eq:toy_env}{{11}{11}{}{}{}} +\newlabel{eq:toy_snr}{{12}{11}{}{}{}} +\newlabel{eq:toy_log}{{13}{11}{}{}{}} \newlabel{eq:toy_highpass}{{14}{11}{}{}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Threshold nonlinearity \& temporal averaging}{11}{}\protected@file@percent } -\newlabel{eq:pdf_split}{{15}{11}{}{}{}} -\newlabel{eq:pdf}{{16}{11}{}{}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Threshold nonlinearity \& temporal averaging}{12}{}\protected@file@percent } +\newlabel{eq:pdf_split}{{15}{12}{}{}{}} +\newlabel{eq:pdf}{{16}{12}{}{}{}} \newlabel{eq:feat_avg}{{17}{12}{}{}{}} -\newlabel{eq:feat_prop}{{18}{12}{}{}{}} +\newlabel{eq:feat_prop}{{18}{13}{}{}{}} \abx@aux@cite{0}{stumpner1991auditory} \abx@aux@segm{0}{0}{stumpner1991auditory} -\@writefile{toc}{\contentsline {section}{\numberline {4}Discriminating species-specific song\\patterns in feature space}{13}{}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {5}Conclusions \& outlook}{13}{}\protected@file@percent } -\abx@aux@page{73}{13} +\@writefile{toc}{\contentsline {section}{\numberline {4}Discriminating species-specific song\\patterns in feature space}{14}{}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {5}Conclusions \& outlook}{14}{}\protected@file@percent } +\abx@aux@page{73}{14} \gdef\svg@ink@ver@settings{{\m@ne }{inkscape}{\m@ne }} \abx@aux@read@bbl@mdfivesum{1380DC8C93D2855FDB132CC5A40AD52F} -\gdef \@abspage@last{13} +\gdef \@abspage@last{14} diff --git a/main.bbl-SAVE-ERROR b/main.bbl-SAVE-ERROR index 2f86c18..3536320 100644 --- a/main.bbl-SAVE-ERROR +++ b/main.bbl-SAVE-ERROR @@ -1951,19 +1951,19 @@ \range{pages}{10} \endentry \entry{stumpner1994song}{article}{} - \name{author}{2}{}{% + \name{author}{2}{ul=2}{% {{un=0,uniquepart=base,hash=a7bef35fb61ea64e0f04d6c87e5aa622}{% family={Stumpner}, familyi={S\bibinitperiod}, given={Andreas}, giveni={A\bibinitperiod}, givenun=0}}% - {{un=0,uniquepart=base,hash=ecb958a09c71420bd1e10f3fee8c24ac}{% + {{un=1,uniquepart=given,hash=ecb958a09c71420bd1e10f3fee8c24ac}{% family={Helversen}, familyi={H\bibinitperiod}, given={Otto}, giveni={O\bibinitperiod}, - givenun=0, + givenun=1, prefix={von}, prefixi={v\bibinitperiod}, prefixun=0}}% @@ -1987,6 +1987,44 @@ \field{pages}{1\bibrangedash 23} \range{pages}{23} \endentry + \entry{stumpner1991auditory}{article}{} + \name{author}{2}{ul=2}{% + {{un=0,uniquepart=base,hash=a7bef35fb61ea64e0f04d6c87e5aa622}{% + family={Stumpner}, + familyi={S\bibinitperiod}, + given={Andreas}, + giveni={A\bibinitperiod}, + givenun=0}}% + {{un=0,uniquepart=base,hash=4ce9349f95ced7a4831a5efa0fe5b00f}{% + family={Ronacher}, + familyi={R\bibinitperiod}, + given={Bernhard}, + giveni={B\bibinitperiod}, + givenun=0}}% + } + \list{publisher}{1}{% + {The Company of Biologists Ltd}% + } + \strng{namehash}{c6b9dac84d9d74ba87037123f4e21034} + \strng{fullhash}{c6b9dac84d9d74ba87037123f4e21034} + \strng{bibnamehash}{c6b9dac84d9d74ba87037123f4e21034} + \strng{authorbibnamehash}{c6b9dac84d9d74ba87037123f4e21034} + \strng{authornamehash}{c6b9dac84d9d74ba87037123f4e21034} + \strng{authorfullhash}{c6b9dac84d9d74ba87037123f4e21034} + \field{sortinit}{S} + \field{sortinithash}{b164b07b29984b41daf1e85279fbc5ab} + \field{extradatescope}{labelyear} + \field{labeldatesource}{} + \field{labelnamesource}{author} + \field{labeltitlesource}{title} + \field{journaltitle}{Journal of Experimental Biology} + \field{number}{1} + \field{title}{Auditory interneurones in the metathoracic ganglion of the grasshopper Chorthippus biguttulus: I. Morphological and physiological characterization} + \field{volume}{158} + \field{year}{1991} + \field{pages}{391\bibrangedash 410} + \range{pages}{20} + \endentry \entry{suga1960peripheral}{article}{} \name{author}{1}{}{% {{un=0,uniquepart=base,hash=cb8492490b7b1d1c021ccd740577eab6}{% diff --git a/main.blg b/main.blg index dbf97cd..550d31f 100644 --- a/main.blg +++ b/main.blg @@ -1,71 +1,71 @@ [0] Config.pm:307> INFO - This is Biber 2.19 [0] Config.pm:310> INFO - Logfile is 'main.blg' -[35] biber:340> INFO - === Do Feb 12, 2026, 15:55:36 -[42] Biber.pm:419> INFO - Reading 'main.bcf' -[69] Biber.pm:979> INFO - Found 55 citekeys in bib section 0 -[74] Biber.pm:4419> INFO - Processing section 0 -[78] Biber.pm:4610> INFO - Looking for bibtex file 'cite.bib' for section 0 -[80] bibtex.pm:1713> INFO - LaTeX decoding ... -[110] bibtex.pm:1519> INFO - Found BibTeX data source 'cite.bib' -[282] UCollate.pm:68> INFO - Overriding locale 'en-US' defaults 'variable = shifted' with 'variable = non-ignorable' -[282] UCollate.pm:68> INFO - Overriding locale 'en-US' defaults 'normalization = NFD' with 'normalization = prenormalized' -[282] Biber.pm:4239> INFO - Sorting list 'nyt/global//global/global' of type 'entry' with template 'nyt' and locale 'en-US' -[282] Biber.pm:4245> INFO - No sort tailoring available for locale 'en-US' -[304] bbl.pm:660> INFO - Writing 'main.bbl' with encoding 'UTF-8' -[314] bbl.pm:763> INFO - Output to main.bbl -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 10, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 21, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 38, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 49, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 58, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 73, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 82, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 91, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 100, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 109, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 118, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 127, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 136, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 157, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 178, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 187, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 196, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 207, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 218, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 229, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 240, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 249, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 258, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 269, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 278, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 289, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 300, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 309, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 328, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 337, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 400, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 419, warning: 6 characters of junk seen at toplevel -[314] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 428, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 437, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 456, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 491, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 526, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 535, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 556, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 565, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 576, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 587, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 619, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 648, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 658, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 667, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 688, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 709, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 720, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 729, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 749, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 766, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 775, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 800, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_kvhD/347c261ec4135a5723bef5c751f5078f_27267.utf8, line 817, warning: 6 characters of junk seen at toplevel -[315] Biber.pm:133> INFO - WARNINGS: 55 +[36] biber:340> INFO - === Di Feb 17, 2026, 16:10:35 +[43] Biber.pm:419> INFO - Reading 'main.bcf' +[71] Biber.pm:979> INFO - Found 55 citekeys in bib section 0 +[76] Biber.pm:4419> INFO - Processing section 0 +[80] Biber.pm:4610> INFO - Looking for bibtex file 'cite.bib' for section 0 +[82] bibtex.pm:1713> INFO - LaTeX decoding ... +[111] bibtex.pm:1519> INFO - Found BibTeX data source 'cite.bib' +[277] UCollate.pm:68> INFO - Overriding locale 'en-US' defaults 'normalization = NFD' with 'normalization = prenormalized' +[277] UCollate.pm:68> INFO - Overriding locale 'en-US' defaults 'variable = shifted' with 'variable = non-ignorable' +[277] Biber.pm:4239> INFO - Sorting list 'nyt/global//global/global' of type 'entry' with template 'nyt' and locale 'en-US' +[277] Biber.pm:4245> INFO - No sort tailoring available for locale 'en-US' +[299] bbl.pm:660> INFO - Writing 'main.bbl' with encoding 'UTF-8' +[310] bbl.pm:763> INFO - Output to main.bbl +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 10, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 21, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 38, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 49, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 58, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 73, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 82, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 91, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 100, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 109, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 118, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 127, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 136, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 157, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 178, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 187, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 196, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 207, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 218, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 229, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 240, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 249, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 258, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 269, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 278, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 289, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 300, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 309, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 328, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 337, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 400, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 419, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 428, warning: 6 characters of junk seen at toplevel +[310] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 437, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 456, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 491, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 526, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 535, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 556, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 565, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 576, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 587, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 619, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 648, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 658, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 667, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 688, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 709, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 720, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 729, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 749, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 766, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 775, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 800, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:131> WARN - BibTeX subsystem: /tmp/biber_tmp_6HUw/347c261ec4135a5723bef5c751f5078f_117857.utf8, line 817, warning: 6 characters of junk seen at toplevel +[311] Biber.pm:133> INFO - WARNINGS: 55 diff --git a/main.fdb_latexmk b/main.fdb_latexmk index 2408b6f..0c59aee 100644 --- a/main.fdb_latexmk +++ b/main.fdb_latexmk @@ -1,14 +1,14 @@ # Fdb version 4 -["biber main"] 1770908135.92672 "main.bcf" "main.bbl" "main" 1770909740.85496 0 +["biber main"] 1771341035.4003 "main.bcf" "main.bbl" "main" 1771341094.70787 0 "cite.bib" 1770904753.08918 27483 4290db0c91f7b5055e25472ef913f6b4 "" - "main.bcf" 1770909740.80982 112931 2a478116d80ebb1ada7083a24facd6e3 "pdflatex" + "main.bcf" 1771341094.52472 112931 2a478116d80ebb1ada7083a24facd6e3 "pdflatex" (generated) "main.bbl" "main.blg" (rewritten before read) -["pdflatex"] 1770909740.04415 "/home/hartling/phd/paper/paper_2025/main.tex" "main.pdf" "main" 1770909740.85516 0 +["pdflatex"] 1771341093.48122 "/home/hartling/phd/paper/paper_2025/main.tex" "main.pdf" "main" 1771341094.7081 0 "/etc/texmf/web2c/texmf.cnf" 1761560044.43676 475 c0e671620eb5563b2130f56340a5fde8 "" - "/home/hartling/phd/paper/paper_2025/main.tex" 1770909739.95483 39127 a7cd2ca5121e6f89fb995bfcbb00bb76 "" + "/home/hartling/phd/paper/paper_2025/main.tex" 1771341093.40273 39474 270d81ac4d9b5510e0f5b6ffd47d4548 "" "/usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map" 1577235249 3524 cb3e574dea2d1052e39280babc910dc8 "" "/usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex7.tfm" 1246382020 1004 54797486969f23fa377b128694d548df "" "/usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex8.tfm" 1246382020 988 bdf658c3bfc2d96d3c8b02cfc1c94c20 "" @@ -151,10 +151,12 @@ "/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1761648508 8213325 7fd20752ab46ff9aa583e4973d7433df "" "figures/fig_auditory_pathway.pdf" 1769682029.31297 1284536 cd071429286586e390a99d74f742d2d5 "" "figures/fig_auditory_pathway.pdf_tex" 1769682029.31397 2624 f8d79af301f26c4639670ba4283887a2 "" - "main.aux" 1770909740.80382 10828 27979d381c53a50541bc62175148bf97 "pdflatex" - "main.bbl" 1770908136.51937 91039 1380dc8c93d2855fdb132cc5a40ad52f "biber main" - "main.run.xml" 1770909740.80982 2335 a049bc26a7f032e842ce55de5bc38328 "pdflatex" - "main.tex" 1770909739.95483 39127 a7cd2ca5121e6f89fb995bfcbb00bb76 "" + "figures/pathway_stages_feat.pdf" 1771340650.40761 82316897 05ba2bb6e8749f206ed48a1452e502fe "" + "figures/pathway_stages_pre.pdf" 1771340634.77974 417332 f29087bfa1db0ef1a7ad1c27dc1875b2 "" + "main.aux" 1771341094.51872 11126 896020d94c8241fd7543e4bc1dff8f68 "pdflatex" + "main.bbl" 1771341036.00124 91039 1380dc8c93d2855fdb132cc5a40ad52f "biber main" + "main.run.xml" 1771341094.52472 2335 a049bc26a7f032e842ce55de5bc38328 "pdflatex" + "main.tex" 1771341093.40273 39474 270d81ac4d9b5510e0f5b6ffd47d4548 "" (generated) "main.aux" "main.bcf" diff --git a/main.fls b/main.fls index 25086bb..2e69dbf 100644 --- a/main.fls +++ b/main.fls @@ -275,11 +275,21 @@ INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr10.tfm INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx10.tfm INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm +INPUT ./figures/pathway_stages_pre.pdf +INPUT ./figures/pathway_stages_pre.pdf +INPUT ./figures/pathway_stages_pre.pdf +INPUT ./figures/pathway_stages_pre.pdf +INPUT ./figures/pathway_stages_pre.pdf INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi10.tfm INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmex10.tfm INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam10.tfm INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm10.tfm +INPUT ./figures/pathway_stages_feat.pdf +INPUT ./figures/pathway_stages_feat.pdf +INPUT ./figures/pathway_stages_feat.pdf +INPUT ./figures/pathway_stages_feat.pdf +INPUT ./figures/pathway_stages_feat.pdf INPUT main.aux INPUT main.run.xml OUTPUT main.run.xml diff --git a/main.log b/main.log index efb418b..0fd316f 100644 --- a/main.log +++ b/main.log @@ -1,4 +1,4 @@ -This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) (preloaded format=pdflatex 2025.10.28) 12 FEB 2026 16:22 +This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) (preloaded format=pdflatex 2025.10.28) 17 FEB 2026 16:11 entering extended mode restricted \write18 enabled. file:line:error style messages enabled. @@ -773,12 +773,23 @@ Overfull \hbox (4.40714pt too wide) in paragraph at lines 393--402 \OT1/cmr/m/n/12 the sub-se-quent lo-cal in-terneu-rons ([]; []) [] -[7] [8] -Overfull \hbox (9.43962pt too wide) in paragraph at lines 511--511 + +File: figures/pathway_stages_pre.pdf Graphic file (type pdf) + +Package pdftex.def Info: figures/pathway_stages_pre.pdf used on input line 414. +(pdftex.def) Requested size: 455.24411pt x 170.7161pt. +[7] [8 <./figures/pathway_stages_pre.pdf>] [9] + +File: figures/pathway_stages_feat.pdf Graphic file (type pdf) + +Package pdftex.def Info: figures/pathway_stages_feat.pdf used on input line 521. +(pdftex.def) Requested size: 455.24411pt x 170.7161pt. + +Overfull \hbox (9.43962pt too wide) in paragraph at lines 527--527 []\OT1/cmr/bx/n/17.28 Two mech-a-nisms driv-ing the emer-gence of intensity- [] -[9] [10] [11] [12] [13] (./main.aux) +[10 <./figures/pathway_stages_feat.pdf>] [11] [12] [13] [14] (./main.aux) *********** LaTeX2e <2023-11-01> patch level 1 L3 programming layer <2024-01-22> @@ -788,18 +799,18 @@ Package logreq Info: Writing requests to 'main.run.xml'. ) Here is how much of TeX's memory you used: - 20711 strings out of 474222 - 446040 string characters out of 5748732 + 20727 strings out of 474222 + 446637 string characters out of 5748732 1937975 words of memory out of 5000000 - 42696 multiletter control sequences out of 15000+600000 + 42712 multiletter control sequences out of 15000+600000 569035 words of font info for 78 fonts, out of 8000000 for 9000 1143 hyphenation exceptions out of 8191 94i,19n,93p,955b,1732s stack positions out of 10000i,1000n,20000p,200000b,200000s -Output written on main.pdf (13 pages, 1450935 bytes). +Output written on main.pdf (14 pages, 84180383 bytes). PDF statistics: - 1109 PDF objects out of 1200 (max. 8388607) - 702 compressed objects within 8 object streams + 1172 PDF objects out of 1200 (max. 8388607) + 714 compressed objects within 8 object streams 0 named destinations out of 1000 (max. 500000) - 18 words of extra memory for PDF output out of 10000 (max. 10000000) + 28 words of extra memory for PDF output out of 10000 (max. 10000000) diff --git a/main.pdf b/main.pdf index a364d94..0d01294 100644 Binary files a/main.pdf and b/main.pdf differ diff --git a/main.synctex.gz b/main.synctex.gz index 878e91f..70b4894 100644 Binary files a/main.synctex.gz and b/main.synctex.gz differ diff --git a/main.tex b/main.tex index 64b077f..6798930 100644 --- a/main.tex +++ b/main.tex @@ -409,6 +409,14 @@ intensity-adapted envelope $\adapt(t)$ is then passed on from the local interneurons to the ascending neurons, where it serves as the basis for the following feature extraction stage. +\begin{figure}[!ht] + \centering + \includegraphics[width=\textwidth]{figures/pathway_stages_pre.pdf} + \caption{} + \label{fig:pre} +\end{figure} +\FloatBarrier + \subsection{Feature extraction by individual neurons} The ascending neurons extract and encode a number of different features of the @@ -508,6 +516,14 @@ the resulting high-dimensional feature space, different species-specific song patterns are characterized by a distinct combination of feature values, which can be read out by a simple linear classifier. +\begin{figure}[!ht] + \centering + \includegraphics[width=\textwidth]{figures/pathway_stages_feat.pdf} + \caption{} + \label{fig:stages_feat} +\end{figure} +\FloatBarrier + \section{Two mechanisms driving the emergence of intensity-invariant song representation} \textbf{Definition of invariance (general, systemic):}\\ diff --git a/python/fig_pathway_stages.py b/python/fig_pathway_stages.py index 73b0c68..bf1ebef 100644 --- a/python/fig_pathway_stages.py +++ b/python/fig_pathway_stages.py @@ -1,34 +1,123 @@ -import glob import plotstyle_plt +import glob import numpy as np import matplotlib.pyplot as plt +from itertools import product from thunderhopper.modeltools import load_data from IPython import embed +def prepare_fig(nrows, ncols, width=8, height=None, rheight=2, + left=0.01, right=0.95, bottom=0.01, top=0.95, + wspace=0.4, hspace=0.4): + if height is None: + height = rheight * nrows + fig = plt.figure(figsize=(width, height)) + grid = fig.add_gridspec(nrows=nrows, ncols=ncols, wspace=wspace, hspace=hspace, + left=left, right=right, top=top, bottom=bottom) + axes = np.zeros((nrows, ncols), dtype=object) + for i, j in product(range(nrows), range(ncols)): + axes[i, j] = fig.add_subplot(grid[i, j]) + axes[i, j].set_facecolor('none') + return fig, axes + +def xlimits(ax, time, minval=None, maxval=None, pad=0.05): + limits = [minval, maxval] + if minval is None: + limits[0] = time[0] + if maxval is None: + limits[1] = time[-1] + if pad is not None and minval is None: + limits[0] -= (limits[1] - limits[0]) * pad + if pad is not None and maxval is None: + limits[1] += (limits[1] - limits[0]) * pad + return ax.set_xlim(limits) + +def ylimits(ax, signal, minval=None, maxval=None, pad=0.05): + limits = [minval, maxval] + if minval is None: + limits[0] = signal.min() + if maxval is None: + limits[1] = signal.max() + if pad is not None and minval is None: + limits[0] -= (limits[1] - limits[0]) * pad + if pad is not None and maxval is None: + limits[1] += (limits[1] - limits[0]) * pad + return ax.set_ylim(limits) + +def super_xlabel(label, fig, high_ax, low_ax, **kwargs): + x = (low_ax.get_position().x0 + high_ax.get_position().x1) / 2 + fig.supxlabel(label, x=x, **kwargs) + return None + +def super_ylabel(label, fig, high_ax, low_ax, **kwargs): + y = (low_ax.get_position().y0 + high_ax.get_position().y1) / 2 + fig.supylabel(label, y=y, **kwargs) + return None + +def hide_axis(ax, side='bottom'): + ax.spines[side].set_visible(False) + params = {side: False, 'label' + side: False} + ax.tick_params(axis='x' if side in ['top', 'bottom'] else 'y', + which='both', **params) + return None + +def plot_line(ax, time, signal, ymin=None, ymax=None, xmin=None, xmax=None, + xpad=None, ypad=0.05, **kwargs): + ax.plot(time, signal, **kwargs) + xlimits(ax, time, minval=xmin, maxval=xmax, pad=xpad) + ylimits(ax, signal, minval=ymin, maxval=ymax, pad=ypad) + return None + +def plot_barcode(ax, time, binary, offset=0.1, xmin=None, xmax=None, **kwargs): + if xmin is None: + xmin = time[0] + if xmax is None: + xmax = time[-1] + lower, upper = 0, 1 + for i in range(binary.shape[1]): + ax.fill_between(time, lower, upper, where=binary[:, i], **kwargs) + if i < binary.shape[1] - 1: + lower += offset + 1 + upper += offset + 1 + xlimits(ax, time, minval=xmin, maxval=xmax) + ax.set_ylim(0, upper) + ax.axis('off') + return None + +def indicate_zoom(fig, high_ax, low_ax, zoom_abs, **kwargs): + y0 = low_ax.get_position().y0 + y1 = high_ax.get_position().y1 + transform = low_ax.transData + fig.transFigure.inverted() + x0 = transform.transform((zoom_abs[0], 0))[0] + x1 = transform.transform((zoom_abs[1], 0))[0] + rect = plt.Rectangle((x0, y0), x1 - x0, y1 - y0, + transform=fig.transFigure, **kwargs) + fig.add_artist(rect) + return None + + # GENERAL SETTINGS: -data_paths = glob.glob('../data/processed/*.npz') -stages = ['filt', 'env', 'log', 'inv', - 'conv', 'bi', 'feat'] -channel = 0 +target = 'Omocestus_rufipes' +data_paths = glob.glob(f'../data/processed/{target}*.npz') +stages = ['filt', 'env', 'log', 'inv', 'conv', 'bi', 'feat'] +save_name = '../figures/pathway_stages' # PLOT SETTINGS: fig_kwargs = dict( - figsize = np.array([16, 9]) * 0.75, - layout = 'constrained', - sharex = 'col', - sharey = 'row' + width=16 / 2.54 * 2, + height=6 / 2.54 * 2, + rheight=2 / 2.54 * 2, ) -zoom_rel = np.array([0.4, 0.6]) -colors = dict( - filt='k', - env='k', - log='k', - inv='k', - conv='k', - bi='k', - feat='k' +grid_kwargs = dict( + wspace=0.15, + hspace=0.3, + left=0.1, + right=0.95, + bottom=0.1, + top=0.95 ) -linewidths = dict( +colors = {s: c.item() for s, c in dict(np.load('../data/stage_colors.npz')).items()} +lw_full = dict( filt=0.25, env=0.5, log=0.5, @@ -37,11 +126,24 @@ linewidths = dict( bi=1, feat=1 ) +lw_zoom = dict( + filt=0.25, + env=0.75, + log=0.75, + inv=0.75, + conv=0.5, + bi=1, + feat=0.75 +) +zoom_rel = np.array([0.3, 0.4]) +zoom_kwargs = dict( + color=(0.85, 0.85, 0.85), + zorder=0, + linewidth=0 +) # EXECUTION: for data_path in data_paths: - if 'Gomphocerippus' in data_path: - continue print(f'Processing {data_path}') # Load overall data: @@ -55,79 +157,80 @@ for data_path in data_paths: # PART I: PREPROCESSING STAGE - fig, axes = plt.subplots(4, 2, **fig_kwargs) - fig.supylabel('amplitude', fontsize=plt.rcParams['axes.labelsize']) - fig.supxlabel('time [s]', fontsize=plt.rcParams['axes.labelsize']) + fig, axes = prepare_fig(4, 2, **fig_kwargs, **grid_kwargs) + super_xlabel('time [s]', fig, axes[0, 0], axes[0, -1]) + super_ylabel('amplitude', fig, axes[0, 0], axes[-1, 0]) # Bandpass-filtered signal: - signal = data['filt'][:, channel] ax_full, ax_zoom = axes[0, :] - c, lw = colors['filt'], linewidths['filt'] - ax_full.plot(t_full, signal, c=c, lw=lw) - ax_zoom.plot(t_zoom, signal[zoom_mask], c=c, lw=lw) - ax_full.set_ylim(signal.min(), signal.max()) + plot_line(ax_full, t_full, data['filt'], c=colors['filt'], lw=lw_full['filt']) + plot_line(ax_zoom, t_zoom, data['filt'][zoom_mask], c=colors['filt'], lw=lw_zoom['filt']) + hide_axis(ax_full, 'bottom') + hide_axis(ax_zoom, 'bottom') + hide_axis(ax_zoom, 'left') # Signal envelope: - signal = data['env'][:, channel] ax_full, ax_zoom = axes[1, :] - c, lw = colors['env'], linewidths['env'] - ax_full.plot(t_full, signal, c=c, lw=lw) - ax_zoom.plot(t_zoom, signal[zoom_mask], c=c, lw=lw) - ax_full.set_ylim(0, signal.max()) + plot_line(ax_full, t_full, data['env'], ymin=0, c=colors['env'], lw=lw_full['env']) + plot_line(ax_zoom, t_zoom, data['env'][zoom_mask], ymin=0, c=colors['env'], lw=lw_zoom['env']) + hide_axis(ax_full, 'bottom') + hide_axis(ax_zoom, 'bottom') + hide_axis(ax_zoom, 'left') # Logarithmic envelope: - signal = data['log'][:, channel] ax_full, ax_zoom = axes[2, :] - c, lw = colors['log'], linewidths['log'] - ax_full.plot(t_full, signal, c=c, lw=lw) - ax_zoom.plot(t_zoom, signal[zoom_mask], c=c, lw=lw) - ax_full.set_ylim(signal.min(), 0) + plot_line(ax_full, t_full, data['log'], ymax=0, c=colors['log'], lw=lw_full['log']) + plot_line(ax_zoom, t_zoom, data['log'][zoom_mask], ymax=0, c=colors['log'], lw=lw_zoom['log']) + hide_axis(ax_full, 'bottom') + hide_axis(ax_zoom, 'bottom') + hide_axis(ax_zoom, 'left') # Adapted envelope: - signal = data['inv'][:, channel] ax_full, ax_zoom = axes[3, :] - c, lw = colors['inv'], linewidths['inv'] - ax_full.plot(t_full, signal, c=c, lw=lw) - ax_zoom.plot(t_zoom, signal[zoom_mask], c=c, lw=lw) - ax_full.set_ylim(signal.min(), signal.max()) + plot_line(ax_full, t_full, data['inv'], c=colors['inv'], lw=lw_full['inv']) + plot_line(ax_zoom, t_zoom, data['inv'][zoom_mask], c=colors['inv'], lw=lw_zoom['inv']) + hide_axis(ax_zoom, 'left') # Posthoc adjustments: ax_full.set_xlim(t_full[0], t_full[-1]) ax_zoom.set_xlim(t_zoom[0], t_zoom[-1]) + indicate_zoom(fig, axes[0, 0], axes[-1, 0], zoom_abs, **zoom_kwargs) + indicate_zoom(fig, axes[0, 1], axes[-1, 1], zoom_abs, **zoom_kwargs) + if save_name is not None: + fig.savefig(f'{save_name}_pre.pdf') # PART II: FEATURE EXTRACTION STAGE: - fig, axes = plt.subplots(3, 2, **fig_kwargs) - fig.supylabel('amplitude', fontsize=plt.rcParams['axes.labelsize']) - fig.supxlabel('time [s]', fontsize=plt.rcParams['axes.labelsize']) + fig, axes = prepare_fig(3, 2, **fig_kwargs, **grid_kwargs) + super_xlabel('time [s]', fig, axes[0, 0], axes[0, -1]) + super_ylabel('amplitude', fig, axes[0, 0], axes[-1, 0]) # Convolutional filter responses: - signal = data['conv'][:, :, channel] ax_full, ax_zoom = axes[0, :] - c, lw = colors['conv'], linewidths['conv'] - ax_full.plot(t_full, signal, c=c, lw=lw) - ax_zoom.plot(t_zoom, signal[zoom_mask, :], c=c, lw=lw) - ax_full.set_ylim(signal.min(), signal.max()) + plot_line(ax_full, t_full, data['conv'], c=colors['conv'], lw=lw_full['conv']) + plot_line(ax_zoom, t_zoom, data['conv'][zoom_mask, :], c=colors['conv'], lw=lw_zoom['conv']) + hide_axis(ax_full, 'bottom') + hide_axis(ax_zoom, 'bottom') + hide_axis(ax_zoom, 'left') # Binary responses: - signal = data['bi'][:, :, channel] ax_full, ax_zoom = axes[1, :] - c, lw = colors['bi'], linewidths['bi'] - ax_full.plot(t_full, signal, c=c, lw=lw) - ax_zoom.plot(t_zoom, signal[zoom_mask, :], c=c, lw=lw) - ax_full.set_ylim(signal.min(), signal.max()) + plot_barcode(ax_full, t_full, data['bi'], color=colors['bi']) + plot_barcode(ax_zoom, t_zoom, data['bi'][zoom_mask, :], color=colors['bi']) # Finalized features: - signal = data['feat'][:, :, channel] ax_full, ax_zoom = axes[2, :] - c, lw = colors['feat'], linewidths['feat'] - ax_full.plot(t_full, signal, c=c, lw=lw) - ax_zoom.plot(t_zoom, signal[zoom_mask, :], c=c, lw=lw) - ax_full.set_ylim(0, 1) + plot_line(ax_full, t_full, data['feat'], ymin=0, ymax=1, c=colors['feat'], lw=lw_full['feat']) + plot_line(ax_zoom, t_zoom, data['feat'][zoom_mask, :], ymin=0, ymax=1, c=colors['feat'], lw=lw_zoom['feat']) + hide_axis(ax_zoom, 'left') # Posthoc adjustments: ax_full.set_xlim(t_full[0], t_full[-1]) ax_zoom.set_xlim(t_zoom[0], t_zoom[-1]) + indicate_zoom(fig, axes[0, 0], axes[-1, 0], zoom_abs, **zoom_kwargs) + indicate_zoom(fig, axes[0, 1], axes[-1, 1], zoom_abs, **zoom_kwargs) + if save_name is not None: + fig.savefig(f'{save_name}_feat.pdf') plt.show() diff --git a/python/plotstyle_plt.py b/python/plotstyle_plt.py index 919545f..72c167e 100644 --- a/python/plotstyle_plt.py +++ b/python/plotstyle_plt.py @@ -8,15 +8,18 @@ mpl.rcParams['font.style'] = 'normal' mpl.rcParams['font.family'] = 'serif' mpl.rcParams['mathtext.fontset'] = 'cm' mpl.rcParams['mathtext.default'] = 'regular' + # Font sizes: mpl.rcParams['font.size'] = 14 mpl.rcParams['figure.titlesize'] = 15 +mpl.rcParams['figure.labelsize'] = 14 mpl.rcParams['axes.labelsize'] = 14 mpl.rcParams['axes.titlesize'] = 14 mpl.rcParams['xtick.labelsize'] = 13 mpl.rcParams['ytick.labelsize'] = 13 mpl.rcParams['legend.fontsize'] = 14 mpl.rcParams['legend.title_fontsize'] = 14 + # Font weights: single_weight = ['normal', 'bold'][0] mpl.rcParams['font.weight'] = single_weight @@ -32,6 +35,7 @@ mpl.rcParams['figure.raise_window'] = True # mpl.rcParams['savefig.dpi'] = 500 # Axes parameters: +mpl.rcParams['axes.linewidth'] = 1.5 mpl.rcParams['axes.spines.top'] = False mpl.rcParams['axes.spines.right'] = False mpl.rcParams['axes.xmargin'] = 0 @@ -39,10 +43,20 @@ mpl.rcParams['axes.ymargin'] = 0 mpl.rcParams['axes.autolimit_mode'] = 'round_numbers' mpl.rcParams['axes.labelpad'] = 3 -# Tick parameters: -mpl.rcParams['xtick.major.pad'] = 5 -mpl.rcParams['ytick.major.pad'] = 5 +# Major tick parameters: +mpl.rcParams['xtick.major.size'] = 5 +mpl.rcParams['xtick.major.width'] = 1.5 +mpl.rcParams['xtick.major.pad'] = 3.5 +mpl.rcParams['ytick.major.size'] = 5 +mpl.rcParams['ytick.major.width'] = 1.5 +mpl.rcParams['ytick.major.pad'] = 3.5 + +# Minor tick parameters: +mpl.rcParams['xtick.minor.size'] = 2 +mpl.rcParams['xtick.minor.width'] = 1 +mpl.rcParams['ytick.minor.size'] = 2 +mpl.rcParams['ytick.minor.width'] = 1 # Legend parameters: mpl.rcParams['legend.frameon'] = False -mpl.rcParams['legend.scatterpoints'] = 3 \ No newline at end of file +mpl.rcParams['legend.scatterpoints'] = 3 diff --git a/python/save_snippet_data.py b/python/save_snippet_data.py new file mode 100644 index 0000000..b9bbfa9 --- /dev/null +++ b/python/save_snippet_data.py @@ -0,0 +1,61 @@ +import numpy as np +from thunderhopper.filetools import search_files, crop_paths +from thunderhopper.model import configuration, process_signal +from thunderhopper.modeltools import load_data +from IPython import embed + +## SETTINGS: + +# General: +overwrite = True +input_folder = '../data/raw/' +output_folder = '../data/processed/' +stages = ['raw', 'filt', 'env', 'log', 'inv', 'conv', 'bi', 'feat', 'norm'] +if True: + # Overwrites edited: + stages.append('songs') + +# Interactivity: +reload_saved = False +gui = False + +# Processing: +env_rate = 44100.0 +feat_rate = 44100.0 +sigmas = [0.001, 0.002, 0.004, 0.008, 0.016, 0.032] +types = [1, -1, 2, -2, 3, -3, 4, -4, 5, -5, + 6, -6, 7, -7, 8, -8, 9, -9, 10, -10] +config = configuration(env_rate, feat_rate, types=types, sigmas=sigmas) +config.update({ + 'channel': 0, + 'rate_ratio': None, + 'env_fcut': 250, + 'inv_fcut': 5, + 'feat_thresh': np.load('../data/kernel_thresholds.npy') * 0.1, + 'feat_fcut': 0.5, + 'label_channels': 0, + 'label_thresh': 0.5, + }) + +## PREPARATION: + +# Fetch WAV recording files: +input_paths = search_files(ext='wav', dir=input_folder) +path_names = crop_paths(input_paths) + +# PROCESSING: + +# Run processing pipeline: +for path, name in zip(input_paths, path_names): + print('Processing:', name) + + # Fetch and store representations: + save = None if output_folder is None else output_folder + f'{name}.npz' + process_signal(config, stages, path, save=save, + label_edit=gui, overwrite=overwrite) + + # Cross-control: + if reload_saved: + data, params = load_data(save, stages, ['songs', 'noise']) + embed() +print('Done.') diff --git a/python/save_stage_colors.py b/python/save_stage_colors.py new file mode 100644 index 0000000..5b20005 --- /dev/null +++ b/python/save_stage_colors.py @@ -0,0 +1,195 @@ +import numpy as np +import matplotlib.pyplot as plt +from tkinter.colorchooser import askcolor +from IPython import embed + + +def is_hex_color(color): + if isinstance(color, str) and color.startswith('#') and len(color) == 7: + try: + int(color[1:], 16) + return True + except ValueError: + return False + return False + + +def is_rgb_color(color): + if isinstance(color, (tuple, list)) and len(color) == 3: + return all(isinstance(c, int) and 0 <= c <= 255 for c in color) + return False + + +def hex_to_rgb(color): + color = color.lstrip('#') + return tuple(int(color[i:i+2], 16) for i in (0, 2, 4)) + + +def rgb_to_hex(color): + return '#{:02x}{:02x}{:02x}'.format(*color) + + +def whiten_color(color, factors): + is_hex = is_hex_color(color) + if is_hex: + color = hex_to_rgb(color) + elif not is_rgb_color(color): + raise ValueError('Color format must be hex string or RGB tuple.') + + whitened = tuple(min(255, int(c + (255 - c) * f)) for c, f in zip(color, factors)) + return rgb_to_hex(whitened) if is_hex else whitened + + +def color_selector(n=5, colors=None, save=None, labels=None, hex=True, + back_color='w', edge_color='k', edge_width=2): + + + def pick_color(color='#ffffff', hex=True): + color = askcolor(initialcolor=color)[hex] + return color + + + def update_color(artists, color): + for i, artist in enumerate(artists): + if isinstance(artist, plt.Rectangle): + # Update patch colors: + artist.set_fc(color) + if i in [0, 1]: + artist.set_ec(color) + elif isinstance(artist, plt.Line2D): + # Update marker colors: + artist.set_mfc(color) + if i in [0, 1]: + artist.set_mec(color) + fig.canvas.draw() + return None + + + # Prepare colors: + if colors is None: + colors = ['#ffffff' for _ in range(n)] + start_colors = colors.copy() + n = len(colors) + plt.ion() + + # Prepare graphical interface: + fig, ax = plt.subplots(figsize=(10, 2), layout='constrained') + ax.set_facecolor(back_color) + ax.set_xlim(0, n) + ax.set_ylim(0, 4) + ax.axis('off') + + # Add different color indicators: + artist_groups, group_inds = {}, {} + for i, color in enumerate(colors): + + # Color on background, uniform edge: + p1 = ax.add_patch(plt.Rectangle((i, 0), 1, 1, fc=color, ec=color)) + l1 = ax.plot(i + 0.5, 1.5, marker='o', ms=20, mfc=color, mec=color)[0] + + # Color on background, black edge: + p2 = ax.add_patch(plt.Rectangle((i, 3), 1, 1, fc=color, ec=edge_color, lw=edge_width)) + l2 = ax.plot(i + 0.5, 2.5, marker='o', ms=20, mfc=color, mec=edge_color, mew=edge_width)[0] + + # Update artist mappings: + handles = [p1, l1, l2, p2] + artist_groups[i] = handles + for handle in handles: + handle.set_picker(True) + group_inds[handle] = i + + # Initialize memory variables for avoiding assignments: + swap_groups, swap_colors = [None, None], [None, None] + focus_group, focus_color = [None], [None, None] + + + # Interactivity: + def on_key(event): + + # Abort and retry: + if event.key == 'q': + print('\nRestarting with original settings...') + plt.close(fig) + return color_selector(n, start_colors, save, labels, hex, + back_color, edge_color, edge_width) + + # Exit without saving: + elif event.key == 'escape': + print('\nExiting without saving...') + plt.close(fig) + return None + + # Accept and save colors to file: + elif event.key == 'enter' and save is not None: + if labels is not None: + # Convert to file dictionary and write to npz file: + data = {str(label): col for label, col in zip(labels, colors)} + np.savez(f'{save}.npz', **data) + else: + # Write array (n, 3) or (n,) to npy file: + np.save(f'{save}.npy', np.array(colors)) + print(f'\nSaved {n} colors to file: {save}') + plt.close(fig) + return None + + + def on_pick(event): + + # Pick color for chosen group: + if event.mouseevent.button == 1: + # Update memory variables: + focus_group[0] = group_inds[event.artist] + focus_color[0] = colors[focus_group[0]] + + # Trigger color picker dialogue: + focus_color[1] = pick_color(focus_color[0], hex) + if focus_color[1] is not None: + # Apply, update, and report only if dialogue was not cancelled: + update_color(artist_groups[focus_group[0]], focus_color[1]) + colors[focus_group[0]] = focus_color[1] + print(f'\nUpdated color {focus_group[0] + 1} / {n}: {focus_color[1]}') + + # Select 1st color to swap: + elif event.mouseevent.button == 3: + # Update memory variables and report: + swap_groups[0] = group_inds[event.artist] + swap_colors[0] = colors[swap_groups[0]] + print(f'\nSelected 1st swap color: {swap_groups[0] + 1} / {n}') + + # Select 2nd color to swap and execute: + elif swap_groups[0] is not None and event.mouseevent.button == 2: + # Update memory variables and report: + swap_groups[1] = group_inds[event.artist] + swap_colors[1] = colors[swap_groups[1]] + print(f'Selected 2nd swap color: {swap_groups[1] + 1} / {n}') + print(f'Swapping colors: {swap_groups[0] + 1} <-> {swap_groups[1] + 1}') + + # Swap colors: + for i in [0, 1]: + # Apply to artist group and update global color list: + update_color(artist_groups[swap_groups[i]], swap_colors[1 - i]) + colors[swap_groups[i]] = swap_colors[1 - i] + + # Reset memory variables: + swap_groups[0], swap_groups[1] = None, None + swap_colors[0], swap_colors[1] = None, None + + # Establish interactivity: + plt.connect('key_press_event', on_key) + plt.connect('pick_event', on_pick) + plt.ioff() + return colors + + +# Settings: +stages = ['filt', 'env', 'log', 'inv', 'conv', 'bi', 'feat'] +file_name = None#'../data/stage_colors' +colors = None +if True: + colors = dict(np.load('../data/stage_colors.npz')) + colors = [colors[stage].item() for stage in colors.keys()] + +# Execution: +colors = color_selector(len(stages), colors, save=file_name, labels=stages, hex=True) +plt.show() +embed()