├── .gitignore ├── 1D-2D cross-connection ├── 1d-2d_cross-connection.tex └── README.md ├── 2D Convolution ├── 2d_convolution.tex └── README.md ├── A3C execution ├── README.md └── a3c_execution.tex ├── A3C neural network ├── README.md └── a3c_neural_network.tex ├── Amplitude modulation ├── README.md └── amplitude_modulation.tex ├── BWT ├── README.md └── bwt.tex ├── Bidirectional long short-term memory ├── README.md └── bidirectional_long_short-term_memory.tex ├── CRT rendering ├── README.md └── crt_rendering.tex ├── Convolutional autoencoder ├── README.md └── convolutional_autoencoder.tex ├── Convolutional cross-connection ├── README.md └── convolutional_cross-connection.tex ├── Coordinate systems ├── README.md └── coordinate_systems.tex ├── CycleGAN ├── README.md └── cyclegan.tex ├── DNA ├── README.md └── dna.tex ├── Deep Graph Infomax ├── README.md └── deep_graph_infomax.tex ├── Deep belief network ├── README.md └── deep_belief_network.tex ├── Dropout ├── README.md └── dropout.tex ├── Emulator modules ├── README.md └── emulator_modules.tex ├── Fetch-decode-execute cycle ├── README.md └── fetch-decode-execute_cycle.tex ├── Frequency modulation ├── README.md └── frequency_modulation.tex ├── Fully-connected cross-connection ├── README.md └── fully-connected_cross-connection.tex ├── GAT layer ├── README.md └── gat_layer.tex ├── GMHMM ├── README.md └── gmhmm.tex ├── GameBoy joypad register ├── README.md └── gameboy_joypad_register.tex ├── GameBoy palette translation ├── README.md └── gameboy_palette_translation.tex ├── GameBoy tiling system ├── README.md └── gameboy_tiling_system.tex ├── Gene expression ├── README.md └── gene_expression.tex ├── Generative adversarial network ├── README.md └── generative_adversarial_network.tex ├── Graph convolution ├── README.md └── graph_convolution.tex ├── HMM transition smoothing ├── README.md └── hmm_transition_smoothing.tex ├── Hamiltonian graph ├── README.md └── hamiltonian_graph.tex ├── Hierarchical graph classifier ├── README.md └── hierarchical_graph_classifier.tex ├── IQ sampling ├── README.md └── iq_sampling.tex ├── Instruction execution ├── README.md └── instruction_execution.tex ├── LEGO Deep learning ├── README.md └── lego_deep_learning.tex ├── LICENSE ├── Long short-term memory ├── README.md └── long_short-term_memory.tex ├── MCL ├── README.md └── mcl.tex ├── Maximum flow problem ├── README.md └── maximum_flow_problem.tex ├── Message passing neural network ├── README.md └── message_passing_neural_network.tex ├── Multilayer network ├── README.md └── multilayer_network.tex ├── Multilayer perceptron ├── README.md └── multilayer_perceptron.tex ├── Multiplex chain GMHMM (beta) ├── README.md └── multiplex_chain_gmhmm_beta.tex ├── Multiplex chain GMHMM ├── README.md └── multiplex_chain_gmhmm.tex ├── Multiplex epidemics-awareness network ├── README.md └── multiplex_epidemics-awareness_network.tex ├── Multiplex network underlying graph ├── README.md └── multiplex_network_underlying_graph.tex ├── Progressive alignment ├── README.md └── progressive_alignment.tex ├── Progressive neural network ├── README.md └── progressive_neural_network.tex ├── README.md ├── RN object extraction ├── README.md └── rn_object_extraction.tex ├── Reinforcement learning greedy policy ├── README.md └── reinforcement_learning_greedy_policy.tex ├── Relational network ├── README.md └── relational_network.tex ├── Sampling ├── README.md └── sampling.tex ├── Self-attention ├── README.md └── self-attention.tex ├── Semi-supervised embedding ├── README.md └── semi-supervised_embedding.tex ├── Semi-supervised learning ├── README.md └── semi-supervised_learning.tex ├── Shortest path problem ├── README.md └── shortest_path_problem.tex ├── Sparse DGI ├── README.md └── sparse_dgi.tex ├── Supervised learning setup ├── README.md └── supervised_learning_setup.tex ├── Variational denoising autoencoder ├── README.md └── variational_denoising_autoencoder.tex ├── Web graph ├── README.md └── web_graph.tex ├── X-CNN ├── README.md └── x-cnn.tex ├── X-LSTM ├── README.md └── x-lstm.tex ├── de Bruijn graph ├── README.md └── de_bruijn_graph.tex ├── git dataflow ├── README.md └── git_dataflow.tex ├── git workflow ├── README.md └── git_workflow.tex ├── muxstep pipeline ├── README.md └── muxstep_pipeline.tex └── À trous convolutions ├── README.md └── a_trous_convolutions.tex /.gitignore: -------------------------------------------------------------------------------- 1 | ## Core latex/pdflatex auxiliary files: 2 | *.aux 3 | *.lof 4 | *.log 5 | *.lot 6 | *.fls 7 | *.out 8 | *.toc 9 | *.fmt 10 | *.fot 11 | *.cb 12 | *.cb2 13 | 14 | ## Intermediate documents: 15 | *.dvi 16 | *-converted-to.* 17 | # these rules might exclude image files for figures etc. 18 | # *.ps 19 | # *.eps 20 | *.pdf 21 | 22 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 23 | *.bbl 24 | *.bcf 25 | *.blg 26 | *-blx.aux 27 | *-blx.bib 28 | *.brf 29 | *.run.xml 30 | 31 | ## Build tool auxiliary files: 32 | *.fdb_latexmk 33 | *.synctex 34 | *.synctex.gz 35 | *.synctex.gz(busy) 36 | *.pdfsync 37 | 38 | ## Auxiliary and intermediate files from other packages: 39 | # algorithms 40 | *.alg 41 | *.loa 42 | 43 | # achemso 44 | acs-*.bib 45 | 46 | # amsthm 47 | *.thm 48 | 49 | # beamer 50 | *.nav 51 | *.snm 52 | *.vrb 53 | 54 | # cprotect 55 | *.cpt 56 | 57 | # fixme 58 | *.lox 59 | 60 | #(r)(e)ledmac/(r)(e)ledpar 61 | *.end 62 | *.?end 63 | *.[1-9] 64 | *.[1-9][0-9] 65 | *.[1-9][0-9][0-9] 66 | *.[1-9]R 67 | *.[1-9][0-9]R 68 | *.[1-9][0-9][0-9]R 69 | *.eledsec[1-9] 70 | *.eledsec[1-9]R 71 | *.eledsec[1-9][0-9] 72 | *.eledsec[1-9][0-9]R 73 | *.eledsec[1-9][0-9][0-9] 74 | *.eledsec[1-9][0-9][0-9]R 75 | 76 | # glossaries 77 | *.acn 78 | *.acr 79 | *.glg 80 | *.glo 81 | *.gls 82 | *.glsdefs 83 | 84 | # gnuplottex 85 | *-gnuplottex-* 86 | 87 | # hyperref 88 | *.brf 89 | 90 | # knitr 91 | *-concordance.tex 92 | # TODO Comment the next line if you want to keep your tikz graphics files 93 | *.tikz 94 | *-tikzDictionary 95 | 96 | # listings 97 | *.lol 98 | 99 | # makeidx 100 | *.idx 101 | *.ilg 102 | *.ind 103 | *.ist 104 | 105 | # minitoc 106 | *.maf 107 | *.mlf 108 | *.mlt 109 | *.mtc 110 | *.mtc[0-9] 111 | *.mtc[1-9][0-9] 112 | 113 | # minted 114 | _minted* 115 | *.pyg 116 | 117 | # morewrites 118 | *.mw 119 | 120 | # mylatexformat 121 | *.fmt 122 | 123 | # nomencl 124 | *.nlo 125 | 126 | # sagetex 127 | *.sagetex.sage 128 | *.sagetex.py 129 | *.sagetex.scmd 130 | 131 | # sympy 132 | *.sout 133 | *.sympy 134 | sympy-plots-for-*.tex/ 135 | 136 | # pdfcomment 137 | *.upa 138 | *.upb 139 | 140 | # pythontex 141 | *.pytxcode 142 | pythontex-files-*/ 143 | 144 | # thmtools 145 | *.loe 146 | 147 | # TikZ & PGF 148 | *.dpth 149 | *.md5 150 | *.auxlock 151 | 152 | # todonotes 153 | *.tdo 154 | 155 | # xindy 156 | *.xdy 157 | 158 | # xypic precompiled matrices 159 | *.xyc 160 | 161 | # endfloat 162 | *.ttt 163 | *.fff 164 | 165 | # Latexian 166 | TSWLatexianTemp* 167 | 168 | ## Editors: 169 | # WinEdt 170 | *.bak 171 | *.sav 172 | 173 | # Texpad 174 | .texpadtmp 175 | 176 | # Kile 177 | *.backup 178 | 179 | # KBibTeX 180 | *~[0-9]* 181 | -------------------------------------------------------------------------------- /1D-2D cross-connection/README.md: -------------------------------------------------------------------------------- 1 | # 1D-2D cross-connection 2 | 3 | ## Notes 4 | 5 | An in-depth view of a 1D-2D cross-connection, (such as the one used by the [XFlow](https://arxiv.org/abs/1709.00572)) publication. Illustrates a reshape-deconvolution operation taking the 1D data to a 2D feature map, and a flatten-dense operation taking the 2D feature map to flat 1D features. The graphic leverages strategically positioned circles to give off the illusion of depth. 6 | 7 | ## Output 8 | 9 | ![XFlow](https://www.dropbox.com/s/kqpgv0pz6yrzeqo/1d-2d_cross-connection.png?raw=1) 10 | 11 | ## Source 12 | 13 | *TBA* 14 | -------------------------------------------------------------------------------- /2D Convolution/2d_convolution.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{matrix, positioning} 5 | 6 | \begin{document} 7 | \begin{tikzpicture} 8 | 9 | \matrix (mtr) [matrix of nodes,row sep=-\pgflinewidth, nodes={draw}] 10 | { 11 | 0 & 1 & 1 & |[fill=red!30]| 1 & |[fill=red!30]| 0 & |[fill=red!30]| 0 & 0\\ 12 | 0 & 0 & 1 & |[fill=red!30]| 1 & |[fill=red!30]| 1 & |[fill=red!30]| 0 & 0\\ 13 | 0 & 0 & 0 & |[fill=red!30]| 1 & |[fill=red!30]| 1 & |[fill=red!30]| 1 & 0\\ 14 | 0 & 0 & 0 & 1 & 1 & 0 & 0\\ 15 | 0 & 0 & 1 & 1 & 0 & 0 & 0\\ 16 | 0 & 1 & 1 & 0 & 0 & 0 & 0\\ 17 | 1 & 1 & 0 & 0 & 0 & 0 & 0\\ 18 | }; 19 | 20 | \draw[very thick, red] (mtr-1-4.north west) rectangle (mtr-3-6.south east); 21 | 22 | \node [below= of mtr-5-4.south] (lm) {$\bf I$}; 23 | 24 | \node[right = 0.2em of mtr] (str) {$*$}; 25 | 26 | \matrix (K) [right=0.2em of str,matrix of nodes,row sep=-\pgflinewidth, nodes={draw, fill=blue!30}] 27 | { 28 | 1 & 0 & 1 \\ 29 | 0 & 1 & 0 \\ 30 | 1 & 0 & 1 \\ 31 | }; 32 | \node [below = of K-3-2.south] (lk) {$\bf K$}; 33 | 34 | \node [right = 0.2em of K] (eq) {$=$}; 35 | 36 | \matrix (ret) [right=0.2em of eq,matrix of nodes,row sep=-\pgflinewidth, nodes={draw}] 37 | { 38 | 1 & 4 & 3 & |[fill=green!30]| 4 & 1\\ 39 | 1 & 2 & 4 & 3 & 3\\ 40 | 1 & 2 & 3 & 4 & 1\\ 41 | 1 & 3 & 3 & 1 & 1\\ 42 | 3 & 3 & 1 & 1 & 0\\ 43 | }; 44 | \node [below = of ret-4-3.south] (lim) {${\bf I} * {\bf K}$}; 45 | 46 | \draw[very thick, green] (ret-1-4.north west) rectangle (ret-1-4.south east); 47 | 48 | \draw[densely dotted, blue, thick] (mtr-1-4.north west) -- (K-1-1.north west); 49 | \draw[densely dotted, blue, thick] (mtr-3-4.south west) -- (K-3-1.south west); 50 | \draw[densely dotted, blue, thick] (mtr-1-6.north east) -- (K-1-3.north east); 51 | \draw[densely dotted, blue, thick] (mtr-3-6.south east) -- (K-3-3.south east); 52 | 53 | \draw[densely dotted, green, thick] (ret-1-4.north west) -- (K-1-1.north west); 54 | \draw[densely dotted, green, thick] (ret-1-4.south west) -- (K-3-1.south west); 55 | \draw[densely dotted, green, thick] (ret-1-4.north east) -- (K-1-3.north east); 56 | \draw[densely dotted, green, thick] (ret-1-4.south east) -- (K-3-3.south east); 57 | 58 | \matrix (K) [right=0.2em of str,matrix of nodes,row sep=-\pgflinewidth, nodes={draw, fill=blue!10}] 59 | { 60 | 1 & 0 & 1 \\ 61 | 0 & 1 & 0 \\ 62 | 1 & 0 & 1 \\ 63 | }; 64 | 65 | \draw[very thick, blue] (K-1-1.north west) rectangle (K-3-3.south east); 66 | 67 | \node[anchor=south east, inner sep=0.01em, blue] at (mtr-1-4.south east) (xx) {\scalebox{.5}{$\times 1$}}; 68 | \node[anchor=south east, inner sep=0.01em, blue] at (mtr-1-5.south east) (xx) {\scalebox{.5}{$\times 0$}}; 69 | \node[anchor=south east, inner sep=0.01em, blue] at (mtr-1-6.south east) (xx) {\scalebox{.5}{$\times 1$}}; 70 | \node[anchor=south east, inner sep=0.01em, blue] at (mtr-2-4.south east) (xx) {\scalebox{.5}{$\times 0$}}; 71 | \node[anchor=south east, inner sep=0.01em, blue] at (mtr-2-5.south east) (xx) {\scalebox{.5}{$\times 1$}}; 72 | \node[anchor=south east, inner sep=0.01em, blue] at (mtr-2-6.south east) (xx) {\scalebox{.5}{$\times 0$}}; 73 | \node[anchor=south east, inner sep=0.01em, blue] at (mtr-3-4.south east) (xx) {\scalebox{.5}{$\times 1$}}; 74 | \node[anchor=south east, inner sep=0.01em, blue] at (mtr-3-5.south east) (xx) {\scalebox{.5}{$\times 0$}}; 75 | \node[anchor=south east, inner sep=0.01em, blue] at (mtr-3-6.south east) (xx) {\scalebox{.5}{$\times 1$}}; 76 | 77 | \end{tikzpicture} 78 | \end{document} 79 | -------------------------------------------------------------------------------- /2D Convolution/README.md: -------------------------------------------------------------------------------- 1 | # 2D Convolution 2 | 3 | ## Notes 4 | 5 | A diagram expressing a two-dimensional convolutional operator as an operation of sliding the kernel matrix across the target image and recording elementwise products. Makes heavy use of the `matrix` environment in TikZ. 6 | 7 | ## Output 8 | 9 | ![2DConvolution](https://www.dropbox.com/s/n14q90gz8a8rbxb/2d_convolution.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Deep learing for complete beginners: Using convolutional nets to recognise images](http://online.cambridgecoding.com/notebooks/cca_admin/convolutional-neural-networks-with-keras), *Cambridge Coding Academy* 14 | -------------------------------------------------------------------------------- /A3C execution/README.md: -------------------------------------------------------------------------------- 1 | # A3C execution 2 | 3 | ## Notes 4 | 5 | A diagram representing a potential intermediate state of execution for the asynchronous advantage actor-critic (A3C) reinforcement learning algorithm---right after Agent 1 concludes its ongoing rollout. It features usage of split rectangles to represent a (partially filled) queue data structure, as well as several interesting positioning hacks. 6 | 7 | ## Output 8 | 9 | ![A3CExec](https://www.dropbox.com/s/zpzwh436y2rc4qf/a3c_execution.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Reinforcement Learning](http://csnedelja.mg.edu.rs/static/resources/v4.0/sre1_ucenje_pv.pdf), [mgcsweek4](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /A3C execution/a3c_execution.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{amsmath} 4 | \usepackage{amssymb} 5 | 6 | \usetikzlibrary{positioning, decorations.pathmorphing, shapes} 7 | 8 | \begin{document} 9 | \begin{tikzpicture} 10 | 11 | \node[rounded rectangle, draw, thick, align=center] (A1) {Agent 1\\$(\theta_1', \psi_1')$}; 12 | \node[rounded rectangle, draw, thick, right= of A1, align=center] (A2) {Agent 2\\$(\theta_2', \psi_2')$}; 13 | \node[rounded rectangle, draw, thick, right= of A2, align=center] (A3) {Agent 3\\$(\theta_3', \psi_3')$}; 14 | \node[right=0.4em of A3, align=center] (mid) {\dots}; 15 | 16 | \node[rounded rectangle, draw, thick, right= of A3, align=center] (AN) {Agent $n$\\$(\theta_n', \psi_n')$}; 17 | 18 | \node[rounded rectangle, draw, thick, yshift=8em, xshift=11.9em, align=center] (G) {Global state\\$(\theta, \psi)$}; 19 | 20 | \node[rounded rectangle, draw, thick, below= of A1, align=center] (E1) {Env. 1\\$(\mathcal{T}, \mathcal{R})$}; 21 | \node[rounded rectangle, draw, thick, below= of A2, align=center] (E2) {Env. 2\\$(\mathcal{T}, \mathcal{R})$}; 22 | \node[rounded rectangle, draw, thick, below= of A3, align=center] (E3) {Env. 3\\$(\mathcal{T}, \mathcal{R})$}; 23 | \node[rounded rectangle, draw, thick, below= of AN, align=center] (EN) {Env. $n$\\$(\mathcal{T}, \mathcal{R})$}; 24 | 25 | \draw[-stealth, very thick] (G) -- node[above=0.5em] {copy} (A1); 26 | 27 | \foreach \x in {2,3,N} 28 | \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,very thick] ([xshift=-0.5em]A\x.south) -- node[left] {$a_t$} ([xshift=-0.5em]E\x.north); 29 | \foreach \x in {2,3,N} 30 | \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,very thick] ([xshift=0.5em]E\x.north) -- node[right] {$r_t, s_{t+1}$} ([xshift=0.5em]A\x.south); 31 | 32 | \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,very thick] (E1.north) -- node[right] {$s_0$} (A1.south); 33 | 34 | \node[rectangle split, 35 | minimum height=0.7cm, 36 | rectangle split horizontal, 37 | rectangle split parts=8, 38 | draw, 39 | anchor=center, 40 | left=2em of G, 41 | rectangle split part fill={white,white,white,white,white,white,white,gray}] 42 | (q1) {}; 43 | 44 | \node[above=0.1em of q1] (N) {Queue}; 45 | 46 | \draw[-stealth, very thick] (A1) -- node[left] {$(\Delta\theta, \Delta\psi)$} (q1); 47 | \draw[-stealth, very thick] (q1) -- node[above, xshift=-1em] {$+$} ([xshift=2.3em,yshift=-0.5em]G.west); 48 | 49 | \end{tikzpicture} 50 | \end{document} 51 | -------------------------------------------------------------------------------- /A3C neural network/README.md: -------------------------------------------------------------------------------- 1 | # A3C neural network 2 | 3 | ## Notes 4 | 5 | A simple illustration of a policy and value network as is commonly utilised by the asynchronous advantage actor-critic (A3C) algorithm for reinforcement learning. Features carefully positioned paths for highlighting the shared parameters of the networks. 6 | 7 | ## Output 8 | 9 | ![A3CNN](https://www.dropbox.com/s/l6ce0g1haf7ga79/a3c_neural_network.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Reinforcement Learning](http://csnedelja.mg.edu.rs/static/resources/v4.0/sre1_ucenje_pv.pdf), [mgcsweek4](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /A3C neural network/a3c_neural_network.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{amsmath} 4 | \usepackage{amssymb} 5 | \usepackage{xcolor} 6 | 7 | \usetikzlibrary{positioning, decorations.pathmorphing} 8 | 9 | \definecolor{olivegreen}{rgb}{0,0.6,0} 10 | 11 | \begin{document} 12 | \begin{tikzpicture} 13 | 14 | \path[rounded corners, fill=blue, fill opacity=0.2] (-0.4, 3.5) -- (-0.4, -3.5) -- (4, -3.5) -- (4, -0.2) -- (5, -0.2) -- (5, 3.5) -- (-0.4, 3.5) -- (-0.4, 0); 15 | \path[rounded corners, fill=red, fill opacity=0.2] (-0.4, -3.5) -- (-0.4, 3.5) -- (4, 3.5) -- (4, -0.2) -- (5, -0.2) -- (5, -3.5) -- (-0.4, -3.5) -- (-0.4, 0); 16 | \path[rounded corners, fill=white] (-0.4, 0) -- (-0.4, -3.5) -- (4, -3.5) -- (4, 3.5) -- (-0.4, 3.5) -- (-0.4, 0); 17 | \path[rounded corners, fill=olivegreen, fill opacity=0.2] (-0.4, 0) -- (-0.4, -3.5) -- (4, -3.5) -- (4, 3.5) -- (-0.4, 3.5) -- (-0.4, 0); 18 | \path [draw, dashed, very thick, rectangle, rounded corners] (-0.4, 0) -- (-0.4, -3.5) -- (5, -3.5) -- (5, 3.5) -- (-0.4, 3.5) -- (-0.4, 0); 19 | 20 | \node[circle, thick, fill=white, draw] (x1) {}; 21 | \node[circle, thick, draw, fill=white, below=1em of x1] (x2) {}; 22 | \node[circle, thick, fill=white, draw, below=1em of x2] (x3) {}; 23 | \node[circle, thick, fill=white, draw, below=1em of x3] (x4) {}; 24 | \node[circle, thick, fill=white, draw, below=1em of x4] (x5) {}; 25 | \node[circle, thick, fill=white, draw, above=1em of x1] (x6) {}; 26 | \node[circle, thick, fill=white, draw, above=1em of x6] (x7) {}; 27 | \node[circle, thick, fill=white, draw, above=1em of x7] (x8) {}; 28 | \node[circle, thick, fill=white, draw, above=1em of x8] (x9) {}; 29 | \node[circle, thick, right=4em of x1, fill=white, draw] (xhh1) {}; 30 | \node[circle, thick, draw, fill=white, below=1em of xhh1] (xhh2) {}; 31 | \node[circle, thick, fill=white, draw, below=1em of xhh2] (xhh3) {}; 32 | \node[circle, thick, fill=white, draw, below=1em of xhh3] (xhh4) {}; 33 | \node[circle, thick, fill=white, draw, above=1em of xhh1] (xhh5) {}; 34 | \node[circle, thick, fill=white, draw, above=1em of xhh5] (xhh6) {}; 35 | \node[circle, thick, fill=white, draw, above=1em of xhh6] (xhh7) {}; 36 | \node[circle, thick, right=8em of x1, fill=white, draw] (xh1) {}; 37 | \node[circle, thick, draw, fill=white, below=1em of xh1] (xh2) {}; 38 | \node[circle, thick, fill=white, draw, below=1em of xh2] (xh3) {}; 39 | \node[circle, thick, fill=white, draw, below=1em of xh3] (xh4) {}; 40 | \node[circle, thick, fill=white, draw, above=1em of xh1] (xh5) {}; 41 | \node[circle, thick, fill=white, draw, above=1em of xh5] (xh6) {}; 42 | \node[circle, thick, fill=white, draw, above=1em of xh6] (xh7) {}; 43 | \node[circle, very thick, fill=blue!30, draw, right=12em of x1, yshift=5em] (hm1) {}; 44 | \node[circle, very thick, draw, fill=blue!30, below=0.5em of hm1] (hm2) {}; 45 | \node[circle, very thick, draw, fill=blue!30, below=0.5em of hm2] (hm3) {}; 46 | \node[circle, very thick, draw, fill=blue!30, above=0.5em of hm1] (hm4) {}; 47 | \node[circle, very thick, draw, fill=blue!30, above=0.5em of hm4] (hm5) {}; 48 | \node[circle, very thick, fill=red!30, draw, right=12em of x1, yshift=-5em] (hs1) {}; 49 | \node[right=1.5em of hm1, blue] (mu1) {$\pi_\theta(s, \alpha_3)$}; 50 | \node[right=1.5em of hm2, blue] (mu2) {$\pi_\theta(s, \alpha_4)$}; 51 | \node[right=1.5em of hm3, blue] (mu3) {$\pi_\theta(s, \alpha_5)$}; 52 | \node[right=1.5em of hm4, blue] (mu4) {$\pi_\theta(s, \alpha_2)$}; 53 | \node[right=1.5em of hm5, blue] (mu5) {$\pi_\theta(s, \alpha_1)$}; 54 | \node[right=1.5em of hs1, red] (s1) {$V_\psi(s)$}; 55 | 56 | \foreach \x in {1,...,9} 57 | \foreach \y in {1,...,7} 58 | \draw[-stealth, thick] (x\x) -- (xhh\y); 59 | 60 | \foreach \x in {1,...,7} 61 | \foreach \y in {1,...,7} 62 | \draw[-stealth, thick] (xhh\x) -- (xh\y); 63 | 64 | \foreach \x in {1,...,7} 65 | \foreach \y in {1,...,5} 66 | \draw[-stealth, thick, blue] (xh\x) -- (hm\y); 67 | 68 | \foreach \x in {1,...,7} 69 | \draw[-stealth, thick, red] (xh\x) -- (hs1); 70 | 71 | \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick, red] (hs1) -- (s1); 72 | 73 | \foreach \x in {1,...,5} 74 | \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick, blue] (hm\x) -- (mu\x); 75 | 76 | \node[left=0.75em of x1] (l1) {$s$}; 77 | \end{tikzpicture} 78 | \end{document} 79 | -------------------------------------------------------------------------------- /Amplitude modulation/README.md: -------------------------------------------------------------------------------- 1 | # Amplitude modulation (AM) 2 | 3 | ## Notes 4 | 5 | Graphical derivation and explanation of an amplitude modulated signal. Makes extensive use of the `axis` environment. 6 | 7 | ## Output 8 | 9 | ![AmplitudeModulation](https://www.dropbox.com/s/sqn5vaknpmimqsr/amplitude_modulation.png?raw=1) 10 | 11 | ## Source 12 | 13 | IQ sampling and FM demodulation using MATLAB, [mgcsweek v2.0](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Amplitude modulation/amplitude_modulation.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{pgfplots} 4 | 5 | \begin{document} 6 | \begin{tikzpicture}[samples=1000, domain=0:10*pi] 7 | 8 | \begin{axis}[ 9 | width=11cm, height=3.5cm, 10 | xtick=\empty, 11 | ytick=\empty, 12 | xlabel={\large $t$}, 13 | ylabel={\large $x(t)$}, 14 | xmin=0, xmax=11*pi, 15 | ymin=-0.5, ymax=7.5, 16 | axis lines = middle, 17 | very thick, 18 | trig format = rad 19 | ] 20 | \addplot [no markers, smooth, thick] {2.5 + 2*sin(0.5*x)}; 21 | \end{axis} 22 | 23 | \begin{axis}[ 24 | at={(0, -2.25cm)}, 25 | width=11cm, height=3.5cm, 26 | xtick=\empty, 27 | ytick=\empty, 28 | xlabel={\large $t$}, 29 | ylabel={\textcolor{blue}{carrier wave}}, 30 | xmin=0, xmax=11*pi, 31 | ymin=-3, ymax=5, 32 | axis lines = middle, 33 | very thick, 34 | trig format = rad 35 | ] 36 | \addplot [no markers, smooth, blue, very thick] {2*sin(6*x)}; 37 | \end{axis} 38 | 39 | \begin{axis}[ 40 | at={(0, -5cm)}, 41 | width=11cm, height=4cm, 42 | xtick=\empty, 43 | ytick=\empty, 44 | xlabel={\large $t$}, 45 | ylabel={\textcolor{red}{AM wave}}, 46 | xmin=0, xmax=11*pi, 47 | ymin=-10, ymax=17, 48 | axis lines = middle, 49 | very thick, 50 | trig format = rad 51 | ] 52 | \addplot [no markers, smooth, red, very thick] {(2.5 + 2*sin(0.5*x)) * 2*sin(6*x)}; 53 | \end{axis} 54 | \end{tikzpicture} 55 | \end{document} 56 | -------------------------------------------------------------------------------- /BWT/README.md: -------------------------------------------------------------------------------- 1 | # Burrows-Wheeler Transform (BWT) 2 | 3 | ## Notes 4 | 5 | A very simple example of the Burrows-Wheeler transform. 6 | 7 | ## Output 8 | 9 | ![BWT](https://www.dropbox.com/s/b722ibdcpgx5tl0/bwt.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Bioinformatics algorithms: analysis of DNA sequences](http://www.csnedelja.mg.edu.rs/static/resources/v1.0/bioinformatics.pdf), [mgcsweek](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /BWT/bwt.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \begin{document} 7 | \begin{tikzpicture}[font=\tt] 8 | \node (T) at (0, 0) {ACAACG}; 9 | \node[below=0.5mm of T] (c1) {$T$}; 10 | \node[align=center] (tbl1) at (2.7, 0) {\textcolor{red}{AACG}AC\\\textcolor{red}{ACAACG}\\\textcolor{red}{ACG}ACA\\\textcolor{red}{CAACG}A\\\textcolor{red}{CG}ACAA\\\textcolor{red}{G}ACAAC}; 11 | \node[align=center] (tbl2) at (5.4, 0) {AACGA\textcolor{red}{C}\\\textcolor{red}{ACAACG}\\ACGAC\textcolor{red}{A}\\CAACG\textcolor{red}{A}\\CGACA\textcolor{red}{A}\\GACAA\textcolor{red}{C}}; 12 | \node[align=left] (BWT) at (8.6, 0) {(CGAAAC, 2)}; 13 | \node[below=0.5mm of BWT] (c2) {$BWT(T)$}; 14 | 15 | \draw[-stealth, very thick] (T) -- (tbl1); 16 | \draw[-stealth, very thick] (tbl1) -- (tbl2); 17 | \draw[-stealth, very thick] (tbl2) -- (BWT); 18 | \end{tikzpicture} 19 | \end{document} 20 | -------------------------------------------------------------------------------- /Bidirectional long short-term memory/README.md: -------------------------------------------------------------------------------- 1 | # Bidirectional long short-term memory 2 | 3 | ## Notes 4 | 5 | A diagram representing a recurrent neural network consisting of several LSTM blocks, processing the input sequence simultaneously forwards and backwards (to exploit both directions of temporal dependence). Contains some rather tight manoeuvering. 6 | 7 | ## Output 8 | 9 | ![BidirectionalLSTM](https://www.dropbox.com/s/incdjruu4x92083/bidirectional_long_short-term_memory.png?raw=1) 10 | 11 | ## Source 12 | 13 | [A trip down long short-term memory lane](http://www.cl.cam.ac.uk/~pv273/slides/LSTMslides.pdf), *University of Cambridge Research Students Lecture Series* 14 | -------------------------------------------------------------------------------- /Bidirectional long short-term memory/bidirectional_long_short-term_memory.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \begin{document} 7 | \begin{tikzpicture} 8 | \node[rectangle] (Y0) at (0, 0) {$\dots$}; 9 | \node[rectangle, draw, right=2em of Y0, minimum height=1cm, minimum width=1cm] (RNN) {LSTM$_\rightarrow$}; 10 | \node[rectangle, right=of RNN, draw, minimum height=1cm, minimum width=1cm] (RNN2) {LSTM$_\rightarrow$}; 11 | \node[rectangle, right=of RNN2, draw, minimum height=1cm, minimum width=1cm] (RNN3) {LSTM$_\rightarrow$}; 12 | 13 | \node[rectangle, right= of RNN3, draw, minimum height=1cm, minimum width=1cm] (RNN4) {LSTM$_\rightarrow$}; 14 | \node[rectangle, right=2em of RNN4] (RNN5) {$\dots$}; 15 | 16 | 17 | \node[rectangle, above=of RNN4, draw, minimum height=1cm, minimum width=1cm] (R25) {LSTM$_\leftarrow$}; 18 | \node[rectangle, left=of R25, minimum height=1cm, minimum width=1cm, draw] (R24) {LSTM$_\leftarrow$}; 19 | \node[rectangle, left=of R24, draw, minimum height=1cm, minimum width=1cm] (R23) {LSTM$_\leftarrow$}; 20 | \node[rectangle, left=of R23, draw, minimum height=1cm, minimum width=1cm] (R22) {LSTM$_\leftarrow$}; 21 | \node[rectangle, left=2em of R22] (R21) {$\dots$}; 22 | \node[right=2em of R25] (Y20) {$\dots$}; 23 | 24 | \node[below=of RNN] (X1) {$\vec{x}_2$}; 25 | \node[below=of RNN2] (X2) {$\vec{x}_3$}; 26 | \node[below=of RNN3] (X3) {$\vec{x}_4$}; 27 | \node[below=of RNN4] (X4) {$\vec{x}_5$}; 28 | \node[above=of R25] (Y5) {$\vec{h}_5$}; 29 | \node[above=of R24] (Y4) {$\vec{h}_4$}; 30 | \node[above=of R23] (Y3) {$\vec{h}_3$}; 31 | \node[above=of R22] (Y2) {$\vec{h}_2$}; 32 | 33 | \draw[-stealth, thick] (X1) -- (RNN); 34 | \draw[-stealth, thick] (X2) -- (RNN2); 35 | \draw[-stealth, thick] (X3) -- (RNN3); 36 | \draw[-stealth, thick] (X4) -- (RNN4); 37 | \draw[-stealth, thick, densely dotted] (Y0) -- (RNN); 38 | \draw[-stealth, thick] (RNN) -- node[above, pos=0.35] {$\vec{h}_2^\rightarrow$} (RNN2); 39 | \draw[-stealth, thick] (RNN2) -- node[above, pos=0.35] {$\vec{h}_3^\rightarrow$} (RNN3); 40 | \draw[-stealth, thick] (RNN3) -- node[above, pos=0.35] {$\vec{h}_4^\rightarrow$} (RNN4); 41 | \draw[-stealth, densely dotted, thick] (RNN4) -- (RNN5); 42 | \node[below=4em of Y0] (d) {\dots}; 43 | \node[below=4em of RNN5] (d) {\dots}; 44 | 45 | \path[-stealth, ultra thick, white] (X1) edge[bend left=45] (R22); 46 | \path[-stealth, thick] (X1) edge[bend left=45] (R22); 47 | \path[-stealth, ultra thick, white] (X2) edge[bend left=45] (R23); 48 | \path[-stealth, thick] (X2) edge[bend left=45] (R23); 49 | \path[-stealth, ultra thick, white] (X3) edge[bend left=45] (R24); 50 | \path[-stealth, thick] (X3) edge[bend left=45] (R24); 51 | \path[-stealth, ultra thick, white] (X4) edge[bend left=45] (R25); 52 | \path[-stealth, thick] (X4) edge[bend left=45] (R25); 53 | \draw[-stealth, densely dotted, thick] (Y20) -- (R25); 54 | 55 | \draw[-stealth, thick] (R22) -- (Y2); 56 | \draw[-stealth, thick] (R23) -- (Y3); 57 | \draw[-stealth, thick] (R24) -- (Y4); 58 | \draw[-stealth, thick] (R25) -- (Y5); 59 | 60 | \draw[stealth-, densely dotted, thick] (R21) -- (R22); 61 | \draw[stealth-, thick] (R22) -- node[above, pos=0.65] {$\vec{h}_3^\leftarrow$} (R23); 62 | \draw[stealth-, thick] (R23) -- node[above, pos=0.65] {$\vec{h}_4^\leftarrow$} (R24); 63 | \draw[stealth-, thick] (R24) -- node[above, pos=0.65] {$\vec{h}_5^\leftarrow$} (R25); 64 | \draw[-stealth, densely dotted, thick] (Y20) -- (R25); 65 | 66 | \path[-stealth, ultra thick, white] (RNN) edge[bend right=45] (Y2); 67 | \path[-stealth, thick] (RNN) edge[bend right=45] (Y2); 68 | \path[-stealth, ultra thick, white] (RNN2) edge[bend right=45] (Y3); 69 | \path[-stealth, thick] (RNN2) edge[bend right=45] (Y3); 70 | \path[-stealth, ultra thick, white] (RNN3) edge[bend right=45] (Y4); 71 | \path[-stealth, thick] (RNN3) edge[bend right=45] (Y4); 72 | \path[-stealth, ultra thick, white] (RNN4) edge[bend right=45] (Y5); 73 | \path[-stealth, thick] (RNN4) edge[bend right=45] (Y5); 74 | 75 | \end{tikzpicture} 76 | \end{document} 77 | -------------------------------------------------------------------------------- /CRT rendering/README.md: -------------------------------------------------------------------------------- 1 | # Cathode ray tube (CRT) rendering 2 | 3 | ## Notes 4 | 5 | Diagram for the frame-rendering algorithm of a CRT display. Sports some clever maneuvering and bending of arrows corresponding to HBlank and VBlank. 6 | 7 | ## Output 8 | 9 | ![CRTRendering](https://www.dropbox.com/s/2z55k31mja5r4p8/crt_rendering.png?raw=1) 10 | 11 | ## Source 12 | 13 | [How to make a (GameBoy) emulator?](http://www.csnedelja.mg.edu.rs/static/resources/v1.0/emulation.pdf), [mgcsweek](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /CRT rendering/crt_rendering.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \begin{document} 7 | \begin{tikzpicture}[node distance=4cm, auto] 8 | \node (00) {}; 9 | \node [right of=00] (l1) {Line 1}; 10 | \node [right of=l1] (01) {}; 11 | \draw[-stealth, very thick] (00) -- (l1) -- (01); 12 | \node [below =1cm of 00] (10) {}; 13 | \node [right of=10] (l2) {Line 2}; 14 | \node [right of=l2] (11) {}; 15 | \draw[-stealth, very thick] (10) -- (l2) -- (11); 16 | \node [below =1cm of 10] (20) {}; 17 | \node [right of=20] (l3) {Line 3}; 18 | \node [right of=l3] (21) {}; 19 | \draw[-stealth, very thick] (20) -- (l3) -- (21); 20 | 21 | \node [below =1cm of 20] (30) {}; 22 | \node [right of=30] (l4) {}; 23 | \node [right of=l4] (31) {}; 24 | 25 | \node [below =1cm of 30] (1430) {}; 26 | \node [right of=1430] (l143) {Line 143}; 27 | \node [right of=l143] (1431) {}; 28 | \draw[-stealth, very thick] (1430) -- (l143) -- (1431); 29 | \node [below =1cm of 1430] (1440) {}; 30 | \node [right of=1440] (l144) {Line 144}; 31 | \node [right of=l144] (1441) {}; 32 | \draw[-stealth, very thick] (1440) -- (l144) -- (1441); 33 | 34 | \node [below=0.1cm of l1] (h1) {\textcolor{blue}{HBlank}}; 35 | \draw [thick, blue] (01) [bend left] to (h1); 36 | \draw [-stealth, thick, blue] (h1) [bend right] to (10); 37 | 38 | \node [below=0.1cm of l2] (h2) {\textcolor{blue}{HBlank}}; 39 | \draw [thick, blue] (11) [bend left] to (h2); 40 | \draw [-stealth, thick, blue] (h2) [bend right] to (20); 41 | 42 | \node [below=0.1cm of l3] (h3) {\textcolor{blue}{HBlank}}; 43 | \draw [thick, blue] (21) [bend left] to (h3); 44 | \draw [-stealth, thick, blue, dashed] (h3) [bend right] to (30); 45 | 46 | \node [below=0.1cm of l4] (h4) {\textcolor{blue}{HBlank}}; 47 | \draw [thick, blue, dashed] (31) [bend left] to (h4); 48 | \draw [-stealth, thick, blue] (h4) [bend right] to (1430); 49 | 50 | \node [below=0.1cm of l143] (h5) {\textcolor{blue}{HBlank}}; 51 | \draw [thick, blue] (1431) [bend left] to (h5); 52 | \draw [-stealth, thick, blue] (h5) [bend right] to (1440); 53 | 54 | \path (1441) -- node[pos=0.47] (v) {\textcolor{red}{\bf VBlank}} (00); 55 | 56 | \draw [ultra thick, red] (1441) [bend right] to (v); 57 | \draw [-stealth, red, ultra thick] (v) [bend left] to (00); 58 | 59 | \end{tikzpicture} 60 | \end{document} 61 | -------------------------------------------------------------------------------- /Convolutional autoencoder/README.md: -------------------------------------------------------------------------------- 1 | # Convolutional autoencoder (CAE) 2 | 3 | ## Notes 4 | 5 | A representation of a convolutional autoencoder (CAE) architecture, leveraging 3D cubes and redrawing to illustrate the differences in feature map sizes and counts. 6 | 7 | ## Output 8 | 9 | ![CAE](https://www.dropbox.com/s/j6vrmr0vivq82wt/convolutional_autoencoder.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Unsupervised methods: Diving deep into autoencoders](http://www.cl.cam.ac.uk/~pv273/slides/UCLSlides.pdf), *Introduction to Deep Learning (COMPGI23), University College London* 14 | -------------------------------------------------------------------------------- /Convolutional autoencoder/convolutional_autoencoder.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop,tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning} 5 | 6 | \definecolor{echoreg}{HTML}{2cb1e1} 7 | \definecolor{olivegreen}{rgb}{0,0.6,0} 8 | \definecolor{mymauve}{rgb}{0.58,0,0.82} 9 | 10 | \usepackage{etoolbox} 11 | 12 | \newtoggle{redraw} 13 | \newtoggle{redraw2} 14 | 15 | \tikzset{% 16 | pics/cube/.style args={#1/#2/#3/#4}{code={% 17 | \begin{scope}[line width=#4mm] 18 | \begin{scope} 19 | \clip (-#1,-#2,0) -- (#1,-#2,0) -- (#1,#2,0) -- (-#1,#2,0) -- cycle; 20 | \filldraw (-#1,-#2,0) -- (#1,-#2,0) -- (#1,#2,0) -- (-#1,#2,0) -- cycle; 21 | \end{scope} 22 | \iftoggle{redraw}{% 23 | }{% 24 | \begin{scope} 25 | \clip (-#1,-#2,0) -- (-#1-#3,-#2,-#3) -- (-#1-#3,#2,-#3) -- (-#1,#2,0) -- cycle; 26 | \filldraw (-#1,-#2,0) -- (-#1-#3,-#2,-#3) -- (-#1-#3,#2,-#3) -- (-#1,#2,0) -- cycle; 27 | \end{scope} 28 | } 29 | \iftoggle{redraw2}{% 30 | }{ 31 | \begin{scope} 32 | \clip (-#1,#2,0) -- (-#1-#3,#2,-#3) -- (#1-#3,#2,-#3) -- (#1,#2,0) -- cycle; 33 | \filldraw (-#1,#2,0) -- (-#1-#3,#2,-#3) -- (#1-#3,#2,-#3) -- (#1,#2,0) -- cycle; 34 | \end{scope} 35 | } 36 | \node[inner sep=0] (-A) at (-#1-#3*0.5, 0, -#3*0.5) {}; 37 | \node[inner sep=0] (-B) at (#1-#3*0.5, 0, -#3*0.5) {}; 38 | 39 | \coordinate (-V) at (#1, #2); 40 | \coordinate (-W) at (#1, -#2); 41 | \end{scope} 42 | }}} 43 | 44 | \begin{document} 45 | \begin{tikzpicture} 46 | 47 | \node (1) [draw, dashed, minimum height=15em, minimum width=62em, xshift=24em, fill=olivegreen, fill opacity=0.2, very thick, rectangle, rounded corners] {}; 48 | \node (la1) [below=0em of 1] {{\emph{encoder}}}; 49 | \node (2) [draw, dashed, minimum height=14em, fill = red, fill opacity=0.2,minimum width=35em, xshift=63.5em, very thick, rectangle, rounded corners] {}; 50 | \node (la1) [below=0em of 2] {{\emph{decoder}}}; 51 | 52 | \node[] (i2) {}; 53 | \pic[fill=green!50] (I2) {cube={1.8/1.8/0.4/1}}; 54 | 55 | \togglefalse{redraw} 56 | \togglefalse{redraw2} 57 | 58 | \node[right=16em of i2] (y) {}; 59 | 60 | \pic[right=16em of i2, fill=echoreg!50] (Y) {cube={1.8/1.8/1/1}}; 61 | 62 | \node[right=12em of y] (y1) {}; 63 | \pic[right=12em of y, fill=red!50] (Y1) {cube={0.9/0.9/1/1}}; 64 | 65 | \node[right=12em of y1] (y2) {}; 66 | \pic[right=12em of y1, fill=echoreg!50] (Y2) {cube={0.9/0.9/2/1}}; 67 | \node[right=10em of y2] (y3) {}; 68 | \pic[right=10em of y2, fill=red!50] (Y3) {cube={0.45/0.45/2/1}}; 69 | 70 | \node[right=9em of y3] (z1) {}; 71 | \pic[right=9em of y3, fill=mymauve!50] (Z1) {cube={0.9/0.9/1/1}}; 72 | 73 | \node[right=12em of z1] (z2) {}; 74 | \pic[right=12em of z1, fill=mymauve!50] (Z2) {cube={1.8/1.8/0.4/1}}; 75 | 76 | \draw [-stealth, ultra thick] (I2-B) -- node[above] {Conv.} node[below] {ReLU} (Y-A); 77 | 78 | \draw [-stealth, ultra thick] (Y-B) -- node[above] {Pool} (Y1-A); 79 | 80 | \draw [-stealth, ultra thick] (Y1-B) -- node[above=0.3em, inner sep=0.1em] {Conv.} node[below] {ReLU} (Y2-A); 81 | 82 | \draw [-stealth, ultra thick] (Y2-B) -- node[above] {Pool} (Y3-A); 83 | 84 | 85 | \draw [-stealth, ultra thick] (Y3-B) -- node[above] {Deconv.} node[below] {ReLU} (Z1-A); 86 | 87 | \draw [-stealth, ultra thick] (Z1-B) -- node[above] {Deconv.} node[below] {logistic} (Z2-A); 88 | 89 | 90 | \color{black} 91 | 92 | \toggletrue{redraw} 93 | \toggletrue{redraw2} 94 | 95 | \node[right=16em of i2] (y) {}; 96 | \pic[right=16em of i2, fill=echoreg!50] (Y) {cube={1.8/1.8/1/1}}; 97 | 98 | \pic[right=12em of y, fill=red!50] (Y1) {cube={0.9/0.9/1/1}}; 99 | 100 | \pic[right=12em of y1, fill=echoreg!50] (Y2) {cube={0.9/0.9/2/1}}; 101 | 102 | \pic[right=9em of y3, fill=mymauve!50] (Z1) {cube={0.9/0.9/1/1}}; 103 | 104 | \togglefalse{redraw2} 105 | 106 | \pic[right=10em of y2, fill=red!50] (Y3) {cube={0.45/0.45/2/1}}; 107 | 108 | \toggletrue{redraw2} 109 | 110 | \node[] (i2) {\LARGE ${\bf X}$}; 111 | \node[right=9.25em of y2] (y3) {\LARGE ${\bf z}$}; 112 | \node[right=11em of z1] (z2) {\LARGE ${\bf X}'$}; 113 | 114 | \end{tikzpicture} 115 | \end{document} -------------------------------------------------------------------------------- /Convolutional cross-connection/README.md: -------------------------------------------------------------------------------- 1 | # Convolutional cross-connection 2 | 3 | ## Notes 4 | 5 | An in-depth view of a convolutional cross-connection, as used in the original X-CNN publication. Features extensive nodes built up using "cascaded" slices, to represent the feature maps within CNNs---heavily relies on the `shadow` parameter. 6 | 7 | ## Output 8 | 9 | ![C-Xconn](https://www.dropbox.com/s/w3xadf6fxyufsgo/convolutional_cross-connection.png?raw=1) 10 | 11 | ## Source 12 | 13 | [X-CNN: Cross-modal Convolutional Neural Networks for Sparse Datasets](https://arxiv.org/abs/1610.00163), *IEEE SSCI 2016* 14 | -------------------------------------------------------------------------------- /Coordinate systems/README.md: -------------------------------------------------------------------------------- 1 | # Coordinate systems 2 | 3 | ## Notes 4 | 5 | A visualisation of a very common diagram used to represent the transformation between Cartesian and polar coordinates in 2D. 6 | 7 | ## Output 8 | 9 | ![CoordinateSystems](https://www.dropbox.com/s/ripf7cep2zvct63/coordinate_systems.png?raw=1) 10 | 11 | ## Source 12 | 13 | IQ sampling and FM demodulation using MATLAB, [mgcsweek v2.0](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Coordinate systems/coordinate_systems.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{calc} 5 | 6 | \definecolor{olivegreen}{rgb}{0,0.6,0} 7 | 8 | \begin{document} 9 | \begin{tikzpicture}[scale=0.85] 10 | % Axis 11 | \draw[thick,-stealth,black] (-3,0)--(3,0) coordinate (A) node[below] {$x$}; % x axis 12 | \draw[thick,-stealth,black] (0,-3)--(0,3) node[left] {$y$}; % y axis 13 | \draw[black,thin] (0,0) circle (2.5cm); 14 | 15 | \draw[ultra thick,red] (0,0) -- (60:2.5cm |- 0,0) node[midway,below] {$x$}; % UpOn y axis 16 | 17 | \draw (1,0) arc (0:60:1) node at ($(60/2:0.7)$) {$\alpha$}; 18 | \draw[ultra thick, blue] (60:2.5cm) -- (60:2.5cm |- 0,0) node[midway,right] {$y$}; % vertical line 19 | 20 | \draw[ultra thick,olivegreen,rotate=60] (0,0) -- node [left] {$r$} (2.5,0) coordinate (B); 21 | 22 | \draw[xshift=-1cm] (B) node[circle,fill,inner sep=1pt,label=above:$P$](e){}; 23 | \end{tikzpicture} 24 | \end{document} 25 | -------------------------------------------------------------------------------- /CycleGAN/README.md: -------------------------------------------------------------------------------- 1 | # Cycle-consistent generative adversarial network (CycleGAN) 2 | 3 | ## Notes 4 | 5 | A simple representation of a cycle-consistent generative adversarial network (CycleGAN) architecture, abstracting away from the neural network architectures used in the generators and discriminators. Can be easily extended into an animated illustration of the training schedule for CycleGANs (by "sliding") the arrow into one of the two locked positions. 6 | 7 | ## Output 8 | 9 | ![CycleGAN](https://www.dropbox.com/s/p4ux5lg3opxecxw/cyclegan.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Generative Adversarial Networks](http://www.cl.cam.ac.uk/~pv273/slides/PoSlides.pdf), *Pint of Science Cambridge: I think, therefore AI* 14 | -------------------------------------------------------------------------------- /CycleGAN/cyclegan.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop,tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \begin{document} 7 | \begin{tikzpicture} 8 | \node[circle, draw, thick] (z) {$\vec{a}_{real}$}; 9 | \node[circle, draw, thick, right=5em of z] (x) {$\vec{b}_{fake}$}; 10 | \draw[-stealth, thick] (z) -- node[above] {$G_{AB}(\vec{a})$} node[below, align=center] {generator\\ ($A\rightarrow B$)} (x); 11 | \node[circle, draw, thick, right=5em of x] (xx) {$\vec{a}_{rec}$}; 12 | \draw[-stealth, thick] (x) -- node[above] {$G_{BA}(\vec{b})$} node[below, align=center] {generator\\ ($B\rightarrow A$)} (xx); 13 | \node[left=5em of z] (i) {}; 14 | \draw[-stealth, thick] (i) -- node[above] {real data} node[below] {(type A)} (z); 15 | 16 | \node[circle, draw, thick, right=2em of x, yshift=7.5em] (D) {$\vec{b}$}; 17 | \node[right=7em of D] (out) {real?}; 18 | \draw[-stealth, thick] (D) -- node[above] {$D_B(\vec{b})$} node[below,align=center] {discriminator\\ (type B)} (out); 19 | 20 | \node[yshift=5em, circle, fill, inner sep=0.15em] at (x) (pt1) {}; 21 | \node[above=of x, yshift=6.4em, circle, fill, inner sep=0.15em] (pt2) {}; 22 | 23 | \node[left=2.5em of pt2, circle, draw, thick] (xt) {$\vec{b}_{real}$}; 24 | \node[left=5em of xt] (it) {}; 25 | \draw[-stealth, thick] (it) -- node[above] {real data} node[below] {(type B)} (xt); 26 | 27 | \draw[dashed, thick] (pt1) edge[bend left] (pt2); 28 | 29 | \node[circle, draw, thick, fill=white, inner sep=0.15em] at ([xshift=-0.83em, yshift=4em]pt1.north) (pt3) {}; 30 | 31 | \draw[-stealth, thick] (x) -- (pt1); 32 | \draw[-stealth, thick] (xt) -- (pt2); 33 | \draw[-stealth, thick] (pt3) -- (D); 34 | 35 | \draw[dashed, thick, stealth-stealth] (z.south) -- ([yshift=-1.5em]z.south) -- ([yshift=-1.6em]xx.south) -- (xx.south); 36 | \end{tikzpicture} 37 | \end{document} -------------------------------------------------------------------------------- /DNA/README.md: -------------------------------------------------------------------------------- 1 | # Deoxyribonucleic acid (DNA) 2 | 3 | ## Notes 4 | 5 | Combining the `braids` package with a custom macro to produce a neat visualisation of the DNA molecule. 6 | 7 | ## Output 8 | 9 | ![DNA](https://www.dropbox.com/s/myw62dq8m87lcfn/dna.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Bioinformatics algorithms: analysis of DNA sequences](http://www.csnedelja.mg.edu.rs/static/resources/v1.0/bioinformatics.pdf), [mgcsweek](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /DNA/dna.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{braids} 4 | 5 | \newcommand{\bond}[3]{ 6 | \draw[very thick, #1] (#3, 0) -- (#3, 0.35); 7 | \draw[very thick, densely dotted] (#3, 0.35) -- (#3, 0.65); 8 | \draw[very thick, #2] (#3, 0.65) -- (#3, 1); 9 | } 10 | 11 | \begin{document} 12 | \begin{tikzpicture} 13 | \bond{red}{blue}{0.1} 14 | \bond{red}{blue}{0.25} 15 | \bond{red}{blue}{0.4} 16 | \bond{blue}{red}{1.1} 17 | \bond{blue}{red}{1.25} 18 | \bond{blue}{red}{1.4} 19 | \bond{red}{blue}{2.1} 20 | \bond{red}{blue}{2.25} 21 | \bond{red}{blue}{2.4} 22 | \bond{blue}{red}{3.1} 23 | \bond{blue}{red}{3.25} 24 | \bond{blue}{red}{3.4} 25 | \bond{red}{blue}{4.1} 26 | \bond{red}{blue}{4.25} 27 | \bond{red}{blue}{4.4} 28 | \bond{blue}{red}{5.1} 29 | \bond{blue}{red}{5.25} 30 | \bond{blue}{red}{5.4} 31 | \bond{red}{blue}{6.1} 32 | \bond{red}{blue}{6.25} 33 | \bond{red}{blue}{6.4} 34 | \bond{blue}{red}{7.1} 35 | \bond{blue}{red}{7.25} 36 | \bond{blue}{red}{7.4} 37 | \bond{red}{blue}{8.1} 38 | \bond{red}{blue}{8.25} 39 | \bond{red}{blue}{8.4} 40 | \braid[rotate=90,style strands={1}{red, very thick},style strands={2}{blue, very thick}] (tst) at (0, 0) s_1 s_1 s_1 s_1 s_1 s_1 s_1 s_1; 41 | \end{tikzpicture} 42 | \end{document} 43 | -------------------------------------------------------------------------------- /Deep Graph Infomax/README.md: -------------------------------------------------------------------------------- 1 | # Deep Graph Infomax 2 | 3 | ## Notes 4 | 5 | A high-level overview of the Deep Graph Infomax (DGI) pipeline. The usual interplay featuring decorated arrows and carefully positioned containers. 6 | 7 | ## Output 8 | 9 | ![DGI](https://www.dropbox.com/s/uzx7ygwaczvtp10/deep_graph_infomax.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Deep Graph Infomax](https://arxiv.org/abs/1809.10341), _ICLR 2019_ 14 | -------------------------------------------------------------------------------- /Deep Graph Infomax/deep_graph_infomax.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning,decorations.pathmorphing} 5 | 6 | \begin{document} 7 | \begin{tikzpicture} 8 | \node[circle, thick, draw] (0) {$\vec{x}_i$}; 9 | \node[circle, thick, draw, above right=0.1em and 3em of 0] (1) {}; 10 | \node[circle, thick, draw, above right=0.8em and 0.5em of 0] (2) {}; 11 | \node[circle, thick, draw, left=of 0] (3) {}; 12 | \node[circle, thick, draw, below left=0.8em and 1.5em of 0] (4) {}; 13 | 14 | \draw[-, thick] (0) -- (1); 15 | \draw[-, thick] (0) -- (2); 16 | \draw[-, thick] (0) -- (3); 17 | \draw[-, thick] (4) -- (3); 18 | 19 | \node[circle, thick, draw, below=3em of 0] (01) {$\vec{\widetilde{x}}_j$}; 20 | \node[circle, thick, draw, above right=0.1em and 2em of 01] (02) {}; 21 | \node[circle, thick, draw, below left=0.2em and 3em of 01] (03) {}; 22 | \node[circle, thick, draw, below right=0.8em and 0.5em of 01] (04) {}; 23 | \node[circle, thick, draw, below right=0.8em and 3.3em of 01] (05) {}; 24 | 25 | \node[rectangle, draw, dashed, minimum width=11em, minimum height=5.5em] (RR) {}; 26 | \node[rectangle, draw, dashed, minimum width=11em, minimum height=5.5em, below=0.05em of RR] (RR2) {}; 27 | \node[above=0em of RR] (l1) {$({\bf X}, {\bf A})$}; 28 | \node[below=0em of RR2] (l2) {$({\bf \widetilde{X}}, {\bf \widetilde{A}})$}; 29 | 30 | \draw[-, thick] (01) -- (02); 31 | \draw[-, thick] (01) -- (03); 32 | \draw[-, thick] (01) -- (04); 33 | \draw[-, thick] (01) -- (05); 34 | \draw[-, thick] (04) -- (05); 35 | 36 | \node[rectangle, draw, dashed, minimum width=11em, minimum height=5.5em, right=12.5em of 0] (AA) {}; 37 | 38 | \node[circle, thick, draw, right=17em of 0] (0) {$\vec{h}_i$}; 39 | \node[circle, thick, draw, above right=0.1em and 3em of 0] (1) {}; 40 | \node[circle, thick, draw, above right= 0.8em and 0.5em of 0] (2) {}; 41 | \node[circle, thick, draw, left=of 0] (3) {}; 42 | \node[circle, thick, draw, below left=0.8em and 1.5em of 0] (4) {}; 43 | 44 | \draw[-, thick] (0) -- (1); 45 | \draw[-, thick] (0) -- (2); 46 | \draw[-, thick] (0) -- (3); 47 | \draw[-, thick] (4) -- (3); 48 | 49 | \node[circle, thick, draw, below=2.7em of 0] (01) {$\vec{\widetilde{h}}_j$}; 50 | \node[circle, thick, draw, above right=0.1em and 2emof 01] (02) {}; 51 | \node[circle, thick, draw, below left=0.2em and 3em of 01] (03) {}; 52 | \node[circle, thick, draw, below right=0.8em and 0.3em of 01] (04) {}; 53 | \node[circle, thick, draw, below right=0.8em and 3.1em of 01] (05) {}; 54 | \node[rectangle, draw, minimum width=11em, minimum height=5.5em, dashed, below=0.05em of AA] (AA2) {}; 55 | \node[above=0em of AA] (l1) {$({\bf H}, {\bf A})$}; 56 | \node[below=0em of AA2] (l2) {$({\bf \widetilde{H}}, {\bf \widetilde{A}})$}; 57 | 58 | \draw[-, thick] (01) -- (02); 59 | \draw[-, thick] (01) -- (03); 60 | \draw[-, thick] (01) -- (04); 61 | \draw[-, thick] (01) -- (05); 62 | \draw[-, thick] (04) -- (05); 63 | 64 | \draw[-stealth, very thick, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,] (RR) -- node[above] {$\mathcal{E}$} (AA); 65 | \draw[very thick] (RR.west) edge[bend right=75, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,-stealth] node[left] (CC) {$\mathcal{C}$} (RR2.west); 66 | \draw[-stealth, very thick, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,] (RR2) -- node[above] {$\mathcal{E}$} (AA2); 67 | 68 | \node[right=36em of CC, rectangle, draw, thick] (Re) {$\vec{s}$}; 69 | 70 | \draw[-stealth, very thick, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,] (AA) -- node[above] {$\mathcal{R}$} (Re); 71 | 72 | \node[above=1.5em of Re] (D1) {$\mathcal{D}$}; 73 | \node[below=1.5em of Re] (D2) {$\mathcal{D}$}; 74 | 75 | \draw[-stealth, thick] (Re) -- (D1); 76 | \draw[-stealth, thick] (Re) -- (D2); 77 | \draw[-stealth, thick] (0) -- (D1); 78 | \draw[-stealth, thick] (01.-11) -- (D2); 79 | 80 | \node[right=of D1] (P) {$+$}; 81 | \node[right=of D2] (M) {$-$}; 82 | 83 | \draw[-stealth, very thick, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,] (D1) -- (P); 84 | \draw[-stealth, very thick, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,] (D2) -- (M); 85 | 86 | \end{tikzpicture} 87 | \end{document} -------------------------------------------------------------------------------- /Deep belief network/README.md: -------------------------------------------------------------------------------- 1 | # Deep belief network (DBN) 2 | 3 | ## Notes 4 | 5 | A representation of a two-layer deep belief network (DBN) architecture, created as a stack of restricted Boltzmann machines (RBMs). I have finally learnt how to `foreach`. :) 6 | 7 | ## Output 8 | 9 | ![DBN](https://www.dropbox.com/s/uzk88r52bbiw4px/deep_belief_network.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Unsupervised methods: Diving deep into autoencoders](http://www.cl.cam.ac.uk/~pv273/slides/UCLSlides.pdf), *Introduction to Deep Learning (COMPGI23), University College London* 14 | -------------------------------------------------------------------------------- /Deep belief network/deep_belief_network.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning, shapes} 5 | 6 | \begin{document} 7 | \begin{tikzpicture} 8 | 9 | \node (1) [draw, minimum width=15em, minimum height=2em, very thick, rounded rectangle] {}; 10 | \node (l1) [left=0em of 1] {$\vec{x}$}; 11 | 12 | \node (2) [above=3.9em of 1, draw, fill=lightgray, minimum width=9em,very thick, minimum height=2em, rounded rectangle] {}; 13 | \node (l2) [left=0em of 2] {$\vec{h}_1$}; 14 | \node (3) [above=3.9em of 2, draw, fill=lightgray, minimum width=9em,very thick, minimum height=2em, rounded rectangle] {}; 15 | \node (l3) [left=0em of 3] {$\vec{h}_2$}; 16 | 17 | \node[circle, draw, thick] (A1) {}; 18 | \node[circle, draw, thick, right=0.5em of A1] (A2) {}; 19 | \node[circle, draw, thick, right=0.5em of A2] (A3) {}; 20 | \node[circle, draw, thick, right=0.5em of A3] (A4) {}; 21 | \node[circle, draw, thick, right=0.5em of A4] (A5) {}; 22 | \node[circle, draw, thick, left=0.5em of A1] (A6) {}; 23 | \node[circle, draw, thick, left=0.5em of A6] (A7) {}; 24 | \node[circle, draw, thick, left=0.5em of A7] (A8) {}; 25 | \node[circle, draw, thick, left=0.5em of A8] (A9) {}; 26 | 27 | \node[circle, draw, fill=white, thick, above=5em of A1] (B1) {}; 28 | \node[circle, draw, fill=white, thick, right=0.5em of B1] (B2) {}; 29 | \node[circle, draw, fill=white, thick, right=0.5em of B2] (B3) {}; 30 | \node[circle, draw, fill=white, thick, left=0.5em of B1] (B4) {}; 31 | \node[circle, draw, fill=white, thick, left=0.5em of B4] (B5) {}; 32 | 33 | \node[circle, draw, fill=white, thick, above=5em of A1] (B1) {}; 34 | \node[circle, draw, fill=white, thick, right=0.5em of B1] (B2) {}; 35 | \node[circle, draw, fill=white, thick, right=0.5em of B2] (B3) {}; 36 | \node[circle, draw, fill=white, thick, left=0.5em of B1] (B4) {}; 37 | \node[circle, draw, fill=white, thick, left=0.5em of B4] (B5) {}; 38 | 39 | \node[circle, draw, fill=white, thick, above=5em of A1] (B1) {}; 40 | \node[circle, draw, fill=white, thick, right=0.5em of B1] (B2) {}; 41 | \node[circle, draw, fill=white, thick, right=0.5em of B2] (B3) {}; 42 | \node[circle, draw, fill=white, thick, left=0.5em of B1] (B4) {}; 43 | \node[circle, draw, fill=white, thick, left=0.5em of B4] (B5) {}; 44 | 45 | \node[circle, draw, fill=white, thick, above=5em of B1] (C1) {}; 46 | \node[circle, draw, fill=white, thick, right=0.5em of C1] (C2) {}; 47 | \node[circle, draw, fill=white, thick, right=0.5em of C2] (C3) {}; 48 | \node[circle, draw, fill=white, thick, left=0.5em of C1] (C4) {}; 49 | \node[circle, draw, fill=white, thick, left=0.5em of C4] (C5) {}; 50 | 51 | \foreach \x in {1,...,9} 52 | \foreach \y in {1,...,5} 53 | \draw[-stealth, thick] (A\x) -- (B\y); 54 | 55 | \foreach \x in {1,...,5} 56 | \foreach \y in {1,...,5} 57 | \draw[stealth-stealth, thick] (B\x) -- (C\y); 58 | 59 | \draw[-stealth, thick] (A5) -- node[right] {${\bf W}_1$} (B3); 60 | \draw[stealth-stealth, thick] (B3) -- node[right] {${\bf W}_2$} (C3); 61 | 62 | \end{tikzpicture} 63 | \end{document} -------------------------------------------------------------------------------- /Dropout/README.md: -------------------------------------------------------------------------------- 1 | # Dropout 2 | 3 | ## Notes 4 | 5 | A diagram demonstrating the effects of applying dropout with p = 0.5 to a deep multilayer perceptron. In retrospect, this could have been done much cleaner with for loops. 6 | 7 | ## Output 8 | 9 | ![Dropout](https://www.dropbox.com/s/4z6df6ej90uhy55/dropout.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Deep learing for complete beginners: Using convolutional nets to recognise images](http://online.cambridgecoding.com/notebooks/cca_admin/convolutional-neural-networks-with-keras), *Cambridge Coding Academy* 14 | -------------------------------------------------------------------------------- /Dropout/dropout.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{bm} 4 | \usepackage{relsize} 5 | 6 | \usetikzlibrary{positioning} 7 | 8 | \begin{document} 9 | \begin{tikzpicture} 10 | 11 | \node[circle, draw, thick] (i1) {}; 12 | \node[circle, draw, thick, above=2em of i1] (i2) {}; 13 | \node[circle, draw, thick, above=2em of i2] (i3) {}; 14 | \node[circle, draw, thick, below=2em of i1] (i4) {}; 15 | \node[circle, draw, thick, below=2em of i4] (i5) {}; 16 | 17 | \node[circle, draw, thick, right=4em of i1] (h1) {}; 18 | \node[circle, draw, thick, right=4em of i2] (h2) {}; 19 | \node[circle, draw, thick, right=4em of i3] (h3) {}; 20 | \node[circle, draw, thick, right=4em of i4] (h4) {}; 21 | \node[circle, draw, thick, right=4em of i5] (h5) {}; 22 | 23 | \node[circle, draw, thick, right=4em of h1] (hh1) {}; 24 | \node[circle, draw, thick, right=4em of h2] (hh2) {}; 25 | \node[circle, draw, thick, right=4em of h3] (hh3) {}; 26 | \node[circle, draw, thick, right=4em of h4] (hh4) {}; 27 | \node[circle, draw, thick, right=4em of h5] (hh5) {}; 28 | 29 | \node[circle, draw, thick, right=4em of hh2] (o1) {}; 30 | \node[circle, draw, thick, right=4em of hh4] (o2) {}; 31 | 32 | \draw[-stealth, thick] (i1) -- (h1); 33 | \draw[-stealth, thick] (i1) -- (h2); 34 | \draw[-stealth, thick] (i1) -- (h3); 35 | \draw[-stealth, thick] (i1) -- (h4); 36 | \draw[-stealth, thick] (i1) -- (h5); 37 | \draw[-stealth, thick] (i2) -- (h1); 38 | \draw[-stealth, thick] (i2) -- (h2); 39 | \draw[-stealth, thick] (i2) -- (h3); 40 | \draw[-stealth, thick] (i2) -- (h4); 41 | \draw[-stealth, thick] (i2) -- (h5); 42 | \draw[-stealth, thick] (i3) -- (h1); 43 | \draw[-stealth, thick] (i3) -- (h2); 44 | \draw[-stealth, thick] (i3) -- (h3); 45 | \draw[-stealth, thick] (i3) -- (h4); 46 | \draw[-stealth, thick] (i3) -- (h5); 47 | \draw[-stealth, thick] (i4) -- (h1); 48 | \draw[-stealth, thick] (i4) -- (h2); 49 | \draw[-stealth, thick] (i4) -- (h3); 50 | \draw[-stealth, thick] (i4) -- (h4); 51 | \draw[-stealth, thick] (i4) -- (h5); 52 | \draw[-stealth, thick] (i5) -- (h1); 53 | \draw[-stealth, thick] (i5) -- (h2); 54 | \draw[-stealth, thick] (i5) -- (h3); 55 | \draw[-stealth, thick] (i5) -- (h4); 56 | \draw[-stealth, thick] (i5) -- (h5); 57 | 58 | \draw[-stealth, thick] (h1) -- (hh1); 59 | \draw[-stealth, thick] (h1) -- (hh2); 60 | \draw[-stealth, thick] (h1) -- (hh3); 61 | \draw[-stealth, thick] (h1) -- (hh4); 62 | \draw[-stealth, thick] (h1) -- (hh5); 63 | \draw[-stealth, thick] (h2) -- (hh1); 64 | \draw[-stealth, thick] (h2) -- (hh2); 65 | \draw[-stealth, thick] (h2) -- (hh3); 66 | \draw[-stealth, thick] (h2) -- (hh4); 67 | \draw[-stealth, thick] (h2) -- (hh5); 68 | \draw[-stealth, thick] (h3) -- (hh1); 69 | \draw[-stealth, thick] (h3) -- (hh2); 70 | \draw[-stealth, thick] (h3) -- (hh3); 71 | \draw[-stealth, thick] (h3) -- (hh4); 72 | \draw[-stealth, thick] (h3) -- (hh5); 73 | \draw[-stealth, thick] (h4) -- (hh1); 74 | \draw[-stealth, thick] (h4) -- (hh2); 75 | \draw[-stealth, thick] (h4) -- (hh3); 76 | \draw[-stealth, thick] (h4) -- (hh4); 77 | \draw[-stealth, thick] (h4) -- (hh5); 78 | \draw[-stealth, thick] (h5) -- (hh1); 79 | \draw[-stealth, thick] (h5) -- (hh2); 80 | \draw[-stealth, thick] (h5) -- (hh3); 81 | \draw[-stealth, thick] (h5) -- (hh4); 82 | \draw[-stealth, thick] (h5) -- (hh5); 83 | 84 | 85 | \draw[-stealth, thick] (hh1) -- (o1); 86 | \draw[-stealth, thick] (hh1) -- (o2); 87 | \draw[-stealth, thick] (hh2) -- (o1); 88 | \draw[-stealth, thick] (hh2) -- (o2); 89 | \draw[-stealth, thick] (hh3) -- (o1); 90 | \draw[-stealth, thick] (hh3) -- (o2); 91 | \draw[-stealth, thick] (hh4) -- (o1); 92 | \draw[-stealth, thick] (hh4) -- (o2); 93 | \draw[-stealth, thick] (hh5) -- (o1); 94 | \draw[-stealth, thick] (hh5) -- (o2); 95 | 96 | \draw[-stealth, double, dashed, thick] (5.5,0) -- node[above] {dropout} (8.6, 0); 97 | 98 | 99 | %%% BOUNDARY %%% 100 | 101 | \node[circle, draw, thick, red, fill=red!10, right=15em of hh1] (i1) {}; 102 | \node[circle, draw, thick, red, fill=red!10, above=2em of i1] (i2) {}; 103 | \node[circle, draw, thick, above=2em of i2] (i3) {}; 104 | \node[circle, draw, thick, below=2em of i1] (i4) {}; 105 | \node[circle, draw, thick, below=2em of i4] (i5) {}; 106 | 107 | \node[red] (icr) at (i1) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; 108 | \node[red] (icr) at (i2) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; 109 | 110 | \node[circle, draw, thick, red, fill=red!10, right=4em of i1] (h1) {}; 111 | \node[circle, draw, thick, right=4em of i2] (h2) {}; 112 | \node[circle, draw, thick, red, fill=red!10, right=4em of i3] (h3) {}; 113 | \node[circle, draw, thick, red, fill=red!10, right=4em of i4] (h4) {}; 114 | \node[circle, draw, thick, right=4em of i5] (h5) {}; 115 | 116 | \node[red] (icr) at (h1) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; 117 | \node[red] (icr) at (h3) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; 118 | \node[red] (icr) at (h4) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; 119 | 120 | \node[circle, draw, thick, right=4em of h1] (hh1) {}; 121 | \node[circle, draw, thick, red, fill=red!10, right=4em of h2] (hh2) {}; 122 | \node[circle, draw, thick, right=4em of h3] (hh3) {}; 123 | \node[circle, draw, thick, red, fill=red!10, right=4em of h4] (hh4) {}; 124 | \node[circle, draw, thick, right=4em of h5] (hh5) {}; 125 | 126 | \node[red] (icr) at (hh2) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; 127 | \node[red] (icr) at (hh4) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; 128 | 129 | \node[circle, draw, thick, right=4em of hh2] (o1) {}; 130 | \node[circle, draw, thick, right=4em of hh4] (o2) {}; 131 | 132 | \draw[-stealth, thick] (i3) -- (h2); 133 | \draw[-stealth, thick] (i3) -- (h5); 134 | \draw[-stealth, thick] (i4) -- (h2); 135 | \draw[-stealth, thick] (i4) -- (h5); 136 | \draw[-stealth, thick] (i5) -- (h2); 137 | \draw[-stealth, thick] (i5) -- (h5); 138 | 139 | \draw[-stealth, thick] (h2) -- (hh1); 140 | \draw[-stealth, thick] (h2) -- (hh3); 141 | \draw[-stealth, thick] (h2) -- (hh5); 142 | \draw[-stealth, thick] (h5) -- (hh1); 143 | \draw[-stealth, thick] (h5) -- (hh3); 144 | \draw[-stealth, thick] (h5) -- (hh5); 145 | 146 | \draw[-stealth, thick] (hh1) -- (o1); 147 | \draw[-stealth, thick] (hh1) -- (o2); 148 | \draw[-stealth, thick] (hh3) -- (o1); 149 | \draw[-stealth, thick] (hh3) -- (o2); 150 | \draw[-stealth, thick] (hh5) -- (o1); 151 | \draw[-stealth, thick] (hh5) -- (o2); 152 | 153 | \end{tikzpicture} 154 | \end{document} 155 | -------------------------------------------------------------------------------- /Emulator modules/README.md: -------------------------------------------------------------------------------- 1 | # Emulator modules 2 | 3 | ## Notes 4 | 5 | A high-level sketch of a software emulator. Demonstrates some interesting node style macros. 6 | 7 | ## Output 8 | 9 | ![EmulatorModules](https://www.dropbox.com/s/twnkssic8jg7wer/emulator_modules.png?raw=1) 10 | 11 | ## Source 12 | 13 | [How to make a (GameBoy) emulator?](http://www.csnedelja.mg.edu.rs/static/resources/v1.0/emulation.pdf), [mgcsweek](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Emulator modules/emulator_modules.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{shapes, arrows} 5 | 6 | \tikzstyle{block} = [rectangle, draw, fill=blue!20, 7 | text width=5em, text centered, rounded corners, minimum height=4em] 8 | \tikzstyle{block2} = [rectangle, draw, fill=blue!20, 9 | text width=4em, text centered, rounded corners, minimum height=1em] 10 | \tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm, 11 | minimum height=2em] 12 | \tikzstyle{line} = [draw, -latex'] 13 | 14 | \definecolor{mygreen}{rgb}{0,0.6,0} 15 | \definecolor{echodrk}{HTML}{0099cc} 16 | \definecolor{drkorange}{HTML}{FF7c00} 17 | 18 | \begin{document} 19 | \begin{tikzpicture}[node distance=3cm, auto] 20 | \node [block, color=red, fill=white] (cpu) {CPU}; 21 | \node [cloud, color=red, fill=white, below of=cpu] (intr) {Interrupts}; 22 | \node [block, color=drkorange, fill=white, right of=cpu] (mmu) {Memory controller}; 23 | \node [block, color=echodrk, fill=white, right of=mmu] (memo) {Memory \begin{tikzpicture}\node [block2, color=echodrk, fill=white] (rom) {ROM};\node [block2, node distance=1.3em, below of=rom, color=echodrk, fill=white] (ram) {RAM};\end{tikzpicture}}; 24 | \node [block, color=black, fill=white, right of=memo] (cartr) {Cartridge reader}; 25 | \node [block, color=mygreen, fill=white, below of=memo] (gpu) {GPU}; 26 | \node [cloud, color=mygreen, fill=white, right of=gpu] (sprites) {Sprites}; 27 | \node [block, color=blue, fill=white, left of=gpu] (io) {Input}; 28 | 29 | \path [line,transform canvas={yshift=0.1em}] (cpu) -- (mmu); 30 | \path [line,transform canvas={yshift=-0.1em}] (mmu) -- (cpu); 31 | \path [line,transform canvas={yshift=0.1em}] (mmu) -- (memo); 32 | \path [line,transform canvas={yshift=-0.1em}] (memo) -- (mmu); 33 | \path [line] (io) -- (mmu); 34 | \path [line] (mmu) -- (gpu); 35 | \path [line] (memo) -- (gpu); 36 | \path [line, dashed] (intr) -- (cpu); 37 | \path [line, dashed] (io) -- (intr); 38 | \path [line, dashed] (gpu) edge [bend left] (intr); 39 | \path [line] (cartr) -- (memo); 40 | \path [line, dashed] (memo) -- (sprites); 41 | \path [line, dashed] (sprites) -- (gpu); 42 | \end{tikzpicture} 43 | \end{document} 44 | -------------------------------------------------------------------------------- /Fetch-decode-execute cycle/README.md: -------------------------------------------------------------------------------- 1 | # Fetch-decode-execute cycle 2 | 3 | ## Notes 4 | 5 | A simple diagram of the fetch-decode-execute cycle. Illustrates combining several styles within a single node, as well as overriding a node's specified style.' 6 | 7 | ## Output 8 | 9 | ![FetchDecodeExecute](https://www.dropbox.com/s/bj5gxqhx1w3j0vy/fetch-decode-execute_cycle.png?raw=1) 10 | 11 | ## Source 12 | 13 | [How to make a (GameBoy) emulator?](http://www.csnedelja.mg.edu.rs/static/resources/v1.0/emulation.pdf), [mgcsweek](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Fetch-decode-execute cycle/fetch-decode-execute_cycle.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{arrows, positioning} 5 | 6 | \tikzstyle{block} = [rectangle, draw, fill=blue!20, 7 | text width=5em, text centered, rounded corners, minimum height=4em] 8 | \tikzstyle{line} = [draw, -latex'] 9 | 10 | \definecolor{mygreen}{rgb}{0,0.6,0} 11 | \definecolor{echodrk}{HTML}{0099cc} 12 | 13 | \begin{document} 14 | \begin{tikzpicture}[node distance=4cm, auto] 15 | \node [block, color=red, fill=white, text width=6.5em] (if) {{\huge \bf IF}\\{\scriptsize Instruction fetch}}; 16 | \node [block, color=mygreen, fill=white, text width=6.5em, right of=if] (dc) {{\huge \bf DC}\\{\scriptsize Decode}}; 17 | \node [block, color=echodrk, fill=white, text width=6.5em, right of=dc] (ex) {{\huge \bf EX}\\{\scriptsize Execute}}; 18 | \node [block, color=black, fill=white, text width=6.5em, below = 0.5cm of dc] (intr) {{\huge \bf IRQ}\\{\scriptsize Handle interrupts}}; 19 | 20 | \path [line] (if) -- (dc); 21 | \path [line] (dc) -- (ex); 22 | \path [line] (ex) edge [bend left] (intr); 23 | \path [line] (intr) edge [bend left] (if); 24 | \end{tikzpicture} 25 | \end{document} 26 | -------------------------------------------------------------------------------- /Frequency modulation/README.md: -------------------------------------------------------------------------------- 1 | # Frequency modulation (FM) 2 | 3 | ## Notes 4 | 5 | Graphical derivation and explanation of a frequency modulated signal. Makes extensive use of the `axis` environment. 6 | 7 | ## Output 8 | 9 | ![FrequencyModulation](https://www.dropbox.com/s/nm9foboaccdvzhb/frequency_modulation.png?raw=1) 10 | 11 | ## Source 12 | 13 | IQ sampling and FM demodulation using MATLAB, [mgcsweek v2.0](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Frequency modulation/frequency_modulation.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{pgfplots} 4 | 5 | \definecolor{olivegreen}{rgb}{0,0.6,0} 6 | 7 | \begin{document} 8 | \begin{tikzpicture}[samples=1000, domain=0:10] 9 | 10 | \begin{axis}[ 11 | width=11cm, height=3.5cm, 12 | xtick=\empty, 13 | ytick=\empty, 14 | xlabel={\large $t$}, 15 | ylabel={\large $x(t)$}, 16 | xmin=0, xmax=11, 17 | ymin=-3, ymax=5, 18 | axis lines = middle, 19 | very thick, 20 | trig format = rad 21 | ] 22 | \addplot [no markers, smooth, thick] {2*sin(2*pi*0.25*x)}; 23 | \end{axis} 24 | 25 | \begin{axis}[ 26 | at={(0, -2.25cm)}, 27 | width=11cm, height=3.5cm, 28 | xtick=\empty, 29 | ytick=\empty, 30 | xlabel={\large $t$}, 31 | ylabel={\textcolor{blue}{carrier wave}}, 32 | xmin=0, xmax=11, 33 | ymin=-3, ymax=5, 34 | axis lines = middle, 35 | very thick, 36 | trig format = rad 37 | ] 38 | \addplot [no markers, smooth, blue, very thick] {2*sin(6*pi*x)}; 39 | \end{axis} 40 | 41 | \begin{axis}[ 42 | at={(0, -4.5cm)}, 43 | width=11cm, height=3.5cm, 44 | xtick=\empty, 45 | ytick=\empty, 46 | xlabel={\large $t$}, 47 | ylabel={\textcolor{olivegreen}{FM wave}}, 48 | xmin=0, xmax=11, 49 | ymin=-3, ymax=5, 50 | axis lines = middle, 51 | very thick, 52 | trig format = rad 53 | ] 54 | \addplot expression [no markers, smooth, olivegreen, very thick] {2*sin(2*pi*3*x - 8*cos(2*pi*0.25*x))}; 55 | \end{axis} 56 | 57 | \end{tikzpicture} 58 | \end{document} 59 | -------------------------------------------------------------------------------- /Fully-connected cross-connection/README.md: -------------------------------------------------------------------------------- 1 | # Fully-connected cross-connection 2 | 3 | ## Notes 4 | 5 | An in-depth view of a fully-connected cross-connection, as used by Bica *et al.* (ESANN 2018). Features a scope transformation to allow independently developing the nodes in both streams, then seamlessly connecting them with the cross-connecting edges when necessary. 6 | 7 | ## Output 8 | 9 | ![FC-Xconn](https://www.dropbox.com/s/yj3b2pckbdiqtjb/fully-connected_cross-connection.png?raw=1) 10 | 11 | ## Source 12 | 13 | *TBA* 14 | -------------------------------------------------------------------------------- /Fully-connected cross-connection/fully-connected_cross-connection.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{decorations.pathmorphing,positioning} 5 | 6 | \definecolor{mynavy}{HTML}{000080} 7 | \definecolor{darkred}{HTML}{8B0000} 8 | 9 | \newcommand{\myGlobalTransformation}[2] 10 | { 11 | \pgftransformcm{1}{0}{0.5}{0.25}{\pgfpoint{#1cm}{#2cm}} 12 | } 13 | 14 | \tikzstyle myBG=[line width=3pt,opacity=1.0] 15 | 16 | \begin{document} 17 | \begin{tikzpicture} 18 | 19 | \begin{scope} 20 | \myGlobalTransformation{0}{0}; 21 | \draw [black!50,fill=red!5] (-1, 0) rectangle (9,8); 22 | \end{scope} 23 | 24 | \begin{scope} 25 | \myGlobalTransformation{0}{4.25}; 26 | \draw [black!50,fill=blue!5] (-1, 0) rectangle (9,8); 27 | \end{scope} 28 | 29 | \begin{scope} 30 | \myGlobalTransformation{0}{0} 31 | \node (N1) at (1,1) [circle,white,fill=darkred] {}; 32 | \node (N2) at (1,3) [circle,white,fill=darkred] {}; 33 | \node (N3) at (1,5) [circle,white,fill=darkred] {}; 34 | \node (N4) at (1,7) [circle,white,fill=darkred] {}; 35 | \node (N5) at (4,1) [circle,white,fill=darkred] {}; 36 | \node (N6) at (4,3) [circle,white,fill=darkred] {}; 37 | \node (N7) at (4,5) [circle,white,fill=darkred] {}; 38 | \node (N8) at (4,7) [circle,white,fill=darkred] {}; 39 | \node (N9) at (7,1) [circle,white,fill=darkred] {}; 40 | \node (N10) at (7,3) [circle,white,fill=darkred] {}; 41 | \node (N11) at (7,5) [circle,white,fill=darkred] {}; 42 | \node (N12) at (7,7) [circle,white,fill=darkred] {}; 43 | 44 | \node (N13) at (8.5,1) {}; 45 | \node (N14) at (8.5,3) {}; 46 | \node (N15) at (8.5,5) {}; 47 | \node (N16) at (8.5,7) {}; 48 | 49 | \node (N0) at (-0.5,1) {}; 50 | \node (N00) at (-0.5,3) {}; 51 | \node (N000) at (-0.5,5) {}; 52 | \node (N0000) at (-0.5,7) {}; 53 | 54 | \foreach \x in {1,...,4} 55 | \foreach \y in {5,...,8} 56 | \draw[-stealth, darkred, very thick] (N\x) -- (N\y); 57 | 58 | \foreach \x in {5,...,8} 59 | \foreach \y in {9,...,12} 60 | \draw[-stealth, darkred, very thick] (N\x) -- (N\y); 61 | 62 | \draw[-stealth, darkred, very thick] (N9) -- (N13); 63 | \draw[-stealth, darkred, very thick] (N10) -- (N14); 64 | \draw[-stealth, darkred, very thick] (N11) -- (N15); 65 | \draw[-stealth, darkred, very thick] (N12) -- (N16); 66 | \draw[-stealth, darkred, very thick] (N0) -- (N1); 67 | \draw[-stealth, darkred, very thick] (N00) -- (N2); 68 | \draw[-stealth, darkred, very thick] (N000) -- (N3); 69 | \draw[-stealth, darkred, very thick] (N0000) -- (N4); 70 | 71 | \begin{scope} 72 | \pgftransformreset 73 | \myGlobalTransformation{0}{4.25}; 74 | \node (T9) at (7,1) {}; 75 | \node (T10) at (7,3) {}; 76 | \node (T11) at (7,5) {}; 77 | \node (T12) at (7,7) {}; 78 | \foreach \x in {5,...,8} 79 | \foreach \y in {9,...,12} 80 | \draw[-stealth,very thick, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,] (N\x) -- (T\y); 81 | \end{scope} 82 | \end{scope} 83 | 84 | \begin{scope} 85 | \myGlobalTransformation{0}{4.25} 86 | \node (N1) at (1,1) [circle,white,fill=mynavy] {}; 87 | \node (N2) at (1,3) [circle,white,fill=mynavy] {}; 88 | \node (N3) at (1,5) [circle,white,fill=mynavy] {}; 89 | \node (N4) at (1,7) [circle,white,fill=mynavy] {}; 90 | \node (N5) at (4,1) [circle,white,fill=mynavy] {}; 91 | \node (N6) at (4,3) [circle,white,fill=mynavy] {}; 92 | \node (N7) at (4,5) [circle,white,fill=mynavy] {}; 93 | \node (N8) at (4,7) [circle,white,fill=mynavy] {}; 94 | 95 | \node (N13) at (8.5,1) {}; 96 | \node (N14) at (8.5,3) {}; 97 | \node (N15) at (8.5,5) {}; 98 | \node (N16) at (8.5,7) {}; 99 | \node (N0) at (-0.5,1) {}; 100 | \node (N00) at (-0.5,3) {}; 101 | \node (N000) at (-0.5,5) {}; 102 | \node (N0000) at (-0.5,7) {}; 103 | 104 | \begin{scope} 105 | \pgftransformreset 106 | \myGlobalTransformation{0}{0}; 107 | \node (T9) at (7,1) {}; 108 | \node (T10) at (7,3) {}; 109 | \node (T11) at (7,5) {}; 110 | \node (T12) at (7,7) {}; 111 | \foreach \x in {5,...,8} 112 | \foreach \y in {9,...,12} 113 | \draw[-stealth,very thick, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,] (N\x) -- (T\y); 114 | \end{scope} 115 | 116 | 117 | \node (N9) at (7,1) [circle,white,fill=mynavy] {}; 118 | \node (N10) at (7,3) [circle,white,fill=mynavy] {}; 119 | \node (N11) at (7,5) [circle,white,fill=mynavy] {}; 120 | \node (N12) at (7,7) [circle,white,fill=mynavy] {}; 121 | \draw[-stealth, mynavy, very thick] (N0) -- (N1); 122 | \draw[-stealth, mynavy, very thick] (N00) -- (N2); 123 | \draw[-stealth, mynavy, very thick] (N000) -- (N3); 124 | \draw[-stealth, mynavy, very thick] (N0000) -- (N4); 125 | 126 | \foreach \x in {1,...,4} 127 | \foreach \y in {5,...,8} 128 | \draw[-stealth, mynavy, very thick] (N\x) -- (N\y); 129 | 130 | \foreach \x in {5,...,8} 131 | \foreach \y in {9,...,12} 132 | \draw[-stealth, mynavy, very thick] (N\x) -- (N\y); 133 | 134 | \draw[-stealth, mynavy, very thick] (N9) -- (N13); 135 | \draw[-stealth, mynavy, very thick] (N10) -- (N14); 136 | \draw[-stealth, mynavy, very thick] (N11) -- (N15); 137 | \draw[-stealth, mynavy, very thick] (N12) -- (N16); 138 | 139 | \end{scope} 140 | 141 | \node at (11, 0.3) {\emph{\textbf{stream 1}}}; 142 | \node at (1, 6) {\emph{\textbf{stream 2}}}; 143 | 144 | \node at (10.8, 3.5) {\emph{\textbf{$\times$-connections}}}; 145 | 146 | \end{tikzpicture} 147 | \end{document} 148 | -------------------------------------------------------------------------------- /GAT layer/README.md: -------------------------------------------------------------------------------- 1 | # Graph attentional (GAT) layer 2 | 3 | ## Notes 4 | 5 | A diagram representing a single graph attentional (GAT) layer, illustrating the multi-head self-attention mechanism of a node over its direct neighbours, by way of multiple arrows (with multiple decorations :)). 6 | 7 | ## Output 8 | 9 | ![GAT](https://www.dropbox.com/s/q2zp1p6k79jjd15/gat_layer.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Graph Attention Networks](https://arxiv.org/abs/1710.10903), *ICLR 2018* 14 | -------------------------------------------------------------------------------- /GAT layer/gat_layer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \definecolor{mygreen}{rgb}{0,0.6,0} 5 | \definecolor{mymauve}{rgb}{0.58,0,0.82} 6 | 7 | \usetikzlibrary{arrows,shapes, decorations.pathmorphing,backgrounds,positioning} 8 | 9 | \begin{document} 10 | \begin{tikzpicture} 11 | 12 | \node[circle, draw, thick] (h1) {$\vec{h}_1$}; 13 | \node[circle, draw, thick, above left=of h1] (h4) {$\vec{h}_2$}; 14 | \node[circle, draw, thick, left=5em of h1] (h5) {$\vec{h}_3$}; 15 | \node[circle, draw, thick, below left=of h1] (h6) {$\vec{h}_4$}; 16 | \node[circle, draw, thick, below=5em of h1] (h7) {$\vec{h}_5$}; 17 | \node[circle, draw, thick, below right=of h1] (h8) {$\vec{h}_6$}; 18 | 19 | \draw[-stealth, mymauve, thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h8.120) -- node[sloped, above, black] {$\vec{\alpha}_{16}$} (h1.-30); 20 | \draw[-stealth, blue, thick] (h8.135) -- (h1.-45); 21 | \draw[-stealth, mygreen, thick, decoration={zigzag, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h8.150) -- (h1.-60); 22 | 23 | \draw[-stealth, mymauve, thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h1.30) to[looseness=7] node[sloped, above, black] {$\vec{\alpha}_{11}$}(h1.105); 24 | \draw[-stealth, blue, thick] (h1.45) to[looseness=9] (h1.90); 25 | \draw[-stealth, mygreen, thick, decoration={zigzag, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h1.60) to[looseness=20] (h1.75); 26 | 27 | \draw[-stealth, mymauve, thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h4.285) -- node[sloped, below, black] {$\vec{\alpha}_{12}$}(h1.150); 28 | \draw[-stealth, blue, thick] (h4.300) -- (h1.135); 29 | \draw[-stealth, mygreen, thick, decoration={zigzag, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h4.315) -- (h1.120); 30 | 31 | \draw[-stealth, mymauve, thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h5.-15) -- node[sloped, below, black] {$\vec{\alpha}_{13}$}(h1.195); 32 | \draw[-stealth, blue, thick] (h5.0) -- (h1.180); 33 | \draw[-stealth, mygreen, thick, decoration={zigzag, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h5.15) -- (h1.165); 34 | 35 | \draw[-stealth, mymauve, thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h6.15) -- node[sloped, below, black] {$\vec{\alpha}_{14}$}(h1.240); 36 | \draw[-stealth, blue, thick] (h6.30) -- (h1.225); 37 | \draw[-stealth, mygreen, thick, decoration={zigzag, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h6.45) -- (h1.210); 38 | 39 | \draw[-stealth, mymauve, thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h7.75) -- node[sloped, below, black] {$\vec{\alpha}_{15}$}(h1.-75); 40 | \draw[-stealth, blue, thick] (h7.90) -- (h1.-90); 41 | \draw[-stealth, mygreen, thick, decoration={zigzag, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h7.105) -- (h1.-105); 42 | 43 | \node[circle, draw, thick, right=10em of h1, opacity=0.8] (hp) {$\vec{h}_1'$}; 44 | 45 | \coordinate[right=5em of h1] (A); 46 | 47 | \draw[-stealth, mymauve, opacity=0.5, ultra thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h1.20) -- (A) -- (hp); 48 | \draw[-stealth, mygreen, opacity=0.5, ultra thick,decoration={zigzag, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (h1.-20) -- (A) -- (hp); 49 | \draw[-stealth, blue, opacity=0.5, ultra thick] (h1.0) -- (A) -- node[black, above, opacity=1.0] {concat/avg} (hp); 50 | 51 | \end{tikzpicture} 52 | \end{document} -------------------------------------------------------------------------------- /GMHMM/README.md: -------------------------------------------------------------------------------- 1 | # Gaussian mixture hidden Markov model (GMHMM) 2 | 3 | ## Notes 4 | 5 | Example of a Gaussian mixture hidden Markov model, with the state set S = {x, y, z}, and sub-output set O' = {a, b, c}. 6 | 7 | ## Output 8 | 9 | ![GMHMM](https://www.dropbox.com/s/07h4r4odm8zalt4/gmhmm.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Molecular multiplex network inference using Gaussian mixture hidden Markov models](http://comnet.oxfordjournals.org/content/early/2015/12/25/comnet.cnv029), Journal of Complex Networks 14 | -------------------------------------------------------------------------------- /GMHMM/gmhmm.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{pgfplots} 4 | 5 | \usetikzlibrary{automata, positioning} 6 | 7 | \begin{document} 8 | \begin{tikzpicture}[-stealth,very thick,node distance = 4cm,auto] 9 | 10 | \node[state] (x) {$x$}; 11 | \node[state] (y) [above right of=x] {$y$}; 12 | \node[state] (z) [below right of=y] {$z$}; 13 | 14 | \node[rectangle, minimum size=2em,draw] (a) [above left =of y] {$a$}; 15 | \node[rectangle,minimum size=2em, draw] (b) [above = of y] {$b$}; 16 | \node[rectangle, minimum size=2em,draw] (c) [above right =of y] {$c$}; 17 | 18 | \draw[] (x) to node[above left] {$1$} (y); 19 | \draw[loop above] (y) to node {$0.5$} (y); 20 | \draw[bend left=20] (y) to node {$0.5$} (z); 21 | \draw[bend left=20] (z) to node[below left] {$0.7$} (y); 22 | \draw[] (z) to node {$0.3$} (x); 23 | 24 | \draw[dashed] (x) to node[left] {$0.9$} (a); 25 | \draw[dashed] (x) to node[left] {$0.1$} (b); 26 | \draw[bend right=30, dashed] (y) to node[right] {$0.6$} (b); 27 | \draw[dashed] (y) to node[below right] {$0.4$} (c); 28 | \draw[dashed] (z) to node[right] {$1$} (c); 29 | 30 | \node[rectangle, draw, scale=0.2, minimum size=20em,above = 2cm of a] (ga){\begin{tikzpicture} 31 | \begin{axis}[axis lines=none, ticks=none,xmax=3, xmin=-3,ymax=1.1] 32 | \addplot[ultra thick,black, no markers,samples=200] {exp(-x^2)}; 33 | \end{axis} 34 | \end{tikzpicture}}; 35 | 36 | \node[rectangle, draw, scale=0.2, minimum size=20em,above = 2cm of b] (gb){\begin{tikzpicture} 37 | \begin{axis}[axis lines=none, ticks=none,xmax=3, xmin=-3,ymax=1.1] 38 | \addplot[ultra thick,black, no markers,samples=200] {exp(-x^2)}; 39 | \end{axis} 40 | \end{tikzpicture}}; 41 | 42 | \node[rectangle, draw, scale=0.2, minimum size=20em,above = 2cm of c] (gc){\begin{tikzpicture} 43 | \begin{axis}[axis lines=none, ticks=none,xmax=3, xmin=-3,ymax=1.1] 44 | \addplot[ultra thick,black, no markers,samples=200] {exp(-x^2)}; 45 | \end{axis} 46 | \end{tikzpicture}}; 47 | 48 | \draw[dotted, bend left] (a) to node[left] {$\mu_a$} (ga); 49 | \draw[dotted, bend right] (a) to node[right] {$\sigma_a$} (ga); 50 | \draw[dotted, bend left] (b) to node[left] {$\mu_b$} (gb); 51 | \draw[dotted, bend right] (b) to node[right] {$\sigma_b$} (gb); 52 | \draw[dotted, bend left] (c) to node[left] {$\mu_c$} (gc); 53 | \draw[dotted, bend right] (c) to node[right] {$\sigma_c$} (gc); 54 | 55 | \end{tikzpicture} 56 | \end{document} 57 | -------------------------------------------------------------------------------- /GameBoy joypad register/README.md: -------------------------------------------------------------------------------- 1 | # GameBoy joypad register (JOYP) 2 | 3 | ## Notes 4 | 5 | A schematic of the wiring within GameBoy's JOYP register, used for recording user input. Features some tight positioning along with matrices. 6 | 7 | ## Output 8 | 9 | ![GameBoyJoypadRegister](https://www.dropbox.com/s/yva1zqc8op3mgkd/gameboy_joypad_register.png?raw=1) 10 | 11 | ## Source 12 | 13 | [How to make a (GameBoy) emulator?](http://www.csnedelja.mg.edu.rs/static/resources/v1.0/emulation.pdf), [mgcsweek](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /GameBoy joypad register/gameboy_joypad_register.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{bm} 4 | 5 | \usetikzlibrary{positioning, matrix} 6 | 7 | \tikzset{ 8 | tablet/.style={ 9 | matrix of nodes, 10 | row sep=-\pgflinewidth, 11 | column sep=-\pgflinewidth, 12 | nodes={rectangle,draw=black,text width=1.25ex,align=center}, 13 | text height=1.25ex, 14 | text depth=0ex, 15 | nodes in empty cells 16 | }, 17 | texto/.style={font=\footnotesize\sffamily}, 18 | title/.style={font=\small\sffamily} 19 | } 20 | 21 | \begin{document} 22 | \begin{tikzpicture}[node distance=3cm, auto] 23 | \node [rectangle, draw, minimum width=5em, minimum height=7em] (joyp) {\tt JOYP}; 24 | \matrix[tablet, draw=none, nodes={draw=none, inner sep = 0.16em}, inner sep=0.1em, left = -0.35cm of joyp] (pt) 25 | { 26 | \node (17){\scriptsize\tt 7}; \\ \node(16){\scriptsize\tt 6}; \\ \node(15){\scriptsize\tt 5}; \\ \node(14){\scriptsize\tt 4}; \\ \node(13){\scriptsize\tt 3}; \\ \node(12){\scriptsize\tt 2}; \\ \node(11){\scriptsize\tt 1}; \\ \node(10){\scriptsize\tt 0};\\ 27 | }; 28 | 29 | \node [circle, inner sep=0, minimum size=0.25em, fill=black, left = 1.2cm of 10] (a) {}; 30 | \node [circle, inner sep=0, minimum size=0.25em, fill=black, left = 1.2cm of 11] (b) {}; 31 | \node [circle, inner sep=0, minimum size=0.25em, fill=black, left = 1.2cm of 12] (select) {}; 32 | \node [circle, inner sep=0, minimum size=0.25em, fill=black, left = 1.2cm of 13] (start) {}; 33 | 34 | \node [circle, inner sep=0, minimum size=0.25em, fill=black, left = 1cm of a] (right) {}; 35 | \node [circle, inner sep=0, minimum size=0.25em, fill=black, left = 1cm of b] (left) {}; 36 | \node [circle, inner sep=0, minimum size=0.25em, fill=black, left = 1cm of select] (up) {}; 37 | \node [circle, inner sep=0, minimum size=0.25em, fill=black, left = 1cm of start] (down) {}; 38 | 39 | \node [left = 0.5cm of right] (ra) {}; 40 | \node [left = 0.5cm of left] (lb) {}; 41 | \node [left = 0.5cm of up] (usel) {}; 42 | \node [left = 0.5cm of down] (dst) {}; 43 | 44 | \node [below = 0.15cm of a] (aa) {}; 45 | \node [below = 0.15cm of right] (rr) {}; 46 | 47 | \draw (ra) -- (right) -- (a) -- (10); 48 | \draw (lb) -- (left) -- (b) -- (11); 49 | \draw (usel) -- (up) -- (select) -- (12); 50 | \draw (dst) -- (down) -- (start) -- (13); 51 | 52 | \draw (aa) -- (a) -- node[right] {\tiny\bf A} (b) -- node[right] {\tiny\bf B} (select) -- node[right] {\tiny\bf SELECT} (start) |- node[pos=0.2, right] {\tiny\bf START} (14); 53 | \draw (rr) -- (right) -- node[right] {\tiny $\bm{\rightarrow}$} (left) -- node[right]{\tiny $\bm{\leftarrow}$} (up) -- node[right]{\tiny $\bm{\uparrow}$} (down) |- node[pos=0.1, right]{\tiny $\bm{\downarrow}$} (15); 54 | \end{tikzpicture} 55 | \end{document} 56 | -------------------------------------------------------------------------------- /GameBoy palette translation/README.md: -------------------------------------------------------------------------------- 1 | # GameBoy palette translation 2 | 3 | ## Notes 4 | 5 | In-depth view into how GameBoy VRAM entries are converted into tile colours via a palette translation. Another showcase of `matrix`-`node` integration. 6 | 7 | ## Output 8 | 9 | ![GameBoyPaletteTranslation](https://www.dropbox.com/s/5zotnp6y4rvk7ip/gameboy_palette_translation.png?raw=1) 10 | 11 | ## Source 12 | 13 | [How to make a (GameBoy) emulator?](http://www.csnedelja.mg.edu.rs/static/resources/v1.0/emulation.pdf), [mgcsweek](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /GameBoy palette translation/gameboy_palette_translation.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning, matrix} 5 | 6 | \tikzset{ 7 | tablet/.style={ 8 | matrix of nodes, 9 | row sep=-\pgflinewidth, 10 | column sep=-\pgflinewidth, 11 | nodes={rectangle,draw=black,text width=1.25ex,align=center}, 12 | text height=1.25ex, 13 | nodes in empty cells 14 | }, 15 | texto/.style={font=\footnotesize\sffamily}, 16 | title/.style={font=\small\sffamily} 17 | } 18 | 19 | \definecolor{dgry}{HTML}{555555} 20 | \definecolor{lgry}{HTML}{aaaaaa} 21 | 22 | \begin{document} 23 | \begin{tikzpicture} 24 | \matrix[tablet] (mp) 25 | { 26 | {\tt 0} & {\tt 1} & {\tt 0} & {\tt 0} & {\tt 1} & {\tt 1} & {\tt 1} & {\tt 0}\\ 27 | \node (00){\tt 1}; & \node(01){\tt 0}; & \node(02){\tt 0}; & \node(03){\tt 0}; & \node(04){\tt 1}; & \node(05){\tt 0}; & \node(06){\tt 1}; & \node(07){\tt 1};\\ 28 | }; 29 | 30 | \matrix[tablet, below = of mp] (pt) 31 | { 32 | \node (10){\tt 2}; & \node(11){\tt 1}; & \node(12){\tt 0}; & \node(13){\tt 0}; & \node(14){\tt 3}; & \node(15){\tt 1}; & \node(16){\tt 3}; & \node(17){\tt 2};\\ 33 | }; 34 | 35 | \matrix[tablet, draw=black, inner sep=0ex, nodes={draw=white,inner sep=0.8ex}, below = of pt] (clr) 36 | { 37 | |[fill=dgry]| & |[fill=lgry]| & |[fill=white]| & |[fill=white]| & |[fill=black]| & |[fill=lgry]| & |[fill=black]| & |[fill=dgry]|\\ 38 | }; 39 | 40 | \node [align=center, right = 0.05cm of mp] (c1) {Byte 1 \\ Byte 2}; 41 | \node [align=center, right = 0.05cm of pt] (c2) {Colour indices}; 42 | \node [align=center, right = 0.05cm of clr] (c3) {Tile row}; 43 | 44 | \draw [-stealth, thick] (00) -- (10) ; 45 | \draw [-stealth, thick] (01) -- (11) ; 46 | \draw [-stealth, thick] (02) -- (12) ; 47 | \draw [-stealth, thick] (03) -- (13) ; 48 | \draw [-stealth, thick] (04) -- (14) ; 49 | \draw [-stealth, thick] (05) -- (15) ; 50 | \draw [-stealth, thick] (06) -- (16) ; 51 | \draw [-stealth, thick] (07) -- (17) ; 52 | 53 | \draw [-stealth, double, thick] (13.south east) -- node[right] {\emph{palette}} (clr); 54 | \end{tikzpicture} 55 | \end{document} 56 | -------------------------------------------------------------------------------- /GameBoy tiling system/README.md: -------------------------------------------------------------------------------- 1 | # GameBoy tiling system 2 | 3 | ## Notes 4 | 5 | An overview of the manner in which the GameBoy background frame is constructed. Features significant integration of matrices and nodes. While it could have been implemented far cleaner, I hope it still could prove useful. 6 | 7 | ## Output 8 | 9 | ![GameBoyTilingSystem](https://www.dropbox.com/s/7la5zxeysyzaalz/gameboy_tiling_system.png?raw=1) 10 | 11 | ## Source 12 | 13 | [How to make a (GameBoy) emulator?](http://www.csnedelja.mg.edu.rs/static/resources/v1.0/emulation.pdf), [mgcsweek](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /GameBoy tiling system/gameboy_tiling_system.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning, matrix} 5 | 6 | \tikzset{ 7 | table/.style={ 8 | matrix of nodes, 9 | row sep=-\pgflinewidth, 10 | column sep=-\pgflinewidth, 11 | nodes={rectangle,draw=black,text width=0.05ex,align=center}, 12 | nodes in empty cells 13 | }, 14 | texto/.style={font=\footnotesize\sffamily}, 15 | title/.style={font=\small\sffamily} 16 | } 17 | 18 | \tikzset{ 19 | tablet/.style={ 20 | matrix of nodes, 21 | row sep=-\pgflinewidth, 22 | column sep=-\pgflinewidth, 23 | nodes={rectangle,draw=black,text width=2.25ex,align=center}, 24 | text height=1.625ex, 25 | text depth=0ex, 26 | nodes in empty cells 27 | }, 28 | texto/.style={font=\footnotesize\sffamily}, 29 | title/.style={font=\small\sffamily} 30 | } 31 | 32 | \tikzset{ 33 | tablett/.style={ 34 | matrix of nodes, 35 | row sep=-\pgflinewidth, 36 | column sep=-\pgflinewidth, 37 | nodes={rectangle, text width=0.05ex,align=center}, 38 | nodes in empty cells 39 | }, 40 | texto/.style={font=\footnotesize\sffamily}, 41 | title/.style={font=\small\sffamily} 42 | } 43 | 44 | \begin{document} 45 | \begin{tikzpicture}[node distance=0.5cm, auto] 46 | \matrix[table] (t1) 47 | { 48 | & & & & & & & \\ 49 | & & & & & & & \\ 50 | & & & & & & & \\ 51 | & & & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 52 | & & & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 53 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 54 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 55 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 56 | }; 57 | \node[above = 0.01cm of t1] (c1) {Tile 1}; 58 | 59 | \matrix[table, right =of t1] (t2) 60 | { 61 | & & & & & & & \\ 62 | & & & & & & & \\ 63 | & & & & & & & \\ 64 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 65 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 66 | & & & & & & & \\ 67 | & & & & & & & \\ 68 | & & & & & & & \\ 69 | }; 70 | \node[above = 0.01cm of t2] (c2) {Tile 2}; 71 | 72 | \matrix[table, right =of t2] (t3) 73 | { 74 | & & & & & & & \\ 75 | & & & & & & & \\ 76 | & & & & & & & \\ 77 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & & & \\ 78 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & & & \\ 79 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 80 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 81 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 82 | }; 83 | \node[above = 0.01cm of t3] (c3) {Tile 3}; 84 | 85 | \matrix[tablet, below = 1cm of t1] (mp) 86 | { 87 | \node (1) {\tt 1}; & \node (2) {\tt 2}; & \node (22) {\tt 2}; & \node (3) {\tt 3}; & \dots \\ 88 | \vdots & \vdots & \vdots & \vdots & $\ddots$ \\ 89 | }; 90 | \node[below = 0.01cm of mp] (c4) {Background map}; 91 | 92 | \draw [-stealth, thick] (1.north) -- (t1.south) ; 93 | \draw [-stealth, thick] (2.north) -- (t2.south); 94 | \draw [-stealth, thick] (22.north) -- (t2.south); 95 | \draw [-stealth, thick] (3.north) -- (t3.south); 96 | 97 | \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, below right = 1.1cm and -1.5cm of t2] (bg1) 98 | { 99 | & & & & & & & \\ 100 | & & & & & & & \\ 101 | & & & & & & & \\ 102 | & & & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 103 | & & & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 104 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 105 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 106 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 107 | }; 108 | 109 | \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, right = 0cm of bg1] (bg2) 110 | { 111 | & & & & & & & \\ 112 | & & & & & & & \\ 113 | & & & & & & & \\ 114 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 115 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 116 | & & & & & & & \\ 117 | & & & & & & & \\ 118 | & & & & & & & \\ 119 | }; 120 | 121 | \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, right = 0cm of bg2] (bg3) 122 | { 123 | & & & & & & & \\ 124 | & & & & & & & \\ 125 | & & & & & & & \\ 126 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 127 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 128 | & & & & & & & \\ 129 | & & & & & & & \\ 130 | & & & & & & & \\ 131 | }; 132 | 133 | \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, right = 0cm of bg3] (bg4) 134 | { 135 | & & & & & & & \\ 136 | & & & & & & & \\ 137 | & & & & & & & \\ 138 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & & & \\ 139 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & & & \\ 140 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 141 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 142 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 143 | }; 144 | 145 | \node[below right = 0.01cm and 0.03cm of bg1] (c5) {Background}; 146 | 147 | \draw [-stealth, white, ultra thick] (t1.south) -- (bg1.north) ; 148 | \draw [-stealth, white, ultra thick] (t2.south) -- (bg2.north); 149 | \draw [-stealth, white, ultra thick] (t2.south) -- (bg3.north); 150 | \draw [-stealth, thick] (t1.south) -- (bg1.north); 151 | \draw [-stealth, thick] (t2.south) -- (bg2.north); 152 | \draw [-stealth, thick] (t2.south) -- (bg3.north); 153 | \draw [-stealth, thick] (t3.south) -- (bg4.north); 154 | \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, below right = 1.1cm and -1.5cm of t2] (bg1) 155 | { 156 | & & & & & & & \\ 157 | & & & & & & & \\ 158 | & & & & & & & \\ 159 | & & & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 160 | & & & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 161 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 162 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 163 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 164 | }; 165 | 166 | \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, right = 0cm of bg1] (bg2) 167 | { 168 | & & & & & & & \\ 169 | & & & & & & & \\ 170 | & & & & & & & \\ 171 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 172 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 173 | & & & & & & & \\ 174 | & & & & & & & \\ 175 | & & & & & & & \\ 176 | }; 177 | 178 | \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, right = 0cm of bg2] (bg3) 179 | { 180 | & & & & & & & \\ 181 | & & & & & & & \\ 182 | & & & & & & & \\ 183 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 184 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| \\ 185 | & & & & & & & \\ 186 | & & & & & & & \\ 187 | & & & & & & & \\ 188 | }; 189 | 190 | \matrix[tablett, rectangle, draw, scale=0.2, inner sep=0ex, nodes={inner sep=0.4ex}, right = 0cm of bg3] (bg4) 191 | { 192 | & & & & & & & \\ 193 | & & & & & & & \\ 194 | & & & & & & & \\ 195 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & & & \\ 196 | |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & |[fill=gray]| & & & \\ 197 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 198 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 199 | & & & |[fill=gray]| & |[fill=gray]| & & & \\ 200 | }; 201 | 202 | \end{tikzpicture} 203 | \end{document} 204 | -------------------------------------------------------------------------------- /Gene expression/README.md: -------------------------------------------------------------------------------- 1 | # Gene expression 2 | 3 | ## Notes 4 | 5 | A visualisation of the gene expression process (transcription + translation). In retrospect, this involved a lot of manual positioning, and if I were to remake this I'd probably wrap the triplets in their own nodes. 6 | 7 | ## Output 8 | 9 | ![GeneExpression](https://www.dropbox.com/s/gyk749hdiuhtjrc/gene_expression.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Bioinformatics algorithms: analysis of DNA sequences](http://www.csnedelja.mg.edu.rs/static/resources/v1.0/bioinformatics.pdf), [mgcsweek](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Gene expression/gene_expression.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{snakes} 5 | 6 | \definecolor{mygreen}{HTML}{006400} 7 | \definecolor{mymauve}{rgb}{0.58,0,0.82} 8 | \definecolor{mygold}{HTML}{B8860B} 9 | \definecolor{mynavy}{HTML}{000080} 10 | 11 | \begin{document} 12 | \begin{tikzpicture} 13 | \node at (0,0) {\tt GTGCATCTGACTCCTGAGGAGTAG}; 14 | \node (dnk2) at (0,-0.5) {\tt CACGTAGACTGAGGACTCCTCATC}; 15 | \node at (-2.7, 0) {\tt \dots}; 16 | \node at (2.7, 0) {\tt \dots}; 17 | \node at (-2.7, -0.5) {\tt \dots}; 18 | \node at (2.7, -0.5) {\tt \dots}; 19 | \draw[red, opacity=0.4, very thick] (-3, 0) -- (3, 0); 20 | \draw[blue, opacity=0.4, very thick] (-3, -0.5) -- (3, -0.5); 21 | 22 | \node at (4, -0.25) {DNA}; 23 | 24 | \node (rnk) at (0,-2.5) {\tt \textcolor{blue}{GUG}\textcolor{mygreen}{CAU}\textcolor{orange}{CUG}\textcolor{mymauve}{ACU}\textcolor{mygold}{CCU}\textcolor{mynavy}{GAGGAG}\tikz[baseline]{\node[rectangle, fill=red,inner sep=0.3mm,anchor=base] (X) {\textcolor{white}{UAG}};}}; 25 | \draw[gray, opacity=0.4, very thick] (-3, -2.5) -- (3, -2.5); 26 | 27 | \draw [thick, decoration={ brace, mirror, raise=0.5cm}, decorate] (-2.22, -2.2) -- (-1.7, -2.2); 28 | \draw [thick, decoration={ brace, mirror, raise=0.5cm}, decorate] (-1.65, -2.2) -- (-1.15, -2.2); 29 | \draw [thick, decoration={ brace, mirror, raise=0.5cm}, decorate] (-1.1, -2.2) -- (-0.6, -2.2); 30 | \draw [thick, decoration={ brace, mirror, raise=0.5cm}, decorate] (-0.55, -2.2) -- (-0.05, -2.2); 31 | \draw [thick, decoration={ brace, mirror, raise=0.5cm}, decorate] (0, -2.2) -- (0.5, -2.2); 32 | \draw [thick, decoration={ brace, mirror, raise=0.5cm}, decorate] (0.55, -2.2) -- (1.05, -2.2); 33 | \draw [thick, decoration={ brace, mirror, raise=0.5cm}, decorate] (1.1, -2.2) -- (1.6, -2.2); 34 | \draw [thick, decoration={ brace, mirror, raise=0.5cm}, decorate] (1.65, -2.2) -- (2.2, -2.2); 35 | 36 | \node at (4, -2.5) {mRNA}; 37 | 38 | \draw[-stealth, thick] (dnk2) -- node[right] {\emph{transcription}} (rnk); 39 | 40 | \draw[-stealth, thick] (-1.96, -2.9) -- (-1.96, -4.3); 41 | \node at (-1.96, -4.5) {\tt \textcolor{blue}V}; 42 | 43 | \draw[-stealth, thick] (-1.4, -2.9) -- (-1.4, -4.3); 44 | \node at (-1.4, -4.5) {\tt \textcolor{mygreen}H}; 45 | 46 | \draw[-stealth, thick] (-0.85, -2.9) -- (-0.85, -4.3); 47 | \node at (-0.85, -4.5) {\tt \textcolor{orange}L}; 48 | 49 | \draw[-stealth, thick] (-0.3, -2.9) -- (-0.3, -4.3); 50 | \node at (-0.3, -4.5) {\tt \textcolor{mymauve}T}; 51 | 52 | \draw[-stealth, thick] (0.25, -2.9) -- (0.25, -4.3); 53 | \node at (0.25, -4.5) {\tt \textcolor{mygold}P}; 54 | 55 | \draw[-stealth, thick] (0.8, -2.9) -- (0.8, -4.3); 56 | \node at (0.8, -4.5) {\tt \textcolor{mynavy}E}; 57 | 58 | \draw[-stealth, thick] (1.35, -2.9) -- (1.35, -4.3); 59 | \node at (1.35, -4.5) {\tt \textcolor{mynavy}E}; 60 | 61 | \draw[-stealth, thick] (1.925, -2.9) -- node[right] {\emph{translation}} (1.925, -4.3); 62 | \node at (1.925, -4.5) {\tikz[baseline]{\node[rectangle, fill=red,inner sep=0.3mm,anchor=base] (X) {\textcolor{white}{\tt STOP}};}}; 63 | 64 | \draw[gray, opacity=0.4, very thick] (-3, -4.5) -- (3, -4.5); 65 | 66 | \node at (4, -4.5) {protein}; 67 | \end{tikzpicture} 68 | \end{document} 69 | -------------------------------------------------------------------------------- /Generative adversarial network/README.md: -------------------------------------------------------------------------------- 1 | # Generative adversarial network (GAN) 2 | 3 | ## Notes 4 | 5 | A simple representation of a generative adversarial network (GAN) architecture, abstracting away from the neural network architectures used in the generator and discriminator. Can be easily extended into an animated illustration of the training schedule for GANs (by "sliding") the arrow into one of the two locked positions. 6 | 7 | ## Output 8 | 9 | ![GAN](https://www.dropbox.com/s/vlh62d05lavckpk/generative_adversarial_network.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Unsupervised methods: Diving deep into autoencoders](http://www.cl.cam.ac.uk/~pv273/slides/UCLSlides.pdf), *Introduction to Deep Learning (COMPGI23), University College London* 14 | -------------------------------------------------------------------------------- /Generative adversarial network/generative_adversarial_network.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop,tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \begin{document} 7 | \begin{tikzpicture} 8 | 9 | \node[circle, draw, thick] (z) {$\vec{z}$}; 10 | \node[circle, draw, thick, right=5em of z] (x) {$\vec{x}_{fake}$}; 11 | \draw[-stealth, thick] (z) -- node[above] {$G(\vec{z})$} node[below] {generator} (x); 12 | \node[left=of z] (i) {}; 13 | \draw[-stealth, thick] (i) -- node[above] {$p_\theta(\vec{z})$} (z); 14 | \node[above=of x, circle, draw, thick] (xt) {$\vec{x}_{real}$}; 15 | \node[left=5em of xt] (it) {}; 16 | \draw[-stealth, thick] (it) -- node[above] {$p_{data}(\vec{x})$} (xt); 17 | \node[circle, draw, thick, right=5em of x, yshift=2.5em] (D) {$\vec{x}$}; 18 | \node[right=7em of D] (out) {real?}; 19 | \draw[-stealth, thick] (D) -- node[above] {$D(\vec{x})$} node[below] {discriminator} (out); 20 | 21 | \node[right=2.5em of x, circle, fill, inner sep=0.15em] (pt1) {}; 22 | \node[right=2.5em of xt, circle, fill, inner sep=0.15em] (pt2) {}; 23 | 24 | \draw[dashed, thick] (pt1) edge[bend left] (pt2); 25 | 26 | \node[circle, draw, thick, fill=white, inner sep=0.15em] at ([xshift=-0.9em, yshift=4em]pt1.north) (pt3) {}; 27 | 28 | \draw[-stealth, thick] (x) -- (pt1); 29 | \draw[-stealth, thick] (xt) -- (pt2); 30 | \draw[-stealth, thick] (pt3) -- (D); 31 | 32 | \end{tikzpicture} 33 | \end{document} -------------------------------------------------------------------------------- /Graph convolution/README.md: -------------------------------------------------------------------------------- 1 | # Graph Convolution 2 | 3 | ## Notes 4 | 5 | A generic overview of a graph convolution operation, highlighting the relevant information for deriving the next-level features for every node in the graph. 6 | 7 | ## Output 8 | 9 | ![GraphConv](https://www.dropbox.com/s/zgj3a0hqabe4e4i/graph_conv.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Graph Attention Networks](http://petar-v.com/GAT/) blog post 14 | -------------------------------------------------------------------------------- /Graph convolution/graph_convolution.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{arrows,shapes} 5 | 6 | \definecolor{mygreen}{rgb}{0,0.6,0} 7 | 8 | \pgfdeclarelayer{background} 9 | \pgfsetlayers{background,main} 10 | 11 | \tikzstyle{vertex}=[circle,fill=black!25,minimum size=20pt,inner sep=0pt] 12 | \tikzstyle{selected vertex} = [vertex, fill=red!24] 13 | \tikzstyle{select vertex} = [vertex, fill=blue!24] 14 | \tikzstyle{selectx vertex} = [vertex, fill=green!24] 15 | \tikzstyle{edge} = [draw,thick,-] 16 | \tikzstyle{selected edge} = [draw,line width=5pt,-,red!50] 17 | 18 | \begin{document} 19 | 20 | \begin{tikzpicture}[scale=1.8, auto,swap] 21 | \foreach \pos/\name in {{(0,2)/a}, {(2,1)/b}, {(4,1)/c}, 22 | {(0,0)/d}, {(3,0)/e}, {(2,-1)/f}, {(4,-1)/g}} 23 | \node[vertex] (\name) at \pos {}; 24 | 25 | \foreach \source/ \dest /\weight in {b/a/7, c/b/8,d/a/5,d/b/9, 26 | e/b/7, e/c/5,e/d/15, 27 | f/d/6,f/e/8, 28 | g/e/9,g/f/11} 29 | \path[edge] (\source) -- (\dest); 30 | 31 | \foreach \vertex / \fr in {b/4} 32 | \path node[selected vertex] at (\vertex) {$\vec{h}_b$}; 33 | \foreach \vertex / \fr in {a/4, c/4, d/4, e/5} 34 | \path node[select vertex] at (\vertex) {$\vec{h}_{\vertex}$}; 35 | \begin{pgfonlayer}{background} 36 | \foreach \source / \dest in {b/c,d/b,a/b,b/e} 37 | \path[selected edge] (\source.center) -- (\dest.center); 38 | \end{pgfonlayer} 39 | 40 | \foreach \pos/\name in {{(6,2)/a1}, {(8,1)/b1}, {(10,1)/c1}, 41 | {(6,0)/d1}, {(9,0)/e1}, {(8,-1)/f1}, {(10,-1)/g1}} 42 | \node[vertex] (\name) at \pos {}; 43 | \foreach \source/ \dest /\weight in {b1/a1/7, c1/b1/8,d1/a1/5,d1/b1/9, 44 | e1/b1/7, e1/c1/5,e1/d1/15, 45 | f1/d1/6,f1/e1/8, 46 | g1/e1/9,g1/f1/11} 47 | \path[edge] (\source) -- (\dest); 48 | \foreach \vertex / \fr in {b1/4} 49 | \path node[selectx vertex] at (\vertex) {$\vec{h}'_b$}; 50 | 51 | \draw[-stealth, densely dotted, ultra thick, mygreen] (b) edge[bend left=20] (b1); 52 | \end{tikzpicture} 53 | 54 | \end{document} -------------------------------------------------------------------------------- /HMM transition smoothing/README.md: -------------------------------------------------------------------------------- 1 | # Hidden Markov model (HMM) transition smoothing 2 | 3 | ## Notes 4 | 5 | This diagram represents all the variables (known or previously computed) related in determining the probability of taking a transition i -> j at time t within a hidden Markov model (HMM); this is one of the initial estimation steps of the Baum-Welch algorithm. 6 | 7 | ## Output 8 | 9 | ![HMMTransitionSmoothing](https://www.dropbox.com/s/euu61pfzcavosvc/hmm_transition_smoothing.png?raw=1) 10 | 11 | ## Source 12 | 13 | *TBA* 14 | -------------------------------------------------------------------------------- /HMM transition smoothing/hmm_transition_smoothing.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \begin{document} 5 | \begin{tikzpicture} 6 | 7 | % 1st column 8 | \node at (0,6.5) {$t-1$}; 9 | \node[align=center, circle, draw, thick] (s1_1) at (0,5) {$s_1$\\{\scriptsize$\alpha_{t-1}(s_1)$}}; 10 | \node[align=center, circle, draw, thick] (s2_1) at (0,3) {$s_2$\\{\scriptsize$\alpha_{t-1}(s_2)$}}; 11 | \node[align=center, circle, draw, thick] (s3_1) at (0,1) {$s_3$\\{\scriptsize$\alpha_{t-1}(s_3)$}}; 12 | \node[align=center, circle, draw, thick] (s4_1) at (0,-1) {$s_4$\\{\scriptsize$\alpha_{t-1}(s_4)$}}; 13 | \node [draw, thick] at (0,-2.5) {$(y_{t-1}, id_{t-1})$}; 14 | 15 | % 2nd column 16 | \node at (3.5,6.5) {$t$}; 17 | \node[circle, draw, thick] (s1_2) at (3.5,5) {$s_1$} 18 | edge[gray, thin, stealth-] (s1_1) 19 | edge[gray, thin, stealth-] (s2_1) 20 | edge[gray, thin, stealth-] (s3_1) 21 | edge[gray, thin, stealth-] (s4_1); 22 | \node[circle, draw, thick] (s3_2) at (3.5,1) {$s_3$} 23 | edge[gray, thin, stealth-] (s1_1) 24 | edge[gray, thin, stealth-] (s2_1) 25 | edge[gray, thin, stealth-] (s3_1) 26 | edge[gray, thin, stealth-] (s4_1); 27 | \node[circle, draw, thick] (s4_2) at (3.5,-1) {$s_4$} 28 | edge[gray, thin, stealth-] (s1_1) 29 | edge[gray, thin, stealth-] (s2_1) 30 | edge[gray, thin, stealth-] (s3_1) 31 | edge[gray, thin, stealth-] (s4_1); 32 | \node[align=center, circle, draw, ultra thick, minimum size=4.25em] (s2_2) at (3.5,3) {$s_2$\\{\scriptsize$\alpha_{t}(s_2)$}}; 33 | 34 | % 3rd column 35 | \node [] (asdf2) at (8.5,-2.5) {$(y_{t+1}, id_{t+1})$}; 36 | \node [draw, thick] (asdf3) at (12,-2.5) {$(y_{t+2}, id_{t+2})$}; 37 | \node[align=center, circle, draw, ultra thick, minimum size=4.25em] (s3_3) at (8.5,1) {$s_3$\\{\scriptsize$\beta_{t+1}(s_3)$}} 38 | edge[gray, thin, stealth-] (s1_2) 39 | edge[gray, thin, stealth-] (s3_2) 40 | edge[gray, thin, stealth-] (s4_2); 41 | \draw[-stealth, very thick, dashed, bend left=90] (asdf2.west) to node[pos=0.33, align=center, fill=white] {${\bf O'}_{3,id_{t+1}}$\\$\mathcal{N}(y_{t+1};\mu_{id_{t+1}},\sigma_{id_{t+1}})$} (s3_3.west); 42 | \node [draw, thick] (asdf2) at (8.5,-2.5) {$(y_{t+1}, id_{t+1})$}; 43 | \node at (8.5,6.5) {$t+1$}; 44 | \node[circle, draw, thick] (s1_3) at (8.5,5) {$s_1$} 45 | edge[gray, thin, stealth-] (s1_2) 46 | edge[gray, thin, stealth-] (s2_2) 47 | edge[gray, thin, stealth-] (s3_2) 48 | edge[gray, thin, stealth-] (s4_2); 49 | \node[circle, draw, thick] (s2_3) at (8.5,3) {$s_2$} 50 | edge[gray, thin, stealth-] (s1_2) 51 | edge[gray, thin, stealth-] (s2_2) 52 | edge[gray, thin, stealth-] (s3_2) 53 | edge[gray, thin, stealth-] (s4_2); 54 | \node[circle, draw, thick] (s4_3) at (8.5,-1) {$s_4$} 55 | edge[gray, thin, stealth-] (s1_2) 56 | edge[gray, thin, stealth-] (s2_2) 57 | edge[gray, thin, stealth-] (s3_2) 58 | edge[gray, thin, stealth-] (s4_2); 59 | 60 | % 4th column 61 | \node at (12,6.5) {$t+2$}; 62 | \node[align=center, circle, draw, thick] (s1_4) at (12,5) {$s_1$\\{\scriptsize$\beta_{t+2}(s_1)$}} 63 | edge[gray, thin, stealth-] (s1_3) 64 | edge[gray, thin, stealth-] (s2_3) 65 | edge[gray, thin, stealth-] (s4_3); 66 | \node[align=center, circle, draw, thick] (s2_4) at (12,3) {$s_2$\\{\scriptsize$\beta_{t+2}(s_2)$}} 67 | edge[gray, thin, stealth-] (s1_3) 68 | edge[gray, thin, stealth-] (s2_3) 69 | edge[gray, thin, stealth-] (s4_3); 70 | \node[align=center, circle, draw, thick] (s3_4) at (12,1) {$s_3$\\{\scriptsize$\beta_{t+2}(s_3)$}} 71 | edge[gray, thin, stealth-] (s1_3) 72 | edge[gray, thin, stealth-] (s2_3) 73 | edge[gray, thin, stealth-] (s4_3); 74 | \node[align=center, circle, draw, thick] (s4_4) at (12,-1) {$s_4$\\{\scriptsize$\beta_{t+2}(s_4)$}} 75 | edge[gray, thin, stealth-] (s1_3) 76 | edge[gray, thin, stealth-] (s2_3) 77 | edge[gray, thin, stealth-] (s4_3); 78 | \draw[very thick, stealth-] (s2_2) to node [midway, fill=white] {${\bf T}_{12}$} (s1_1); 79 | \draw[very thick, stealth-] (s2_2) to node [midway, fill=white] {${\bf T}_{22}$} (s2_1); 80 | \draw[very thick, stealth-] (s2_2) to node [midway, fill=white] {${\bf T}_{32}$} (s3_1); 81 | \draw[very thick, stealth-] (s2_2) to node [midway, fill=white] {${\bf T}_{42}$} (s4_1); 82 | \draw[very thick, stealth-] (s1_4) to node [midway, fill=white] {${\bf T}_{31}$} (s3_3); 83 | \draw[very thick, stealth-] (s2_4) to node [midway, fill=white] {${\bf T}_{32}$} (s3_3); 84 | \draw[very thick, stealth-] (s3_4) to node [midway, fill=white] {${\bf T}_{33}$} (s3_3); 85 | \draw[very thick, stealth-] (s4_4) to node [midway, fill=white] {${\bf T}_{34}$} (s3_3); 86 | \draw[very thick, stealth-] (s3_3) to node [midway, fill=white] {${\bf T}_{23}$} (s2_2); 87 | \node [draw, thick] (asdf) at (3.5,-2.5) {$(y_{t}, id_{t})$}; 88 | 89 | \end{tikzpicture} 90 | \end{document} 91 | -------------------------------------------------------------------------------- /Hamiltonian graph/README.md: -------------------------------------------------------------------------------- 1 | # Hamiltonian graph 2 | 3 | ## Notes 4 | 5 | A diagram of a simple Hamiltonian graph, with its Hamiltonian cycle highlighted. Showcases the simplicity of using the `tkz-graph` package. 6 | 7 | ## Output 8 | 9 | ![HamiltonianGraph](https://www.dropbox.com/s/qv7i0gmwpirg3dj/hamiltonian_graph.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Bioinformatics algorithms: analysis of DNA sequences](http://www.csnedelja.mg.edu.rs/static/resources/v1.0/bioinformatics.pdf), [mgcsweek](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Hamiltonian graph/hamiltonian_graph.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{tkz-graph} 4 | 5 | \begin{document} 6 | \begin{tikzpicture}[scale=0.8,every node/.style={scale=0.7},font=\tt] 7 | \SetUpEdge[lw = 1.5pt, 8 | color = red, 9 | labelcolor = white] 10 | \GraphInit[vstyle=Normal] 11 | \SetGraphUnit{3} 12 | \tikzset{VertexStyle/.append style={fill}} 13 | \Vertex{ATG} 14 | \EA(ATG){TGG} 15 | \EA(TGG){GGC} 16 | \SO(GGC){GCG} 17 | \WE(GCG){CGT} 18 | \WE(CGT){GTG} 19 | \WE(GTG){TGC} 20 | \WE(TGC){GCA} 21 | \NO(GCA){CAA} 22 | \EA(CAA){AAT} 23 | \tikzset{EdgeStyle/.style={-stealth, color=black}} 24 | \Edge(ATG)(TGC) 25 | \Edge(GTG)(TGG) 26 | \Edge(GGC)(GCA) 27 | \tikzset{EdgeStyle/.style={-stealth, color=black, bend right}} 28 | \Edge(TGC)(GCG) 29 | \tikzset{EdgeStyle/.style={-stealth}} 30 | \Edge(ATG)(TGG) 31 | \Edge(TGG)(GGC) 32 | \Edge(GGC)(GCG) 33 | \Edge(GCG)(CGT) 34 | \Edge(CGT)(GTG) 35 | \Edge(GTG)(TGC) 36 | \Edge(TGC)(GCA) 37 | \Edge(GCA)(CAA) 38 | \Edge(CAA)(AAT) 39 | \Edge(AAT)(ATG) 40 | \end{tikzpicture} 41 | \end{document} 42 | -------------------------------------------------------------------------------- /Hierarchical graph classifier/README.md: -------------------------------------------------------------------------------- 1 | # Hierarchical graph classifier 2 | 3 | ## Notes 4 | 5 | A generic overview of a CNN-inspired graph classifier, demonstrating an interchange of convolutional and pooling layers. 6 | 7 | ## Output 8 | 9 | ![GraphClass](https://www.dropbox.com/s/r1p7tc4d4g480hw/hierarchical_graph_classifier.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Towards Sparse Hierarchical Graph Classifiers](https://arxiv.org/abs/1811.01287), _NeurIPS R2L 2018_ 14 | -------------------------------------------------------------------------------- /Hierarchical graph classifier/hierarchical_graph_classifier.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{relsize} 4 | \usepackage{bm} 5 | 6 | \usetikzlibrary{positioning,decorations.pathmorphing} 7 | 8 | \definecolor{mygreen}{rgb}{0,0.6,0} 9 | \definecolor{mymauve}{rgb}{0.58,0,0.82} 10 | \definecolor{camdrk}{RGB}{0,62,114} 11 | 12 | \begin{document} 13 | \begin{tikzpicture} 14 | 15 | \node[circle, draw, thick] (h1) {}; 16 | \node[circle, draw, thick, right=of h1] (h2) {}; 17 | \node[circle, draw, thick, below=of h1] (h3) {}; 18 | \node[circle, draw, thick, right=of h3] (h4) {}; 19 | \node[circle, draw, thick, below=of h3] (h5) {}; 20 | \node[circle, draw, thick, right=of h5] (h6) {}; 21 | 22 | \draw[-, thick] (h1) -- (h4); 23 | \draw[-, thick] (h2) -- (h3); 24 | \draw[-, thick] (h2) -- (h4); 25 | \draw[-, thick] (h3) -- (h4); 26 | \draw[-, thick] (h3) -- (h6); 27 | \draw[-, thick] (h4) -- (h5); 28 | \draw[-, thick] (h5) -- (h6); 29 | 30 | \path [draw=black, smooth, fill=camdrk, fill opacity=0.3, very thick] 31 | ([xshift=-0.5em,yshift=0.5em]h1.north west) -- ([xshift=0.5em,yshift=0.5em]h2.north east) -- ([xshift=0.5em,yshift=-0.5em]h6.south east) -- ([xshift=-0.5em,yshift=-0.5em]h5.south west) -- cycle; 32 | 33 | \node[circle, draw, thick, red, fill=red!10, right=10em of h1] (g1) {}; 34 | \node[circle, draw, thick, red, fill=red!10, right=of g1] (g2) {}; 35 | \node[circle, draw, thick, below=of g1] (g3) {}; 36 | \node[circle, draw, thick, right=of g3] (g4) {}; 37 | \node[circle, draw, thick, red, fill=red!10, below=of g3] (g5) {}; 38 | \node[circle, draw, thick, right=of g5] (g6) {}; 39 | 40 | \draw[-, thick, dashed, lightgray] (g1) -- (g4); 41 | \draw[-, thick, dashed, lightgray] (g2) -- (g3); 42 | \draw[-, thick, dashed, lightgray] (g2) -- (g4); 43 | \draw[-, thick] (g3) -- (g4); 44 | \draw[-, thick] (g3) -- (g6); 45 | \draw[-, thick, dashed, lightgray] (g4) -- (g5); 46 | \draw[-, thick, dashed, lightgray] (g5) -- (g6); 47 | 48 | \node[red] (icr) at (g1) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; 49 | \node[red] (icr) at (g2) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; 50 | \node[red] (icr) at (g5) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; 51 | 52 | \path [draw=black, smooth, fill=mymauve, fill opacity=0.3, very thick] 53 | ([xshift=-0.5em,yshift=0.5em]g3.north west) -- ([xshift=0.5em,yshift=0.5em]g4.north east) -- ([xshift=0.5em,yshift=-0.5em]g6.south east) -- ([xshift=-0.5em,yshift=-0.5em]g6.south west) -- ([xshift=-0.5em,yshift=-0.5em]g3.south west) -- cycle; 54 | 55 | \node[circle, thick, right=10em of g1] (i1) {}; 56 | \node[circle, thick, right=of i1] (i2) {}; 57 | \node[circle, draw, thick, below=of i1] (i3) {}; 58 | \node[circle, draw, red, thick, fill=red!10, right=of i3] (i4) {}; 59 | \node[circle, thick, below=of i3] (i5) {}; 60 | \node[circle, draw, thick, right=of i5] (i6) {}; 61 | 62 | \draw[-, thick, dashed, lightgray] (i3) -- (i4); 63 | \draw[-, thick] (i3) -- (i6); 64 | 65 | \node[red] (icr) at (i4) {$\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\bm{\times}}}}}}$}; 66 | 67 | \draw[-stealth, ultra thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] ([xshift=0.5em]h4.east) -- node[below, black] {pool} node[above] {GCN} ([xshift=-0.5em]g3.west); 68 | \draw[-stealth, ultra thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] ([xshift=0.5em]g4.east) -- node[above] {GCN} node[below] {pool}([xshift=-0.5em]i3.west); 69 | 70 | \path [draw=black, smooth, fill=mygreen, fill opacity=0.3, very thick] 71 | ([xshift=-0.5em,yshift=0.5em]i3.north west) -- ([xshift=0.5em,yshift=0.5em]i3.north east) --([xshift=0.5em,yshift=0.5em]i6.north east) --([xshift=0.5em,yshift=-0.5em]i6.south east) -- ([xshift=-0.5em,yshift=-0.5em]i6.south west) -- ([xshift=-0.5em,yshift=-0.5em]i3.south west) -- cycle; 72 | 73 | \node[circle, draw, thick, right=10em of i3] (S) {$\boldsymbol\Sigma$}; 74 | 75 | \path[-stealth, mymauve, ultra thick] ([xshift=0.5em, yshift=0.5em]g4.north east) edge[bend left,decoration={zigzag, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] node[sloped,above] {mean $\|$ max} (S); 76 | 77 | 78 | \path[-stealth, mygreen, ultra thick] ([xshift=0.4em]i6.east) edge[bend right,decoration={zigzag, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] node[sloped,below] {mean $\|$ max} (S); 79 | 80 | \node[right=5em of S] (P) {\emph{predict}}; 81 | 82 | \draw[-stealth, ultra thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (S.east) --node[above] {MLP} (P.west); 83 | 84 | \end{tikzpicture} 85 | \end{document} -------------------------------------------------------------------------------- /IQ sampling/README.md: -------------------------------------------------------------------------------- 1 | # IQ sampling 2 | 3 | ## Notes 4 | 5 | A high-level circuit diagram for IQ sampling. It features prominent use of "Ti*k*Z within Ti*k*Z", with usage of `axis` as well, primarily with the purpose of sketching symbols for some of the components (e.g. the low-pass filters). 6 | 7 | ## Output 8 | 9 | ![IQSampling](https://www.dropbox.com/s/ml60686hj9lro62/iq_sampling.png?raw=1) 10 | 11 | ## Source 12 | 13 | IQ sampling and FM demodulation using MATLAB, [mgcsweek v2.0](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /IQ sampling/iq_sampling.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{pgfplots} 4 | 5 | \begin{document} 6 | \begin{tikzpicture}[cross/.style={path picture={ 7 | \draw[black] (path picture bounding box.south east) -- (path picture bounding box.north west) (path picture bounding box.south west) -- (path picture bounding box.north east); 8 | }}] 9 | 10 | \node[rectangle, align=center] (fm) at (-2, 0) {\begin{tikzpicture}[samples=1000, domain=0:5] 11 | \begin{axis}[ 12 | hide axis, 13 | width=4cm, height=2cm, 14 | xtick=\empty, 15 | ytick=\empty, 16 | xlabel=\empty, 17 | ylabel=\empty, 18 | xmin=0, xmax=5, 19 | ymin=-2.1, ymax=2.1, 20 | trig format = rad 21 | ] 22 | \addplot expression [no markers, smooth, thick, black] {2*sin(2*pi*3*x - 8*cos(2*pi*0.25*x))}; 23 | \end{axis} 24 | \end{tikzpicture}\\ $FM(t)$}; 25 | 26 | \node[rectangle, align=center] (cos) at (1, -3) {\tikz \draw[x=1.5ex, y=1ex, thick] (0, 0) sin (0.5, 0.5) cos (1, 0) sin (1.5, -0.5) cos (2, 0) sin (2.5, 0.5) cos (3, 0) sin (3.5, -0.5) cos (4, 0) sin (4.5, 0.5) cos (5, 0) sin (5.5, -0.5) cos (6, 0);\\ $\cos(2\pi f t)$}; 27 | 28 | \node[circle, draw, cross, thick] (mul1) at (1, -0.7) {}; 29 | \node[circle, draw, cross, thick] (mul2) at (2, 1.3) {}; 30 | \node[rectangle, draw, thick] (rot) at (2, 0.3) {$-90^\circ$}; 31 | \node[rectangle] (it) at (3, -1) {$I(t)$}; 32 | \node[rectangle] (qt) at (3, 1.6) {$Q(t)$}; 33 | \node[rectangle, draw, thick, align=center] (lp1) at (4.75, -0.7) {\tikz \draw[x=3.5ex, y=1ex, thick] (0, 0) sin (0.5, 0.5) cos (1, 0) sin (1.5, -0.5) cos (2, 0) (0.6, -0.5) -- (1.4, 0.5);\\ \tikz \draw[x=3.5ex, y=1ex, thick] (0, 0) sin (0.5, 0.5) cos (1, 0) sin (1.5, -0.5) cos (2, 0);}; 34 | \node[rectangle, draw, thick, align=center] (lp2) at (4.75, 1.3) {\tikz \draw[x=3.5ex, y=1ex, thick] (0, 0) sin (0.5, 0.5) cos (1, 0) sin (1.5, -0.5) cos (2, 0) (0.6, -0.5) -- (1.4, 0.5);\\ \tikz \draw[x=3.5ex, y=1ex, thick] (0, 0) sin (0.5, 0.5) cos (1, 0) sin (1.5, -0.5) cos (2, 0);}; 35 | \node[rectangle, draw, thick] (samp1) at (7.25, -0.7) {sample}; 36 | \node[rectangle, draw, thick] (samp2) at (7.25, 1.3) {sample}; 37 | \node[rectangle] (in) at (8.5, -1) {$I_n$}; 38 | \node[rectangle] (qn) at (8.5, 1.6) {$Q_n$}; 39 | 40 | \draw[thick, -stealth] (-0.65, 0.3) -- (0, 0.3) |- (mul1); 41 | \draw[thick, -stealth] (0, 0.3) |- (mul2); 42 | \draw[thick, -stealth] (cos) -- (mul1); 43 | \draw[thick, -stealth] (1, -1.85) -| (rot); 44 | \draw[thick, -stealth] (rot) -- (mul2); 45 | \draw[thick] (mul1) -- (1.9, -0.7); 46 | \draw[thick] (1.89, -0.7) sin (2, -0.6) cos (2.11, -0.7); 47 | \draw[thick, -stealth] (2.1, -0.7) -- (lp1); 48 | \draw[thick, -stealth] (mul2) -- (lp2); 49 | \draw[thick, -stealth] (lp1) -- (samp1); 50 | \draw[thick, -stealth] (lp2) -- (samp2); 51 | \draw[thick] (samp1) -| (9, 0.3); 52 | \draw[thick] (samp2) -| (9, 0.3); 53 | \draw[thick, -stealth] (9, 0.3) -- node[below] {$(I_n, Q_n)$} (11, 0.3); 54 | 55 | \end{tikzpicture} 56 | \end{document} 57 | -------------------------------------------------------------------------------- /Instruction execution/README.md: -------------------------------------------------------------------------------- 1 | # Instruction execution 2 | 3 | ## Notes 4 | 5 | A schematic of a single instruction being fetched, decoded and executed on the GameBoy's CPU. Features prominent use of scopes and custom coordinates. 6 | 7 | **N.B.** Originally designed for a `beamer` presentation; in order to make it properly display on a `standalone` document class, I had to draw a rectangle around roughly the image area. 8 | 9 | ## Output 10 | 11 | ![InstructionExecution](https://www.dropbox.com/s/2ef4cikfhypu3np/instruction_execution.png?raw=1) 12 | 13 | ## Source 14 | 15 | [How to make a (GameBoy) emulator?](http://www.cl.cam.ac.uk/~pv273/slides/emulation.pdf), [Cambridge Coding Academy Summer School](https://cambridgecoding.com/summer-school) 16 | -------------------------------------------------------------------------------- /Instruction execution/instruction_execution.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning, matrix, backgrounds} 5 | 6 | \tikzstyle{block} = [rectangle, draw, fill=blue!20, 7 | text width=5em, text centered, rounded corners, minimum height=4em] 8 | 9 | \definecolor{mygreen}{rgb}{0,0.6,0} 10 | \definecolor{echodrk}{HTML}{0099cc} 11 | 12 | \begin{document} 13 | \begin{tikzpicture}[node distance=3cm, auto] 14 | \draw[opacity=0] (-6, -3.5) rectangle (4, 3.3); 15 | \begin{scope}[shift={(-4,-2)},transform canvas={scale=0.7}] 16 | \node [block, color=black, very thick, fill=lightgray!70, minimum height=15em, text width=20em] (cpu) {}; 17 | \node [above left] (lab) at (cpu.south east) {\LARGE \bf CPU}; 18 | \node [below right=2.5em, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (PC) at (cpu.north west) {\tt 13}; 19 | \node[below=0.1em of PC] (lPC) {\tt PC}; 20 | \node [right=1em of PC, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (SP) {\tt 25}; 21 | \node[below=0.1em of SP] (lSP) {\tt SP}; 22 | \node [right=1em of SP, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (A) {\tt 1}; 23 | \node[below=0.1em of A] (lA) {\tt A}; 24 | \node [right=1em of A, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (B) {\tt 7}; 25 | \node[below=0.1em of B] (lB) {\tt B}; 26 | \node [right=1em of B, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (C) {\tt 3}; 27 | \node[below=0.1em of C] (lC) {\tt C}; 28 | \node [right=0.6em of C] (etc) {\Huge \dots}; 29 | \node [below=1.5em of PC, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (ZF) {\tt F}; 30 | \node[below=0.1em of ZF] (lZF) {\tt ZF}; 31 | \node [right=1em of ZF, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (OF) {\tt T}; 32 | \node[below=0.1em of OF] (lOF) {\tt OF}; 33 | \node [right=1em of OF, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (HCF) {\tt F}; 34 | \node[below=0.1em of HCF] (lHCF) {\tt HCF}; 35 | \node [right=1em of HCF, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=2em] (CF) {\tt F}; 36 | \node[below=0.1em of CF] (lCF) {\tt CF}; 37 | \node [right=1em of CF, block, color=black, very thick, fill=lightgray!30, minimum height=2em, inner sep=0em, text width=5em] (tkz) {\tt 15739}; 38 | \node[below=0.1em of tkz] (ltkz) {\tt ticks}; 39 | 40 | \coordinate (PC) at (-0.5, 2); 41 | \coordinate (A) at (1.1, 2); 42 | \coordinate (ZF) at (-0.5, 0.6); 43 | \coordinate (OF) at (0.3, 0.6); 44 | \coordinate (HCF) at (1.1, 0.6); 45 | \coordinate (CF) at (1.9, 0.6); 46 | \coordinate (tkz) at (3.4, 1.0); 47 | \end{scope} 48 | \begin{scope}[font=\ttfamily, array/.style={matrix of nodes,nodes={draw, minimum size=7mm, fill=green!30},column sep=-\pgflinewidth, row sep=0.5mm, nodes in empty cells, row 2/.style={nodes={draw=none, fill=none, minimum size=5mm}}}, shift={(-2.9,2)},transform canvas={scale=1.0}] 49 | \matrix[array,ampersand replacement=\&] (array) { 50 | 6 \& 12 \& 1 \& 214 \& 5 \& 0 \& 255 \& 4 \\ 51 | {\tiny \dots} \& 9 \& 10 \& 11 \& 12 \& 13 \& 14 \& {\tiny \dots}\\}; 52 | 53 | \begin{scope}[on background layer] 54 | \fill[green!10] (array-2-1.north west) rectangle (array-2-8.south east); 55 | \end{scope} 56 | \draw[<->, opacity=0.0]([yshift=0mm]array-1-1.north west) -- node[above,color=black, opacity=1.0] {Memory} ([yshift=0mm]array-1-8.north east); 57 | 58 | \node[draw, fill=red, opacity=0.5, minimum size=6mm] at (array-1-5) (box) {}; 59 | 60 | \draw (array-2-8.east)--++(0:3mm) node [right]{Address}; 61 | 62 | \draw[-stealth, ultra thick, red] (PC) -- (array-2-5); 63 | \node[] (subi) at (6, -2) {\tt Sub(A, \textcolor{red}{5})}; 64 | \draw[-stealth, ultra thick, mygreen] (box) -- (subi); 65 | \path[-stealth, ultra thick, echodrk] (subi.west) edge[bend right=20] (A); 66 | \path[-stealth, ultra thick, echodrk] (subi.west) edge[bend right=20] (PC); 67 | \draw[-stealth, ultra thick, echodrk] (subi) -- (tkz); 68 | \path[-stealth, ultra thick, echodrk] (subi) edge[bend left=65] (ZF); 69 | \path[-stealth, ultra thick, echodrk] (subi) edge[bend left=65] (OF); 70 | \path[-stealth, ultra thick, echodrk] (subi) edge[bend left=65] (HCF); 71 | \path[-stealth, ultra thick, echodrk] (subi) edge[bend left=65] (CF); 72 | \end{scope} 73 | \end{tikzpicture} 74 | \end{document} 75 | -------------------------------------------------------------------------------- /LEGO Deep learning/README.md: -------------------------------------------------------------------------------- 1 | # LEGO Deep learning 2 | 3 | ## Notes 4 | 5 | A representation of a deep neural network as a stack of simple matrix operations and activation functions. 6 | 7 | ## Output 8 | 9 | ![LEGODL](https://www.dropbox.com/s/cvt89aw7v2nidsd/lego_deep_learning.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Unsupervised methods: Diving deep into autoencoders](http://www.cl.cam.ac.uk/~pv273/slides/UCLSlides.pdf), *Introduction to Deep Learning (COMPGI23), University College London* 14 | -------------------------------------------------------------------------------- /LEGO Deep learning/lego_deep_learning.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \tikzstyle{stateTransition}=[-stealth, thick] 7 | 8 | \begin{document} 9 | \begin{tikzpicture} 10 | 11 | \node[rectangle, draw, minimum width=0.5cm,minimum height=2.5cm] (X) at (-2, 0) {$\vec{x}$}; 12 | 13 | \node[rectangle, draw, right=1.5em of X, text depth=0em, minimum width=1.5cm,minimum height=2.5cm] (W1) {${\bf W_1}\times$}; 14 | 15 | \node[rectangle, draw, right=1.5em of W1, text depth=0em, minimum width=0.5cm,minimum height=2.5cm] (B1) {$+ \vec{b}_1$}; 16 | 17 | \node[rectangle, draw, right=1.5em of B1, text depth=0em, minimum width=1.5cm,minimum height=2.5cm] (RL) { 18 | \begin{tikzpicture} 19 | \draw[thick] (0,0) -- (0.5, 0); 20 | \draw[thick] (0.49,-0.004) -- (0.99, 0.496); 21 | \end{tikzpicture} 22 | }; 23 | 24 | \node[rectangle, draw, right=1.5em of RL, text depth=0em, minimum width=1.5cm,minimum height=2.5cm] (W) {${\bf W_2}\times$}; 25 | 26 | \node[rectangle, draw, right=1.5em of W, text depth=0em, minimum width=0.5cm,minimum height=1.5cm] (B) {$+ \vec{b}_2$}; 27 | 28 | \node[right=1.5em of B, inner sep=0em] (out) { 29 | \begin{tikzpicture} 30 | \node[rectangle, draw, rotate=90, minimum height=0.5cm, minimum width=1.5cm] (out) {softmax}; 31 | \end{tikzpicture} 32 | }; 33 | 34 | \node[right=1.5em of out] (outt) {}; 35 | 36 | \foreach \x in {1,...,3} 37 | \draw[stateTransition] ([yshift=\x em]X.east) -- ([yshift=\x em]W1.west); 38 | \foreach \x in {1,...,3} 39 | \draw[stateTransition] ([yshift=-\x em]X.east) -- ([yshift=-\x em]W1.west); 40 | \draw[-stealth, thick] (X) -- (W1); 41 | 42 | \foreach \x in {1,...,3} 43 | \draw[stateTransition] ([yshift=\x em]W1.east) -- ([yshift=\x em]B1.west); 44 | \foreach \x in {1,...,3} 45 | \draw[stateTransition] ([yshift=-\x em]W1.east) -- ([yshift=-\x em]B1.west); 46 | \draw[-stealth, thick] (W1) -- (B1); 47 | 48 | \foreach \x in {1,...,3} 49 | \draw[stateTransition] ([yshift=\x em]B1.east) -- ([yshift=\x em]RL.west); 50 | \foreach \x in {1,...,3} 51 | \draw[stateTransition] ([yshift=-\x em]B1.east) -- ([yshift=-\x em]RL.west); 52 | \draw[-stealth, thick] (B1) -- (RL); 53 | 54 | \foreach \x in {1,...,3} 55 | \draw[stateTransition] ([yshift=\x em]RL.east) -- ([yshift=\x em]W.west); 56 | \foreach \x in {1,...,3} 57 | \draw[stateTransition] ([yshift=-\x em]RL.east) -- ([yshift=-\x em]W.west); 58 | \draw[-stealth, thick] (RL) -- (W); 59 | 60 | \foreach \x in {-1.5, -0.5, 0.5, 1.5} 61 | \draw[stateTransition] ([yshift=\x em]W.east) -- ([yshift=\x em]B.west); 62 | \foreach \x in {-1.5, -0.5, 0.5, 1.5} 63 | \draw[stateTransition] ([yshift=\x em]B.east) -- ([yshift=\x em]out.west); 64 | \foreach \x in {-1.5, -0.5, 0.5, 1.5} 65 | \draw[stateTransition] ([yshift=\x em]out.east) -- ([yshift=\x em]outt.west); 66 | 67 | \end{tikzpicture} 68 | \end{document} -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Petar Veličković 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Long short-term memory/README.md: -------------------------------------------------------------------------------- 1 | # Long short-term memory 2 | 3 | ## Notes 4 | 5 | A diagram representing a single LSTM block, in the context of recurrent neural networks. Admittedly, it took quite a while to decide on how to position everything in order to make the dataflow as intuitive as possible. It might not be ideal - suggestions are welcome! 6 | 7 | ## Output 8 | 9 | ![LSTM](https://www.dropbox.com/s/8cmtlwdkgzle6v1/long_short-term_memory.png?raw=1) 10 | 11 | ## Source 12 | 13 | [A trip down long short-term memory lane](http://www.cl.cam.ac.uk/~pv273/slides/LSTMslides.pdf), *University of Cambridge Research Students Lecture Series* 14 | -------------------------------------------------------------------------------- /Long short-term memory/long_short-term_memory.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \begin{document} 7 | \begin{tikzpicture} 8 | 9 | \node[rectangle, draw, minimum width=2.2cm, minimum height=1cm] (FT) {\emph{new fts.}}; 10 | \node[rectangle, above =0em of FT, draw, minimum width=2.2cm] (IG) {\emph{input gate}}; 11 | \node[rectangle, above=0em of IG, draw, minimum width=2.2cm] (FG) {\emph{forget gate}}; 12 | \node[rectangle, below=0em of FT, draw, minimum width=2.2cm] (OG) {\emph{output gate}}; 13 | \node[left=of IG] (X) {$\vec{x}_t$}; 14 | \node[left=of FT] (Y) {$\vec{y}_{t-1}$}; 15 | 16 | \draw[-stealth, thick] (X.east) -- ([yshift=0.5em]FT.west); 17 | \draw[-stealth, thick] (X.east) -- ([yshift=0.25em]IG.west); 18 | \draw[-stealth, thick] (X.east) -- ([yshift=0.25em]FG.west); 19 | \draw[-stealth, thick] (X.east) -- ([yshift=0.25em]OG.west); 20 | \draw[-stealth, thick] (Y.east) -- ([yshift=-0.5em]FT.west); 21 | \draw[-stealth, thick] (Y.east) -- ([yshift=-0.25em]IG.west); 22 | \draw[-stealth, thick] (Y.east) -- ([yshift=-0.25em]FG.west); 23 | \draw[-stealth, thick] (Y.east) -- ([yshift=-0.25em]OG.west); 24 | 25 | \node[circle, draw, right=of FT] (t1) {$\times$}; 26 | \node[circle, draw, right=of t1] (pl) {$+$}; 27 | \node[rectangle, draw, right=of pl] (th) {$\sigma$}; 28 | \node[circle, draw, right=of th] (t2) {$\times$}; 29 | \node[right=of t2] (Y1) {$\vec{y}_t$}; 30 | 31 | \node[circle, draw, above=of pl] (t3) {$\times$}; 32 | 33 | \node[rectangle, thick, draw, above=of t3, minimum width=1.5cm, minimum height=1.5cm] (M) {$M$}; 34 | 35 | \draw[-stealth, thick] (FT) -- (t1); 36 | \draw[-stealth, thick] (t1) -- (pl); 37 | \draw[-stealth, thick] (pl) -- (th); 38 | \draw[-stealth, thick] (th) -- (t2); 39 | \draw[-stealth, thick] (t2) -- (Y1); 40 | \draw[-stealth, thick] (M) -- node[left] {$\vec{c}_{t-1}$} (t3); 41 | \draw[-stealth, thick] (t3) -- (pl); 42 | \path[-stealth, thick] (IG.east) edge[bend left] (t1); 43 | \draw[thick] (OG.east) -- ([xshift=10em]OG.east); 44 | \path[-stealth, thick] (OG.east) -- ([xshift=10em]OG.east) edge[bend right=15] (t2); 45 | \path[-stealth, thick] (FG.east) edge[bend left=10] (t3); 46 | \path[-stealth, thick] (pl.east) edge[bend right=60] node[right] {$\vec{c}_t$} (M.east); 47 | 48 | \draw[-stealth, very thick, dashed, gray] (-1.5, -1.5) rectangle (8.4, 4.8); 49 | \node[] (tttxt) at (-0.8, 4.5) {\large \bf LSTM}; 50 | 51 | \end{tikzpicture} 52 | \end{document} 53 | -------------------------------------------------------------------------------- /MCL/README.md: -------------------------------------------------------------------------------- 1 | # Markov clustering (MCL) 2 | 3 | ## Notes 4 | 5 | This figure is automatically generated. It illustrates the state of an input graph after three iterations of the Markov clustering (MCL) algorithm---after which the three clusters are already distinguished. 6 | 7 | ## Output 8 | 9 | ![MCL](https://www.dropbox.com/s/bfokxzqlpb3ydgm/mcl.png?raw=1) 10 | 11 | ## Source 12 | 13 | Markov chains, PageRank and clustering, [mgcsweek v2.0](https://csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /MCL/mcl.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \definecolor{mygreen}{HTML}{006400} 7 | 8 | \begin{document} 9 | \begin{tikzpicture}[node distance=2.8em] 10 | \node[circle, thick, fill=red, draw] (0) {}; 11 | \node[circle, thick, below left=of 0, fill=red, draw] (1) {}; 12 | \node[circle, thick, below right=of 0, fill=red, draw] (2) {}; 13 | \node[circle, thick, below right=of 1, fill=red, draw] (3) {}; 14 | \node[circle, thick, below left=of 3, fill=red, draw] (4) {}; 15 | \node[circle, thick, below right=of 3, fill=red, draw] (5) {}; 16 | \node[circle, thick, below right=of 4, fill=red, draw] (6) {}; 17 | \node[circle, thick, right=of 5, fill=mygreen, draw] (7) {}; 18 | \node[circle, thick, above right=of 7, fill=mygreen, draw] (8) {}; 19 | \node[circle, thick, below right=of 8, fill=mygreen, draw] (9) {}; 20 | \node[circle, thick, below right=of 7, fill=mygreen, draw] (10) {}; 21 | \node[circle, thick, below left=of 10, fill=mygreen, draw] (11) {}; 22 | \node[circle, thick, below right=of 10, fill=mygreen, draw] (12) {}; 23 | \node[circle, thick, above right=of 9, fill=blue, draw] (13) {}; 24 | \node[circle, thick, above right=of 13, fill=blue, draw] (16) {}; 25 | \node[circle, thick, above left=of 16, fill=blue, draw] (14) {}; 26 | \node[circle, thick, above right=of 14, fill=blue, draw] (15) {}; 27 | \node[circle, thick, above right=of 16, fill=blue, draw] (17) {}; 28 | \node[circle, thick, below right=of 16, fill=blue, draw] (18) {}; 29 | 30 | \path[-stealth, very thick] (0) edge [->, >=stealth, opacity=0.02, loop above] (0); 31 | \draw[very thick, opacity=0.30, -stealth] (0) -- (1); 32 | \draw[very thick, opacity=0.07, -stealth] (0) -- (2); 33 | \draw[very thick, opacity=0.53, -stealth] (0) -- (3); 34 | \draw[very thick, opacity=0.02, -stealth] (0) -- (4); 35 | \draw[very thick, opacity=0.05, -stealth] (0) -- (5); 36 | 37 | \path[-stealth, very thick] (1) edge [->, >=stealth, opacity=0.56, loop left] (1); 38 | \draw[very thick, opacity=0.25, -stealth] (1) -- (2); 39 | \draw[very thick, opacity=0.11, -stealth] (1) -- (3); 40 | \draw[very thick, opacity=0.02, -stealth] (1) -- (4); 41 | \draw[very thick, opacity=0.05, -stealth] (1) -- (5); 42 | 43 | \draw[very thick, opacity=0.54, -stealth] (2) -- (1); 44 | \path[-stealth, very thick] (2) edge [->, >=stealth, opacity=0.31, loop right] (2); 45 | \draw[very thick, opacity=0.04, -stealth] (2) -- (3); 46 | \draw[very thick, opacity=0.03, -stealth] (2) -- (4); 47 | \draw[very thick, opacity=0.07, -stealth] (2) -- (5); 48 | 49 | \draw[very thick, opacity=0.35, -stealth] (3) -- (1); 50 | \draw[very thick, opacity=0.09, -stealth] (3) -- (2); 51 | \path[-stealth, very thick] (3) edge [->, >=stealth, opacity=0.44, loop right] (3); 52 | \draw[very thick, opacity=0.03, -stealth] (3) -- (4); 53 | \draw[very thick, opacity=0.08, -stealth] (3) -- (5); 54 | 55 | \draw[very thick, opacity=0.22, -stealth] (4) -- (1); 56 | \draw[very thick, opacity=0.07, -stealth] (4) -- (2); 57 | \draw[very thick, opacity=0.05, -stealth] (4) -- (3); 58 | \path[-stealth, very thick] (4) edge [->, >=stealth, opacity=0.19, loop left] (4); 59 | \draw[very thick, opacity=0.46, -stealth] (4) -- (5); 60 | 61 | \draw[very thick, opacity=0.38, -stealth] (5) -- (1); 62 | \draw[very thick, opacity=0.09, -stealth] (5) -- (2); 63 | \draw[very thick, opacity=0.12, -stealth] (5) -- (3); 64 | \draw[very thick, opacity=0.10, -stealth] (5) -- (4); 65 | \path[-stealth, very thick] (5) edge [->, >=stealth, opacity=0.31, loop below] (5); 66 | 67 | \draw[very thick, opacity=0.31, -stealth] (6) -- (1); 68 | \draw[very thick, opacity=0.08, -stealth] (6) -- (2); 69 | \draw[very thick, opacity=0.46, -stealth] (6) -- (3); 70 | \draw[very thick, opacity=0.04, -stealth] (6) -- (4); 71 | \draw[very thick, opacity=0.10, -stealth] (6) -- (5); 72 | 73 | \path[-stealth, very thick] (7) edge [->, >=stealth, opacity=0.32, loop above] (7); 74 | \draw[very thick, opacity=0.10, -stealth] (7) -- (8); 75 | \draw[very thick, opacity=0.12, -stealth] (7) -- (9); 76 | \draw[very thick, opacity=0.36, -stealth] (7) -- (10); 77 | \draw[very thick, opacity=0.07, -stealth] (7) -- (11); 78 | \draw[very thick, opacity=0.03, -stealth] (7) -- (12); 79 | 80 | \draw[very thick, opacity=0.28, -stealth] (8) -- (7); 81 | \path[-stealth, very thick] (8) edge [->, >=stealth, opacity=0.11, loop above] (8); 82 | \draw[very thick, opacity=0.13, -stealth] (8) -- (9); 83 | \draw[very thick, opacity=0.37, -stealth] (8) -- (10); 84 | \draw[very thick, opacity=0.07, -stealth] (8) -- (11); 85 | \draw[very thick, opacity=0.03, -stealth] (8) -- (12); 86 | 87 | \draw[very thick, opacity=0.03, -stealth] (9) -- (7); 88 | \draw[very thick, opacity=0.01, -stealth] (9) -- (8); 89 | \path[-stealth, very thick] (9) edge [->, >=stealth, opacity=0.48, loop above] (9); 90 | \draw[very thick, opacity=0.27, -stealth] (9) -- (10); 91 | \draw[very thick, opacity=0.21, -stealth] (9) -- (11); 92 | 93 | \draw[very thick, opacity=0.10, -stealth] (10) -- (7); 94 | \draw[very thick, opacity=0.04, -stealth] (10) -- (8); 95 | \draw[very thick, opacity=0.31, -stealth] (10) -- (9); 96 | \path[-stealth, very thick] (10) edge [->, >=stealth, opacity=0.39, loop right] (10); 97 | \draw[very thick, opacity=0.15, -stealth] (10) -- (11); 98 | 99 | \draw[very thick, opacity=0.04, -stealth] (11) -- (7); 100 | \draw[very thick, opacity=0.01, -stealth] (11) -- (8); 101 | \draw[very thick, opacity=0.45, -stealth] (11) -- (9); 102 | \draw[very thick, opacity=0.29, -stealth] (11) -- (10); 103 | \path[-stealth, very thick] (11) edge [->, >=stealth, opacity=0.20, loop left] (11); 104 | 105 | \draw[very thick, opacity=0.36, -stealth] (12) -- (7); 106 | \draw[very thick, opacity=0.13, -stealth] (12) -- (8); 107 | \draw[very thick, opacity=0.08, -stealth] (12) -- (9); 108 | \draw[very thick, opacity=0.34, -stealth] (12) -- (10); 109 | \draw[very thick, opacity=0.05, -stealth] (12) -- (11); 110 | \path[-stealth, very thick] (12) edge [->, >=stealth, opacity=0.04, loop right] (12); 111 | 112 | \path[-stealth, very thick] (13) edge [->, >=stealth, opacity=0.12, loop below] (13); 113 | \draw[very thick, opacity=0.03, -stealth] (13) -- (14); 114 | \draw[very thick, opacity=0.52, -stealth] (13) -- (16); 115 | \draw[very thick, opacity=0.32, -stealth] (13) -- (17); 116 | 117 | \draw[very thick, opacity=0.01, -stealth] (14) -- (13); 118 | \path[-stealth, very thick] (14) edge [->, >=stealth, opacity=0.19, loop left] (14); 119 | \draw[very thick, opacity=0.65, -stealth] (14) -- (16); 120 | \draw[very thick, opacity=0.11, -stealth] (14) -- (17); 121 | \draw[very thick, opacity=0.02, -stealth] (14) -- (18); 122 | 123 | \draw[very thick, opacity=0.04, -stealth] (15) -- (13); 124 | \draw[very thick, opacity=0.13, -stealth] (15) -- (14); 125 | \path[-stealth, very thick] (15) edge [->, >=stealth, opacity=0.01, loop right] (15); 126 | \draw[very thick, opacity=0.62, -stealth] (15) -- (16); 127 | \draw[very thick, opacity=0.18, -stealth] (15) -- (17); 128 | \draw[very thick, opacity=0.01, -stealth] (15) -- (18); 129 | 130 | \draw[very thick, opacity=0.03, -stealth] (16) -- (13); 131 | \draw[very thick, opacity=0.09, -stealth] (16) -- (14); 132 | \path[-stealth, very thick] (16) edge [->, >=stealth, opacity=0.69, loop below] (16); 133 | \draw[very thick, opacity=0.18, -stealth] (16) -- (17); 134 | 135 | \draw[very thick, opacity=0.07, -stealth] (17) -- (13); 136 | \draw[very thick, opacity=0.05, -stealth] (17) -- (14); 137 | \draw[very thick, opacity=0.61, -stealth] (17) -- (16); 138 | \path[-stealth, very thick] (17) edge [->, >=stealth, opacity=0.26, loop right] (17); 139 | 140 | \draw[very thick, opacity=0.01, -stealth] (18) -- (13); 141 | \draw[very thick, opacity=0.25, -stealth] (18) -- (14); 142 | \draw[very thick, opacity=0.01, -stealth] (18) -- (15); 143 | \draw[very thick, opacity=0.61, -stealth] (18) -- (16); 144 | \draw[very thick, opacity=0.09, -stealth] (18) -- (17); 145 | \path[-stealth, very thick] (18) edge [->, >=stealth, opacity=0.03, loop below] (18); 146 | 147 | \end{tikzpicture} 148 | \end{document} 149 | -------------------------------------------------------------------------------- /Maximum flow problem/README.md: -------------------------------------------------------------------------------- 1 | # Maximum flow problem 2 | 3 | ## Notes 4 | 5 | Starting to sound like a broken record here... `tkz-graph` is awesome. Here utilised to illustrate a solution to the maximum flow problem in a digraph with edge capacities. The edges are coloured according to the ratio of the sent flow to its capacity. 6 | 7 | ## Output 8 | 9 | ![MaximumFlowProblem](https://www.dropbox.com/s/dy9qc1od6fmp0el/maximum_flow_problem.png?raw=1) 10 | 11 | ## Source 12 | 13 | Linear programming and the Simplex algorithm, [mgcsweek v2.0](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Maximum flow problem/maximum_flow_problem.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{tkz-graph} 4 | 5 | \begin{document} 6 | \begin{tikzpicture}[scale=0.8,every node/.style={scale=0.7},font=\tt] 7 | \SetUpEdge[lw = 0.75pt, 8 | color = red, 9 | labelcolor = white] 10 | \GraphInit[vstyle=Normal] 11 | \SetGraphUnit{2} 12 | \tikzset{VertexStyle/.append style={fill=red!50}} 13 | \Vertex{s} 14 | \tikzset{VertexStyle/.append style={fill=white}} 15 | \NOEA(s){2} 16 | \EA(2){4} 17 | \tikzset{VertexStyle/.append style={fill=blue!50}} 18 | \SOEA(4){t} 19 | \tikzset{VertexStyle/.append style={fill=white}} 20 | \EA(s){3} 21 | \EA(3){5} 22 | \SetUpEdge[labeltext=blue] 23 | \tikzset{EdgeStyle/.style={-stealth, color=blue}} 24 | \Edge[label=10/10](s)(2) 25 | \SetUpEdge[labeltext=blue!90] 26 | \tikzset{EdgeStyle/.style={-stealth, color=blue!90}} 27 | \Edge[label=9/10](s)(3) 28 | \SetUpEdge[labeltext=gray] 29 | \tikzset{EdgeStyle/.style={-stealth, color=gray}} 30 | \Edge[label=0/2](2)(3) 31 | \SetUpEdge[labeltext=blue] 32 | \tikzset{EdgeStyle/.style={-stealth, color=blue}} 33 | \Edge[label=4/4](2)(4) 34 | \SetUpEdge[labeltext=blue!75] 35 | \tikzset{EdgeStyle/.style={-stealth, color=blue!75}} 36 | \Edge[label=6/8](2)(5) 37 | \SetUpEdge[labeltext=blue] 38 | \tikzset{EdgeStyle/.style={-stealth, color=blue}} 39 | \Edge[label=9/9](3)(5) 40 | \SetUpEdge[labeltext=blue] 41 | \tikzset{EdgeStyle/.style={-stealth, color=blue}} 42 | \Edge[label=10/10](4)(t) 43 | \SetUpEdge[labeltext=blue] 44 | \tikzset{EdgeStyle/.style={-stealth, color=blue}} 45 | \Edge[label=6/6](5)(4) 46 | \SetUpEdge[labeltext=blue!90] 47 | \tikzset{EdgeStyle/.style={-stealth, color=blue!90}} 48 | \Edge[label=9/10](5)(t) 49 | \end{tikzpicture} 50 | \end{document} 51 | -------------------------------------------------------------------------------- /Message passing neural network/README.md: -------------------------------------------------------------------------------- 1 | # Message passing neural network (MPNN) 2 | 3 | ## Notes 4 | 5 | An overview of the *Message passing neural network* architecture by [Gilmer et al. (2017)](https://arxiv.org/abs/1704.01212), illustrating the elements involved in computing the next-level features of a given node in a graph, along with the relevant neural network modules. 6 | 7 | ## Output 8 | 9 | ![MPNN](https://www.dropbox.com/s/p7oc1s5yjts0o43/message_passing_neural_network.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Neural Relational Inference for Interacting Systems](https://www.cl.cam.ac.uk/~pv273/slides/MILA-NRI.pdf), *MILA Graph Representation Group Meeting* 14 | -------------------------------------------------------------------------------- /Message passing neural network/message_passing_neural_network.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \definecolor{echodrk}{HTML}{0099cc} 7 | \definecolor{olivegreen}{rgb}{0,0.6,0} 8 | \definecolor{camdrk}{RGB}{0,62,114} 9 | 10 | \begin{document} 11 | \begin{tikzpicture} 12 | \node[circle, gray, draw, very thick] (1) {$\vec{h}^\ell_1$}; 13 | \node[circle, echodrk, draw, below right=2em and 3em of 1, very thick] (2) {$\vec{h}^\ell_2$}; 14 | \node[circle, draw, echodrk, above right=3em and 4em of 1, very thick] (3) {$\vec{h}^\ell_3$}; 15 | \node[circle, draw, olivegreen, right=7em of 1, ultra thick] (4) {$\vec{h}^{\ell+1}_4$}; 16 | \node[circle, echodrk, draw, above right=3.5em and 4em of 4, very thick] (5) {$\vec{h}^\ell_5$}; 17 | \node[circle, echodrk, draw, below right=3em and 3em of 4, very thick] (6) {$\vec{h}^\ell_6$}; 18 | 19 | \draw[gray, very thick] (1) -- (2); 20 | \draw[gray, very thick] (2) -- (3); 21 | \draw[red, ultra thick, -stealth] (2) -- node[below, xshift=0.9em] (ll) {$\vec{h}_{2\rightarrow 4}^\ell$} (4); 22 | \draw[red, ultra thick, -stealth] (3) -- node[above,xshift=1em, inner sep=0em] (l1) {$\vec{h}_{3\rightarrow 4}^\ell$} (4); 23 | \draw[red,ultra thick, -stealth] (5) -- node[right, yshift=-0.5em] (lr) {$\vec{h}_{5\rightarrow 4}^\ell$} (4); 24 | \draw[red,ultra thick, -stealth] (6) -- node[right, xshift=0.1em] (lw) {$\vec{h}_{6\rightarrow 4}^\ell$} (4); 25 | 26 | \node[right=5.5em of 6, echodrk] (31) {$\vec{h}^\ell_3$}; 27 | \node[right=1em of 31, echodrk] (41) {$\vec{h}^\ell_4$}; 28 | 29 | \node[rectangle, draw, camdrk, very thick, above right=3em and -0.5em of 31] (F) {$f_e^\ell$}; 30 | 31 | \node[above=3em of F, red] (34) {$\vec{h}^\ell_{3\rightarrow 4}$}; 32 | 33 | \draw[very thick, camdrk, -stealth] (31) -- (F); 34 | \draw[very thick, camdrk, -stealth] (41) -- (F); 35 | \draw[very thick, camdrk, -stealth] (F) -- (34); 36 | 37 | \draw[very thick, -stealth, dashed, echodrk] (3) edge[bend left=30] (31); 38 | \draw[very thick, -stealth, dashed, echodrk] (4) edge[bend right=65] (41); 39 | \draw[very thick, -stealth, dashed, red] (34) edge[bend right=40] (l1); 40 | 41 | \node[right= of 4, camdrk, rectangle, draw, very thick] (G) {$f_v^\ell$}; 42 | \node[right=4 em of G, olivegreen] (l11) {$\vec{h}^{\ell+1}_4$}; 43 | 44 | \draw[-stealth, camdrk, very thick] (4) -- (G); 45 | \draw[-stealth, camdrk, very thick] (G) -- (l11); 46 | 47 | \draw[very thick, -stealth, dashed, olivegreen] (l11) edge[bend left=25] (4); 48 | \end{tikzpicture} 49 | \end{document} -------------------------------------------------------------------------------- /Multilayer network/README.md: -------------------------------------------------------------------------------- 1 | # Multilayer network 2 | 3 | ## Notes 4 | 5 | A diagrammatical representation of a multilayer network, along with its underlying adjacency tensor. Features prominent use of 3D projections via use of `scope`. 6 | 7 | ## Output 8 | 9 | ![MultilayerNetwork](https://www.dropbox.com/s/jwdthd1oh4jfa9c/multilayer_network.png?raw=1) 10 | 11 | ## Source 12 | 13 | *TBA* 14 | -------------------------------------------------------------------------------- /Multilayer network/multilayer_network.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{amsmath} 4 | 5 | \usetikzlibrary{decorations.pathmorphing, positioning} 6 | 7 | \definecolor{echoreg}{HTML}{2cb1e1} 8 | \definecolor{echodrk}{HTML}{0099cc} 9 | 10 | \tikzstyle{mybox} = [text=black, very thick, 11 | rectangle, rounded corners, inner sep=10pt, inner ysep=20pt] 12 | \tikzstyle{fancytitle} =[text=black] 13 | 14 | \newcommand{\yslant}{0.5} 15 | \newcommand{\xslant}{-0.6} 16 | 17 | \newcommand\overmat[3]{% 18 | \makebox[0pt][l]{$\smash{\color{#3}\overbrace{\phantom{% 19 | \begin{matrix}#2\end{matrix}}}^{\text{#1}}}$}#2} 20 | \newcommand\undermat[3]{% 21 | \makebox[0pt][l]{$\smash{\color{#3}\underbrace{\phantom{% 22 | \begin{matrix}#2\end{matrix}}}_{\text{#1}}}$}#2} 23 | \newcommand\partialphantom{\vphantom{\frac{\partial e_{P,M}}{\partial w_{1,1}}}} 24 | 25 | \begin{document} 26 | \begin{tikzpicture}[scale=0.58,every node/.style={minimum size=1cm},on grid] 27 | 28 | \node [mybox, scale=1.0] at (10.5, 2) (box){% 29 | \begin{minipage}{0.6\textwidth} 30 | \[ {\mathbf M} = {\left[ 31 | \begin{matrix} 32 | \left[\overmat{\textcolor{red}Layer 1}{ 33 | \begin{matrix} 34 | 1 & 0 & 0\\ 35 | 1 & 0 & 1\\ 36 | 1 & 0 & 0\\ 37 | \end{matrix}}{red}\right] & \left[\overmat{1 $\rightarrow$ 2}{ 38 | \begin{matrix} 39 | 1 & 0 & 0\\ 40 | 0 & 1 & 0\\ 41 | 0 & 0 & 0\\ 42 | \end{matrix}}{gray}\right]\\ 43 | \left[\undermat{2 $\rightarrow$ 1}{ 44 | \begin{matrix} 45 | 0 & 0 & 0\\ 46 | 1 & 0 & 0\\ 47 | 0 & 0 & 0\\ 48 | \end{matrix}}{gray}\right] & \left[\undermat{\textcolor{echodrk}Layer 2}{ 49 | \begin{matrix} 50 | 0 & 1 & 1\\ 51 | 1 & 0 & 0\\ 52 | 1 & 0 & 0\\ 53 | \end{matrix}}{echodrk}\right]\\ 54 | \end{matrix}\right]}\] 55 | \end{minipage} 56 | }; 57 | 58 | \node[fancytitle, scale=0.8] at (box.north) {\bf Tensor form:}; 59 | 60 | % Layer 2 61 | \begin{scope}[ 62 | yshift=-120, 63 | every node/.append style={yslant=\yslant,xslant=\xslant}, 64 | yslant=\yslant,xslant=\xslant 65 | ] 66 | \draw[black, dashed, thin] (0,0) rectangle (7,7); 67 | 68 | \draw[fill=echoreg] 69 | (5,2) node(111){} circle (.1) 70 | (2,2) circle (.1) 71 | (3.5,5) circle (.1); 72 | 73 | \draw[-latex, thin, color=echodrk] 74 | (3.55,4.85) to (4.85,2.05); 75 | \draw[-latex, thin, color=echodrk] 76 | (4.95,2.15) to (3.65,4.95); 77 | \draw[-latex, thin, color=echodrk] 78 | (2.15,1.92) to (4.85,1.92); 79 | \draw[-latex, thin, color=echodrk] 80 | (4.85,2.05) to (2.15,2.05); 81 | \fill[black] 82 | (0.5,6.5) node[right, scale=.7] {Layer 2} 83 | (5.1,1.9) node[right,scale=.7]{\bf A} 84 | (1.9,1.9) node[left,scale=.7]{\bf B} 85 | (3.5,5.1) node[above,scale=.7]{\bf C}; 86 | \end{scope} 87 | 88 | % Interlayer crossconnections 89 | \draw[thick, -latex, decoration={snake, segment length=2mm, amplitude=0.2mm}, decorate] (3.8, 4) to (3.8, -0.32); 90 | \draw[thick, -latex, decoration={snake, segment length=2mm, amplitude=0.2mm}, decorate] (.8,2.4) to (.8,-1.8); 91 | \draw[thick, -latex, decoration={snake, segment length=2mm, amplitude=0.2mm}, decorate] (.8, -1.8) to (3.81, 4); 92 | 93 | % Layer 1 94 | \begin{scope}[ 95 | yshift=0, 96 | every node/.append style={yslant=\yslant,xslant=\xslant}, 97 | yslant=\yslant,xslant=\xslant 98 | ] 99 | \fill[white,fill opacity=.75] (0,0) rectangle (7,7); 100 | \draw[black, dashed, thin] (0,0) rectangle (7,7); 101 | 102 | \draw [fill=red] 103 | (5,2) node(111){} circle (.1) 104 | (2,2) circle (.1) 105 | (3.5,5) circle (.1); 106 | 107 | \draw[-latex, thin, color=red] 108 | (3.6,4.9) to (4.9,2.1); 109 | \draw[-latex, thin, color=red] 110 | (2.15,2) to (4.85,2); 111 | \draw[-latex, thin, color=red] 112 | (2.1,2.1) to (3.4,4.9); 113 | \draw[-latex, thin, color=red] 114 | (5.1,2.15) to[bend left=90] (6.3, 2) to[bend left=70] (5.1, 1.85); 115 | 116 | \fill[black] 117 | (0.5,6.5) node[right, scale=.7] {Layer 1} 118 | (5.1,1.9) node[right,scale=.7]{\bf A} 119 | (1.9,1.9) node[left,scale=.7]{\bf B} 120 | (3.5,5.1) node[above,scale=.7]{\bf C}; 121 | \end{scope} 122 | \end{tikzpicture} 123 | \end{document} 124 | -------------------------------------------------------------------------------- /Multilayer perceptron/README.md: -------------------------------------------------------------------------------- 1 | # Multilayer perceptron (MLP) 2 | 3 | ## Notes 4 | 5 | A diagram representing an in-depth view at a single perceptron, along with its position within a larger-scale multilayer perceptron (~unrestricted feedforward neural network). 6 | 7 | ## Output 8 | 9 | ![MultilayerPerceptron](https://www.dropbox.com/s/qs4tojv5u5h48lf/multilayer_perceptron.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Deep learing for complete beginners: Recognising handwritten digits](http://online.cambridgecoding.com/notebooks/cca_admin/deep-learning-for-complete-beginners-recognising-handwritten-digits), *Cambridge Coding Academy* 14 | -------------------------------------------------------------------------------- /Multilayer perceptron/multilayer_perceptron.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \tikzstyle{inputNode}=[draw,circle,minimum size=10pt,inner sep=0pt] 7 | \tikzstyle{stateTransition}=[-stealth, thick] 8 | 9 | \begin{document} 10 | \begin{tikzpicture} 11 | \node[draw,circle,minimum size=25pt,inner sep=0pt] (x) at (0,0) {$\Sigma$ $\sigma$}; 12 | 13 | \node[inputNode] (x0) at (-2, 1.5) {$\tiny +1$}; 14 | \node[inputNode] (x1) at (-2, 0.75) {$\tiny x_1$}; 15 | \node[inputNode] (x2) at (-2, 0) {$\tiny x_2$}; 16 | \node[inputNode] (x3) at (-2, -0.75) {$\tiny x_3$}; 17 | \node[inputNode] (xn) at (-2, -1.75) {$\tiny x_n$}; 18 | 19 | \draw[stateTransition] (x0) to[out=0,in=120] node [midway, sloped, above] {$w_0$} (x); 20 | \draw[stateTransition] (x1) to[out=0,in=150] node [midway, sloped, above] {$w_1$} (x); 21 | \draw[stateTransition] (x2) to[out=0,in=180] node [midway, sloped, above] {$w_2$} (x); 22 | \draw[stateTransition] (x3) to[out=0,in=210] node [midway, sloped, above] {$w_3$} (x); 23 | \draw[stateTransition] (xn) to[out=0,in=240] node [midway, sloped, above] {$w_n$} (x); 24 | \draw[stateTransition] (x) -- (4,0) node [midway,above] {$\sigma\left(w_0 + \sum\limits_{i=1}^{n}{w_ix_i}\right)$}; 25 | \draw[dashed] (0,-0.43) -- (0,0.43); 26 | \node (dots) at (-2, -1.15) {$\vdots$}; 27 | \node[inputNode, thick] (i1) at (6, 0.75) {}; 28 | \node[inputNode, thick] (i2) at (6, 0) {}; 29 | \node[inputNode, thick] (i3) at (6, -0.75) {}; 30 | 31 | \node[inputNode, thick] (h1) at (8, 1.5) {}; 32 | \node[inputNode, thick] (h2) at (8, 0.75) {}; 33 | \node[inputNode, thick] (h3) at (8, 0) {}; 34 | \node[inputNode, thick] (h4) at (8, -0.75) {}; 35 | \node[inputNode, thick] (h5) at (8, -1.5) {}; 36 | 37 | \node[inputNode, thick] (o1) at (10, 0.75) {}; 38 | \node[inputNode, thick] (o2) at (10, -0.75) {}; 39 | 40 | \draw[stateTransition] (5, 0.75) -- node[above] {$I_1$} (i1); 41 | \draw[stateTransition] (5, 0) -- node[above] {$I_2$} (i2); 42 | \draw[stateTransition] (5, -0.75) -- node[above] {$I_3$} (i3); 43 | 44 | \draw[stateTransition] (i1) -- (h1); 45 | \draw[stateTransition] (i1) -- (h2); 46 | \draw[stateTransition] (i1) -- (h3); 47 | \draw[stateTransition] (i1) -- (h4); 48 | \draw[stateTransition] (i1) -- (h5); 49 | \draw[stateTransition] (i2) -- (h1); 50 | \draw[stateTransition] (i2) -- (h2); 51 | \draw[stateTransition] (i2) -- (h3); 52 | \draw[stateTransition] (i2) -- (h4); 53 | \draw[stateTransition] (i2) -- (h5); 54 | \draw[stateTransition] (i3) -- (h1); 55 | \draw[stateTransition] (i3) -- (h2); 56 | \draw[stateTransition] (i3) -- (h3); 57 | \draw[stateTransition] (i3) -- (h4); 58 | \draw[stateTransition] (i3) -- (h5); 59 | 60 | \draw[stateTransition] (h1) -- (o1); 61 | \draw[stateTransition] (h1) -- (o2); 62 | \draw[stateTransition] (h2) -- (o1); 63 | \draw[stateTransition] (h2) -- (o2); 64 | \draw[stateTransition] (h3) -- (o1); 65 | \draw[stateTransition] (h3) -- (o2); 66 | \draw[stateTransition] (h4) -- (o1); 67 | \draw[stateTransition] (h4) -- (o2); 68 | \draw[stateTransition] (h5) -- (o1); 69 | \draw[stateTransition] (h5) -- (o2); 70 | 71 | \node[above=of i1, align=center] (l1) {Input \\ layer}; 72 | \node[right=2.3em of l1, align=center] (l2) {Hidden \\ layer}; 73 | \node[right=2.3em of l2, align=center] (l3) {Output \\ layer}; 74 | 75 | \draw[stateTransition] (o1) -- node[above] {$O_1$} (11, 0.75); 76 | \draw[stateTransition] (o2) -- node[above] {$O_2$} (11, -0.75); 77 | 78 | \path[dashed, double, ultra thick, gray] (x.north) edge[bend left=0] (h5.north); 79 | \path[dashed, double, ultra thick, gray] (x.south) edge[bend right=0] (h5.south); 80 | \end{tikzpicture} 81 | \end{document} 82 | -------------------------------------------------------------------------------- /Multiplex chain GMHMM (beta)/README.md: -------------------------------------------------------------------------------- 1 | # Multiplex chain Gaussian mixture hidden Markov model (Multiplex chain GMHMM) (beta) 2 | 3 | ## Notes 4 | 5 | The beta version of the example of a multiplex chain Gaussian mixture hidden Markov model. While it wasn't retained for an official publication, it demonstrates interesting and difficult aspects of tightly integrating Ti*k*Z with `axis`. 6 | 7 | ## Output 8 | 9 | ![MultiplexChainGMHMMBeta](https://www.dropbox.com/s/l65l44gs0a7dwxj/multiplex_chain_gmhmm_beta.png?raw=1) 10 | 11 | ## Source 12 | 13 | N/A 14 | -------------------------------------------------------------------------------- /Multiplex chain GMHMM/README.md: -------------------------------------------------------------------------------- 1 | # Multiplex chain Gaussian mixture hidden Markov model (Multiplex chain GMHMM) 2 | 3 | ## Notes 4 | 5 | Example of a multiplex chain Gaussian mixture hidden Markov model. 6 | 7 | ## Output 8 | 9 | ![MultiplexChainGMHMM](https://www.dropbox.com/s/tfttea6umluucd3/multiplex_chain_gmhmm.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Molecular multiplex network inference using Gaussian mixture hidden Markov models](http://comnet.oxfordjournals.org/content/early/2015/12/25/comnet.cnv029), Journal of Complex Networks 14 | -------------------------------------------------------------------------------- /Multiplex epidemics-awareness network/README.md: -------------------------------------------------------------------------------- 1 | # Multiplex epidemics-awareness network 2 | 3 | ## Notes 4 | 5 | Illustration of the network dynamics of an epidemics-awareness model, akin to Granell *et al.* (2014). Nodes take part in both the epidemics layer (SIS + vaccinated) and the awareness layer (UAU). This, in my opinion, represents one of the "cleaner" ways to draw multiplex networks in Ti*k*Z, making heavy use of scopes and transformations. 6 | 7 | ## Output 8 | 9 | ![MultiplexEpidemicsAwarenessNetwork](https://www.dropbox.com/s/78z377zu0ohfgj2/multiplex_epidemics-awareness_network.png?raw=1) 10 | 11 | ## Source 12 | 13 | Viral: Real-world competing process simulations on multiplex networks, BelBi 2016 -------------------------------------------------------------------------------- /Multiplex epidemics-awareness network/multiplex_epidemics-awareness_network.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning, decorations.pathmorphing} 5 | 6 | \definecolor{mynavy}{HTML}{000080} 7 | \definecolor{darkred}{HTML}{8B0000} 8 | \definecolor{mygreen}{HTML}{006400} 9 | \definecolor{mygold}{HTML}{B8860B} 10 | 11 | \newcommand{\myGlobalTransformation}[2] 12 | { 13 | \pgftransformcm{1}{0}{0.4}{0.5}{\pgfpoint{#1cm}{#2cm}} 14 | } 15 | 16 | \tikzstyle myBG=[line width=3pt,opacity=1.0] 17 | 18 | \begin{document} 19 | \begin{tikzpicture} 20 | 21 | \begin{scope} 22 | \myGlobalTransformation{0}{0}; 23 | \draw [black!50,fill=red!5] rectangle (8,8); 24 | \end{scope} 25 | 26 | \begin{scope} 27 | \myGlobalTransformation{0}{4.25}; 28 | \draw [black!50,fill=blue!5] rectangle (8,8); 29 | \end{scope} 30 | 31 | \begin{scope} 32 | \myGlobalTransformation{0}{0}; 33 | \node (thisNode) at (1,3) {}; 34 | { 35 | \pgftransformreset 36 | \draw[white,myBG,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); 37 | \draw[black,very thick, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,] (thisNode) -- ++(0,4.25); 38 | } 39 | \node (thisNode) at (3,5) {}; 40 | { 41 | \pgftransformreset 42 | \draw[white,myBG,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); 43 | \draw[black,very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); 44 | } 45 | \node (thisNode) at (5,7) {}; 46 | { 47 | \pgftransformreset 48 | \draw[white,myBG,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); 49 | \draw[black,very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); 50 | } 51 | \node (thisNode) at (7,7) {}; 52 | { 53 | \pgftransformreset 54 | \draw[white,myBG,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); 55 | \draw[black,very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); 56 | } 57 | \end{scope} 58 | 59 | \begin{scope} 60 | \myGlobalTransformation{0}{0} 61 | \node (N1) at (1,3) [circle,white,fill=mynavy] {$S$}; 62 | \node (N2) at (3,5) [circle,white,fill=darkred] {$I$}; 63 | \node (N3) at (5,1) [circle,white,fill=mygreen] {$V$}; 64 | \node (N4) at (5,7) [circle,white,fill=mynavy] {$S$}; 65 | \node (N5) at (7,3) [circle,white,fill=darkred] {$I$}; 66 | \node (N6) at (7,7) [circle,white,fill=mynavy] {$S$}; 67 | 68 | \draw[-, darkred!10, very thick] (N3) -- (N6); 69 | \draw[-, darkred!15, very thick] (N2) -- (N4); 70 | \draw[-, darkred!20, very thick] (N2) -- (N6); 71 | \draw[-, darkred!30, very thick] (N1) -- (N5); 72 | \draw[-, darkred!50, very thick] (N2) -- (N5); 73 | \draw[-, darkred!66, very thick] (N4) -- (N5); 74 | \draw[-, darkred!70, very thick] (N1) -- (N3); 75 | \draw[-, darkred!70, very thick] (N5) -- (N6); 76 | \draw[-, darkred!75, very thick] (N3) -- (N4); 77 | \draw[-, darkred!90, very thick] (N1) -- (N2); 78 | \draw[-, darkred!90, very thick] (N4) -- (N6); 79 | \draw[-, darkred, very thick] (N2) -- (N3); 80 | \draw[-, darkred, very thick] (N3) -- (N5); 81 | \end{scope} 82 | 83 | \begin{scope} 84 | \myGlobalTransformation{0}{4.25} 85 | \node (N1) at (1,3) [circle,white,fill=magenta] {$U$}; 86 | \node (N2) at (3,5) [circle,white,fill=mygold] {$A$}; 87 | \node (N3) at (5,1) [circle,white,fill=mygold] {$A$}; 88 | \node (N4) at (5,7) [circle,white,fill=magenta] {$U$}; 89 | \node (N5) at (7,3) [circle,white,fill=magenta] {$U$}; 90 | \node (N6) at (7,7) [circle,white,fill=mygold] {$A$}; 91 | 92 | \draw[-, mynavy, very thick] (N1) -- (N2); 93 | \draw[-, mynavy, very thick] (N1) -- (N3); 94 | \draw[-, cyan, very thick] (N1) -- (N5); 95 | 96 | \draw[-, blue, very thick] (N2) -- (N3); 97 | \draw[-, mynavy, very thick] (N2) -- (N4); 98 | \draw[-, mynavy, very thick] (N2) -- (N5); 99 | \draw[-, blue, very thick] (N2) -- (N6); 100 | 101 | \draw[-, mynavy, very thick] (N3) -- (N4); 102 | \draw[-, mynavy, very thick] (N3) -- (N5); 103 | \draw[-, blue, very thick] (N3) -- (N6); 104 | 105 | \draw[-, cyan, very thick] (N4) -- (N5); 106 | \draw[-, mynavy, very thick] (N4) -- (N6); 107 | 108 | \draw[-, mynavy, very thick] (N5) -- (N6); 109 | \end{scope} 110 | 111 | \begin{scope} 112 | \myGlobalTransformation{0}{0}; 113 | \node (thisNode) at (5,1) {}; 114 | { 115 | \pgftransformreset 116 | \draw[white,myBG,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); 117 | \draw[black,very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); 118 | } 119 | \node (thisNode) at (7,3) {}; 120 | { 121 | \pgftransformreset 122 | \draw[white,myBG,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); 123 | \draw[black,very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (thisNode) -- ++(0,4.25); 124 | } 125 | \end{scope} 126 | 127 | \begin{scope} 128 | \myGlobalTransformation{0}{0} 129 | \node (N3) at (5,1) [circle,white,fill=mygreen] {$V$}; 130 | \node (N5) at (7,3) [circle,white,fill=darkred] {$I$}; 131 | \end{scope} 132 | 133 | \begin{scope} 134 | \myGlobalTransformation{0}{4.25} 135 | \node (N3) at (5,1) [circle,white,fill=mygold] {$A$}; 136 | \node (N5) at (7,3) [circle,white,fill=magenta] {$U$}; 137 | \end{scope} 138 | 139 | \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,ultra thick] (0, 0.2) -- node [above=1em,rotate=90] {self-awareness} (0, 4); 140 | 141 | \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate,ultra thick] (11.3, 8.1) -- node [above=1em,rotate=-90] {immunisation} (11.3, 4.2); 142 | 143 | \node at (10, 0.3) {\emph{\textbf{epidemics layer}}}; 144 | \node at (1.2, 8) {\emph{\textbf{awareness layer}}}; 145 | 146 | \end{tikzpicture} 147 | \end{document} 148 | -------------------------------------------------------------------------------- /Multiplex network underlying graph/README.md: -------------------------------------------------------------------------------- 1 | # Multiplex network underlying graph 2 | 3 | ## Notes 4 | 5 | A representation of a multiplex network's underlying graph, featuring usage of edge decorations and careful maneuvering. 6 | 7 | ## Output 8 | 9 | ![MultiplexNetworkUnderlyingGraph](https://www.dropbox.com/s/cq0pg6px2rt5swj/multiplex_network_underlying_graph.png?raw=1) 10 | 11 | ## Source 12 | 13 | Multiplex network inference, [mgcsweek v2.0](https://csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Multiplex network underlying graph/multiplex_network_underlying_graph.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning, decorations.pathmorphing} 5 | 6 | \definecolor{mygreen}{rgb}{0,0.6,0} 7 | \definecolor{echodrk}{HTML}{0099cc} 8 | 9 | \begin{document} 10 | \begin{tikzpicture} 11 | \node[circle, draw, very thick, fill=echodrk] (11) {}; 12 | \node[below = 0.5em of 11] (11c) {$({\bf 0}, G_3)$}; 13 | \node[circle, draw, very thick, fill=echodrk, right=3em of 11] (22) {}; 14 | \node[below =0.5em of 22] (22c) {$({\bf 1}, G_3)$}; 15 | \node[circle, draw, very thick, fill=echodrk, right=3em of 22] (33) {}; 16 | \node[below =0.5em of 33] (33c) {$({\bf 2}, G_3)$}; 17 | \node[circle, draw, very thick, fill=echodrk, right=3em of 33] (44) {}; 18 | \node[below =0.5em of 44] (44c) {$({\bf 3}, G_3)$}; 19 | 20 | \node[circle, draw, very thick, fill=mygreen, above = 4.5em of 11] (111) {}; 21 | \node at ([shift={(0.53,-0.3)}]111.-45) {$({\bf 0}, G_2)$}; 22 | \node[circle, draw, very thick, fill=mygreen, right=3em of 111] (222) {}; 23 | \node at ([shift={(0.53,-0.3)}]222.-45) {$({\bf 1}, G_2)$}; 24 | \node[circle, draw, very thick, fill=mygreen, right=3em of 222] (333) {}; 25 | \node at ([shift={(0.53,-0.3)}]333.-45) {$({\bf 2}, G_2)$}; 26 | \node[circle, draw, very thick, fill=mygreen, right=3em of 333] (444) {}; 27 | \node at ([shift={(0.53,-0.3)}]444.-45) {$({\bf 3}, G_2)$}; 28 | 29 | \node[circle, draw, very thick, fill=red, above = 4.5em of 111] (1) {}; 30 | \node[above = 0.5em of 1] (1c) {$({\bf 0}, G_1)$}; 31 | \node[circle, draw, very thick, fill=red, right=3em of 1] (2) {}; 32 | \node[above =0.5em of 2] (2c) {$({\bf 1}, G_1)$}; 33 | \node[circle, draw, very thick, fill=red, right=3em of 2] (3) {}; 34 | \node[above =0.5em of 3] (3c) {$({\bf 2}, G_1)$}; 35 | \node[circle, draw, very thick, fill=red, right=3em of 3] (4) {}; 36 | \node[above =0.5em of 4] (3c) {$({\bf 3}, G_1)$}; 37 | 38 | 39 | \draw[ultra thick, -, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=0.2mm}, decorate] (11) to (111); 40 | \draw[ultra thick, -, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=0.2mm}, decorate] (22) to (222); 41 | \draw[ultra thick, -, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=0.2mm}, decorate] (33) to (333); 42 | \draw[ultra thick, -, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=0.2mm}, decorate] (44) to (444); 43 | 44 | \draw[ultra thick, -, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=0.2mm}, decorate] (1) to (111); 45 | \draw[ultra thick, -, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=0.2mm}, decorate] (2) to (222); 46 | \draw[ultra thick, -, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=0.2mm}, decorate] (3) to (333); 47 | \draw[ultra thick, -, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=0.2mm}, decorate] (4) to (444); 48 | 49 | \draw[ultra thick, -, bend right=12, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=0.2mm}, decorate] (1) to (11); 50 | \draw[ultra thick, -, bend right=12, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=0.2mm}, decorate] (2) to (22); 51 | \draw[ultra thick, -, bend right=12, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=0.2mm}, decorate] (3) to (33); 52 | \draw[ultra thick, -, bend right=12, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=0.2mm}, decorate] (4) to (44); 53 | 54 | \draw[-, ultra thick, color=echodrk] (11) to (22); 55 | \draw[-, ultra thick, bend right=17, color=echodrk] (11) to (33); 56 | \draw[-, ultra thick, color=echodrk] (33) to (44); 57 | 58 | \draw[-, ultra thick, color=mygreen] (111) to (222); 59 | \draw[-, ultra thick, color=mygreen] (222) to (333); 60 | 61 | \draw[-, ultra thick, bend left=17, color=red] (1) to (3); 62 | \draw[-, ultra thick, bend left=17, color=red] (1) to (4); 63 | \draw[-, ultra thick, bend right=17, color=red] (2) to (4); 64 | \draw[-, ultra thick, color=red] (2) to (3); 65 | \draw[-, ultra thick, color=red] (3) to (4); 66 | 67 | \end{tikzpicture} 68 | \end{document} 69 | -------------------------------------------------------------------------------- /Progressive alignment/README.md: -------------------------------------------------------------------------------- 1 | # Progressive alignment 2 | 3 | ## Notes 4 | 5 | Illustration of a progressive DNA sequence alignment algorithm, for a given guide tree. Emphasises the ease of drawing such simple trees in TikZ. 6 | 7 | ## Output 8 | 9 | ![ProgressiveAlignment](https://www.dropbox.com/s/qqxvu1djftdwwtq/progressive_alignment.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Bioinformatics algorithms: analysis of DNA sequences](http://www.csnedelja.mg.edu.rs/static/resources/v1.0/bioinformatics.pdf), [mgcsweek](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Progressive alignment/progressive_alignment.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \begin{document} 5 | \begin{tikzpicture}[font=\tt\scriptsize, grow=up, level 1/.style={sibling distance=30mm}, level 2/.style={sibling distance=20mm}] 6 | \node[align=center](0){AC{-}{-}A\\CC{-}{-}A\\ACG-A\\A-GTA\\A-G-A} 7 | child{node[align=center]{AGTA\\AG-A} 8 | child{node{AGA}} 9 | child{node{AGTA}} 10 | } 11 | child{node[align=center]{AC-A\\CC-A\\ACGA} 12 | child{node{ACGA}} 13 | child{node[align=center]{ACA\\CCA} 14 | child{node{CCA}} 15 | child{node{ACA}} 16 | } 17 | }; 18 | \end{tikzpicture} 19 | \end{document} 20 | -------------------------------------------------------------------------------- /Progressive neural network/README.md: -------------------------------------------------------------------------------- 1 | # Progressive neural network 2 | 3 | ## Notes 4 | 5 | A diagram representing the [progressive neural network](https://arxiv.org/abs/1606.04671) architecture, by Rusu *et al.*, with particular emphasis on the lateral connections. 6 | 7 | ## Output 8 | 9 | ![ProgNN](https://www.dropbox.com/s/im3adtzxzcdr96a/progressive_neural_network.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Demystifying deep learning](https://www.cl.cam.ac.uk/~pv273/slides/LDSSlides.pdf), *London Data Science Summit* 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ti*k*Z 2 | 3 | > *TikZ ist kein Zeichnenprogramm* 4 | 5 | --- 6 | 7 | Complete collection of my PGF/TikZ figures. I will do my best to keep it updated as soon as new figures are published. 8 | 9 | ## Thanks 10 | 11 | This collection could not have been made possible without the help of the following resources: 12 | 13 | * [TeXample](http://www.texample.net); the figures from here often provide a solid starting point. 14 | * [LaTeX Stack Exchange](http://tex.stackexchange.com); threads from here are typically the first results that pop up when googling for a particular technique/problem. 15 | 16 | ## License 17 | 18 | MIT 19 | -------------------------------------------------------------------------------- /RN object extraction/README.md: -------------------------------------------------------------------------------- 1 | # Relational network (RN) object extraction 2 | 3 | ## Notes 4 | 5 | An overview of the object extraction procedure used for the Relational Network experiments by [Santoro et al. (2017)](https://arxiv.org/abs/1706.01427), illustrating how to use individual pixels of a CNN representation as objects. 6 | 7 | ## Output 8 | 9 | ![RNObj](https://www.dropbox.com/s/ud2gav6rzezq4ts/rn_object_extraction.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Relational Learning](http://www.cl.cam.ac.uk/~pv273/slides/MILA-RN.pdf), *MILA Graph Representation Group Meeting* 14 | -------------------------------------------------------------------------------- /RN object extraction/rn_object_extraction.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop,tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning} 5 | 6 | \definecolor{echoreg}{HTML}{2cb1e1} 7 | \definecolor{olivegreen}{rgb}{0,0.6,0} 8 | \definecolor{mymauve}{rgb}{0.58,0,0.82} 9 | 10 | \usepackage{etoolbox} 11 | 12 | \newtoggle{redraw} 13 | \newtoggle{redraw2} 14 | 15 | \tikzset{% 16 | pics/cube/.style args={#1/#2/#3/#4}{code={% 17 | \begin{scope}[line width=#4mm] 18 | \begin{scope} 19 | \clip (-#1,-#2,0) -- (#1,-#2,0) -- (#1,#2,0) -- (-#1,#2,0) -- cycle; 20 | \filldraw (-#1,-#2,0) -- (#1,-#2,0) -- (#1,#2,0) -- (-#1,#2,0) -- cycle; 21 | \end{scope} 22 | \iftoggle{redraw}{% 23 | }{% 24 | \begin{scope} 25 | \clip (-#1,-#2,0) -- (-#1-#3,-#2,-#3) -- (-#1-#3,#2,-#3) -- (-#1,#2,0) -- cycle; 26 | \filldraw (-#1,-#2,0) -- (-#1-#3,-#2,-#3) -- (-#1-#3,#2,-#3) -- (-#1,#2,0) -- cycle; 27 | \end{scope} 28 | } 29 | \iftoggle{redraw2}{% 30 | }{ 31 | \begin{scope} 32 | \clip (-#1,#2,0) -- (-#1-#3,#2,-#3) -- (#1-#3,#2,-#3) -- (#1,#2,0) -- cycle; 33 | \filldraw (-#1,#2,0) -- (-#1-#3,#2,-#3) -- (#1-#3,#2,-#3) -- (#1,#2,0) -- cycle; 34 | \end{scope} 35 | } 36 | \node[inner sep=0] (-A) at (-#1-#3*0.5, 0, -#3*0.5) {}; 37 | \node[inner sep=0] (-B) at (#1-#3*0.5, 0, -#3*0.5) {}; 38 | 39 | \coordinate (-V) at (#1, #2); 40 | \coordinate (-W) at (#1, -#2); 41 | \end{scope} 42 | }}} 43 | 44 | \begin{document} 45 | \begin{tikzpicture} 46 | 47 | \node[] (i2) {}; 48 | \pic[fill=green!50] (I2) {cube={1.8/1.8/0.4/1}}; 49 | 50 | \togglefalse{redraw} 51 | \togglefalse{redraw2} 52 | 53 | \node[right=16em of i2] (y) {}; 54 | 55 | \pic[right=16em of i2, fill=echoreg!50] (Y) {cube={1.8/1.8/1/1}}; 56 | 57 | \node[right=12em of y] (y1) {}; 58 | \pic[right=12em of y, fill=red!50] (Y1) {cube={0.9/0.9/1/1}}; 59 | 60 | %transparent node to ease the arrow drawing 61 | \pic[right=12em of y1, draw=echoreg!0, fill=echoreg!0] (Y2) {cube={0.9/0.9/2/1}}; 62 | \node[right=12em of y1] (y3) {}; 63 | \pic[below right=1.1em and 13em of y1, fill=mymauve!30] (Y5) {cube={0.45/0.45/2/1}}; 64 | \pic[below right=1.1em and 10em of y1, fill=mymauve!30] (Y6) {cube={0.45/0.45/2/1}}; 65 | \pic[above right=1.1em and 13em of y1, fill=mymauve!30] (Y4) {cube={0.45/0.45/2/1}}; 66 | \pic[above right=1.1em and 10em of y1, fill=mymauve!30] (Y3) {cube={0.45/0.45/2/1}}; 67 | 68 | \draw [-stealth, ultra thick] (I2-B) -- node[above] {Conv.} (Y-A); 69 | 70 | \draw [-stealth, ultra thick] (Y-B) -- node[above] {Pool} (Y1-A); 71 | 72 | \draw [-stealth, ultra thick] (Y1-B) -- node[above=0.3em, inner sep=0.1em, xshift=-1em] {Conv.} (Y2-A); 73 | 74 | 75 | \color{black} 76 | 77 | \toggletrue{redraw} 78 | \toggletrue{redraw2} 79 | 80 | \pic[right=16em of i2, fill=echoreg!50] (Y) {cube={1.8/1.8/1/1}}; 81 | 82 | \pic[right=12em of y, fill=red!50] (Y1) {cube={0.9/0.9/1/1}}; 83 | 84 | \node[] (i2) {\LARGE ${\bf input}$}; 85 | \node[above right=0.1em and 9em of y1] (z2) {\LARGE $\vec{o}_1$}; 86 | \node[below right=0em and 9em of y1] (z2) {\LARGE $\vec{o}_3$}; 87 | \node[above right=0.1em and 12em of y1] (z2) {\LARGE $\vec{o}_2$}; 88 | \node[below right=0em and 12em of y1] (z2) {\LARGE $\vec{o}_4$}; 89 | 90 | \end{tikzpicture} 91 | \end{document} -------------------------------------------------------------------------------- /Reinforcement learning greedy policy/README.md: -------------------------------------------------------------------------------- 1 | # Reinforcement learning greedy policy 2 | 3 | ## Notes 4 | 5 | A diagram representing the result of a simple greedy algorithm on top of a parameterised policy, in the context of a trivial grid environment for reinforcement learning. 6 | 7 | ## Output 8 | 9 | ![RLGreedyPolicy](https://www.dropbox.com/s/dzd10h7pb60op2x/reinforcement_learning_greedy_policy.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Reinforcement Learning](http://csnedelja.mg.edu.rs/static/resources/v4.0/sre1_ucenje_pv.pdf), [mgcsweek4](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Reinforcement learning greedy policy/reinforcement_learning_greedy_policy.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{amsmath} 4 | \usepackage{amssymb} 5 | \usepackage{xcolor} 6 | 7 | \usetikzlibrary{positioning, decorations.pathmorphing} 8 | 9 | \definecolor{olivegreen}{rgb}{0,0.6,0} 10 | 11 | \begin{document} 12 | \begin{tikzpicture} 13 | \node[rectangle, minimum width=5em, minimum height=5em, fill=lightgray!20] (X) {}; 14 | \node[rectangle, fill=blue!30, minimum width=2em, minimum height=2em, xshift=-1.5em, yshift=-1.5em] at (X) (AA) {}; 15 | \node[rectangle, minimum width=2em, minimum height=2em, xshift=1.5em, yshift=1.5em, olivegreen] at (X) (LA) {$\boldsymbol\pounds\boldsymbol\pounds$}; 16 | \node[rectangle, very thick, draw, minimum width=5em, minimum height=5em] at (X) (K) {}; 17 | \node[rectangle, right=5em of X, minimum width=5em, minimum height=5em, fill=lightgray!20] (Y) {}; 18 | \node[rectangle, fill=blue!30, minimum width=2em, minimum height=2em, xshift=-1.5em, yshift=1.5em] at (Y) (BB) {}; 19 | \node[rectangle, minimum width=2em, minimum height=2em, xshift=1.5em, yshift=1.5em, olivegreen] at (Y) (LB) {$\boldsymbol\pounds\boldsymbol\pounds$}; 20 | \node[rectangle, very thick, draw, minimum width=5em, minimum height=5em] at (Y) (W) {}; 21 | \node[rectangle, right=5em of Y, minimum width=5em, minimum height=5em, fill=lightgray!20] (Z) {}; 22 | \node[rectangle, fill=blue!30, minimum width=2em, minimum height=2em, xshift=1.5em, yshift=1.5em] at (Z) (CC) {}; 23 | \node[rectangle, minimum width=2em, minimum height=2em, xshift=1.5em, yshift=1.5em, olivegreen] at (Z) (LC) {$\boldsymbol\pounds\boldsymbol\pounds$}; 24 | \node[rectangle, very thick, draw, minimum width=5em, minimum height=5em] at (Z) (AS) {}; 25 | 26 | \node[below=0.5em of X] (l1) {$s_0$}; 27 | \node[below=0.5em of Y] (l2) {$s_1$}; 28 | \node[below=0.5em of Z] (l3) {$s_2$}; 29 | 30 | \node[above=4em of X] (P1) {$[0.12, {\bf 0.64}, 0.07, 0.17]$}; 31 | \node[above=4em of Y] (P2) {$[0.03, 0.24, {\bf 0.47}, 0.26]$}; 32 | \node[above=4em of Z] (P3) {$[{\bf 0.82}, 0.04, 0.08, 0.06]$}; 33 | 34 | \draw[-stealth, ultra thick] (X) -- node[left] {$\pi_\theta(s_0)$} (P1); 35 | \draw[-stealth, ultra thick] (Y) -- node[left] {$\pi_\theta(s_1)$} (P2); 36 | \draw[-stealth, ultra thick] (Z) -- node[left] {$\pi_\theta(s_2)$} (P3); 37 | 38 | \node[above=2em of P1] (A1) {up}; 39 | \node[above=2em of P2] (A2) {right}; 40 | \node[above=2em of P3] (A3) {pick up}; 41 | 42 | \draw[-stealth, very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] ([xshift=-1em]P1.north) -- (A1); 43 | \draw[-stealth, very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] ([xshift=1em]P2.north) -- (A2); 44 | \draw[-stealth, very thick,decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] ([xshift=-3em]P3.north) -- (A3); 45 | 46 | \node[above=2em of A1] (R1) {$r_0 = 0$}; 47 | \node[above=2em of A2] (R2) {$r_1 = 0$}; 48 | \node[above=2em of A3] (R3) {$r_2 = 2$}; 49 | 50 | \draw[-stealth, very thick] (A1) -- node[left] {$\mathcal{R}(s_0, \uparrow)$} (R1); 51 | \draw[-stealth, very thick] (A2) -- node[left] {$\mathcal{R}(s_1, \rightarrow)$} (R2); 52 | \draw[-stealth, very thick] (A3) -- node[left] {$\mathcal{R}(s_2, \star)$} (R3); 53 | 54 | \node[xshift=-2.5em, yshift=-0.5em] at (Y.west) {$\mathcal{T}(s_0, \uparrow)$} (R1); 55 | \node[xshift=-2.5em, yshift=-0.5em] at (Z.west) {$\mathcal{T}(s_1, \rightarrow)$} (R2); 56 | 57 | \draw [-stealth, very thick] plot [smooth, tension=1] coordinates { (A1.east) ([xshift=3.75em,yshift=-2em]A1.east) ([xshift=-2.5em,yshift=2em]Y.west) (Y.west)}; 58 | \draw [-stealth, very thick] plot [smooth, tension=1] coordinates { (A2.east) ([xshift=3.25em,yshift=-2em]A2.east) ([xshift=-2.5em,yshift=2em]Z.west) (Z.west)}; 59 | \end{tikzpicture} 60 | \end{document} 61 | -------------------------------------------------------------------------------- /Relational network/README.md: -------------------------------------------------------------------------------- 1 | # Relational network (RN) 2 | 3 | ## Notes 4 | 5 | An overview of the *Relational Network* architecture by [Santoro et al. (2017)](https://arxiv.org/abs/1706.01427), illustrating all the necessary elements, along with a wider object extraction and conditioning pipeline. 6 | 7 | ## Output 8 | 9 | ![RN](https://www.dropbox.com/s/hj6rlh46ob6q7m7/relational_network.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Relational Learning](http://www.cl.cam.ac.uk/~pv273/slides/MILA-RN.pdf), *MILA Graph Representation Group Meeting* 14 | -------------------------------------------------------------------------------- /Relational network/relational_network.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop,tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \definecolor{olivegreen}{rgb}{0,0.6,0} 7 | \definecolor{mymauve}{rgb}{0.58,0,0.82} 8 | \definecolor{camdrk}{RGB}{0,62,114} 9 | 10 | \begin{document} 11 | \begin{tikzpicture} 12 | \node[rectangle, draw, thick, olivegreen, minimum width=5em, minimum height=5em] (R) at (0, 0) {}; 13 | \node[rectangle, inner sep=0.1em, olivegreen,dashed, draw, thick] (C) at (-0.1, 0.1) {$\clubsuit$}; 14 | \node[rectangle, thick, inner sep=0.1em, olivegreen,dashed, draw, above right=0.1em and 0.3em of C] (D) {$\diamondsuit$}; 15 | \node[rectangle, thick, inner sep=0.1em, olivegreen,dashed, draw, below right=0.8em and -0.5em of D] (H) {$\heartsuit$}; 16 | \node[rectangle, thick, inner sep=0.1em, olivegreen,dashed, draw, below left=0.6em and 0.4em of C] (S) {$\spadesuit$}; 17 | \node[olivegreen,below=0em of R] (l1) {\emph{input}}; 18 | 19 | \node[camdrk, rectangle, draw, above right=-2.5em and 5em of R, minimum width=7em, thick] (Oc) {$\vec{o}_\clubsuit$}; 20 | \node[camdrk, rectangle, draw, above=0em of Oc, minimum width=7em, thick] (Od) {$\vec{o}_\diamondsuit$}; 21 | \node[camdrk, rectangle, draw, below=0em of Oc, minimum width=7em, thick] (Oh) {$\vec{o}_\heartsuit$}; 22 | \node[camdrk, rectangle, draw, below=0em of Oh, minimum width=7em, thick] (Os) {$\vec{o}_\spadesuit$}; 23 | 24 | \node[camdrk, left=0em of Oc] (lc) {$\clubsuit$}; 25 | \node[camdrk, left=0em of Od] (ld) {$\diamondsuit$}; 26 | \node[camdrk, left=0em of Oh] (lh) {$\heartsuit$}; 27 | \node[camdrk, left=0em of Os] (ls) {$\spadesuit$}; 28 | 29 | \node[camdrk, below=0em of Os] (lr) {\emph{objects}}; 30 | 31 | \draw[olivegreen,-stealth, thick, dashed] (C) -- (lc); 32 | \draw[olivegreen,-stealth, thick, dashed] (D) -- (ld); 33 | \draw[olivegreen,-stealth, thick, dashed] (H) -- (lh); 34 | \draw[olivegreen,-stealth, thick, dashed] (S) -- (ls); 35 | 36 | \node[draw, camdrk, thick, right=18em of R] (A) {\texttt{"two"}}; 37 | \node[camdrk, below=0em of A] {\emph{output}}; 38 | 39 | \draw[camdrk, densely dashed, very thick] (Od.north east) -- (A.north west); 40 | \draw[camdrk, densely dashed, very thick] (Os.south east) -- (A.south west); 41 | 42 | \fill [opacity=0.2, camdrk] (Od.north east) -- (A.north west) -- (A.south west) -- (Os.south east) -- cycle; 43 | 44 | % let's get funky 45 | \node[right=14.75em of R, inner sep=0em] (dum1) {}; 46 | \node[right=1.5em of Oc, inner sep=0em] (dum2) {}; 47 | \node[right=1.5em of Oh, inner sep=0em] (dum3) {}; 48 | 49 | \draw[camdrk, densely dotted, very thick] (Od.east) edge[bend left=60] (Oc.east); 50 | \draw[camdrk, densely dotted, very thick] plot [smooth, tension=1.5] coordinates { (Od.east) (dum2) (Oh.east)}; 51 | \draw[camdrk, densely dotted, very thick] plot [smooth, tension=1.5] coordinates { (Od.east) (dum1) (Os.east)}; 52 | \draw[camdrk, densely dotted, very thick] (Oc.east) edge[bend left=60] (Oh.east); 53 | \draw[camdrk, densely dotted, very thick] plot [smooth, tension=1.5] coordinates { (Oc.east) (dum3) (Os.east)}; 54 | \draw[camdrk, densely dotted, very thick] (Oh.east) edge[bend left=60] (Os.east); 55 | 56 | \node[mymauve,rectangle, thick, align=center, draw, below left=3em and -4em of Os, text width=13.5em] (Q) {\texttt{"How many outlined objects are above the spade?"}}; 57 | \node[mymauve,below=0em of Q] (ql) {\emph{query}}; 58 | 59 | \path[mymauve,-stealth, dashed, thick] (Q.east) edge[bend right] (6.2, -0.7); 60 | 61 | \node[camdrk] at (6.7, 0) (RN){\textbf{\emph{RN}}}; 62 | 63 | \end{tikzpicture} 64 | \end{document} -------------------------------------------------------------------------------- /Sampling/README.md: -------------------------------------------------------------------------------- 1 | # Sampling 2 | 3 | ## Notes 4 | 5 | By using the `axis` environment, creating a figure for nicely visualising the process of sampling a real function is easily illustrated. 6 | 7 | ## Output 8 | 9 | ![Sampling](https://www.dropbox.com/s/rbirkihey8t2sxc/sampling.png?raw=1) 10 | 11 | ## Source 12 | 13 | IQ sampling and FM demodulation using MATLAB, [mgcsweek v2.0](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Sampling/sampling.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{pgfplots} 4 | 5 | \begin{document} 6 | \begin{tikzpicture} 7 | \begin{axis}[ 8 | width=12.5cm, height=8cm, 9 | xtick=\empty, 10 | ytick=\empty, 11 | xlabel={\large $t$}, 12 | ylabel={\large $x(t)$}, 13 | xmin=0, xmax=16, 14 | ymin=-1.1, ymax=1.5, 15 | xtick={1.365, 2.73, 4.095, 5.46}, 16 | xticklabels={$\frac{1}{f_s}$, $\frac{2}{f_s}$, $\frac{3}{f_s}$, $\dots$}, 17 | axis lines = middle, 18 | very thick, 19 | domain = 0:15 20 | ] 21 | \addplot[no markers, samples = 100, smooth ,thick] {sin(2*180*x/13)}; 22 | \addplot+[ycomb, mark=*, mark color=blue, samples= 12, black, thick] {sin(2*180*x/13)}; 23 | \end{axis} 24 | \end{tikzpicture} 25 | \end{document} 26 | -------------------------------------------------------------------------------- /Self-attention/README.md: -------------------------------------------------------------------------------- 1 | # Self-attention 2 | 3 | ## Notes 4 | 5 | An overview of the generic form of the self-attention operation. 6 | 7 | ## Output 8 | 9 | ![SA](https://www.dropbox.com/s/wkq9bs0z5pp1n5o/self-attention.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Relational Learning](http://www.cl.cam.ac.uk/~pv273/slides/MILA-RN.pdf), *MILA Graph Representation Group Meeting* 14 | 15 | Original version of this figure is by [Andreea Deac](https://github.com/andreeadeac22)---with many thanks! 16 | -------------------------------------------------------------------------------- /Self-attention/self-attention.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \begin{document} 7 | \begin{tikzpicture} 8 | 9 | \node (X1) {$\vec{e}_{1}$}; 10 | 11 | \node[rectangle, right= 0.5em of X1] (x_dots_1) {$\dots$}; 12 | 13 | \node[right=0.5em of x_dots_1] (Xj) {$\vec{e}_{j}$}; 14 | 15 | \node[rectangle, right= 1em of Xj] (x_dots_2) {$\dots$}; 16 | 17 | \node[right=1em of x_dots_2] (Xn) {$\vec{e}_{n}$}; 18 | 19 | \node[rectangle, draw, ultra thick, above=of X1] (attn1) {\large $a_\phi$}; 20 | 21 | \node[rectangle, draw, ultra thick, above=of Xj] (attnj) {\large $a_\phi$}; 22 | 23 | \node[rectangle, draw, ultra thick, above=of Xn] (attnn) {\large $a_\phi$}; 24 | 25 | 26 | \draw[-stealth, thick] (X1) -- (attn1); 27 | \draw[-stealth, thick] (Xj) -- (attn1); 28 | 29 | \draw[-stealth, thick] (Xj) -- (attnj); 30 | \draw[-stealth, thick] ([xshift=3em]Xj) -- (attnj); 31 | 32 | \draw[-stealth, thick] (Xj) -- (attnn); 33 | \draw[-stealth, thick] (Xn) -- (attnn); 34 | 35 | \node[above= of attn1, opacity=0.2] (alpha1j) {$\alpha_{1,j}$}; 36 | \node[above= of attnj, opacity=1] (alphajj) {$\alpha_{j,j}$}; 37 | \node[above= of attnn, opacity=0.6] (alphanj) {$\alpha_{n,j}$}; 38 | 39 | \node[circle, draw, above=of alpha1j] (times1) {$\times$}; 40 | \node[circle, draw, above=of alphajj] (timesj) {$\times$}; 41 | \node[circle, draw, above=of alphanj] (timesn) {$\times$}; 42 | 43 | \node[rectangle, draw, above=of timesj] (sum) {$\Sigma$}; 44 | 45 | \node[above=1em of sum] (x_tprim) {$\vec{e}_j'$}; 46 | 47 | \draw[-stealth, line width=1.5mm, white] (attn1) -- (alpha1j); 48 | \draw[-stealth, thick, opacity=0.2] (attn1) -- (alpha1j); 49 | \draw[-stealth, line width=1.5mm, white] (attnj) -- (alphajj); 50 | \draw[-stealth, thick, opacity=1] (attnj) -- (alphajj); 51 | \draw[-stealth, line width=1.5mm, white] (attnn) -- (alphanj); 52 | \draw[-stealth, thick, opacity=0.6] (attnn) -- (alphanj); 53 | 54 | \draw[-stealth, white, line width=1.5mm] (X1) edge[bend right=30] (times1); 55 | \draw[-stealth, thick] (X1) edge[bend right=30] node[rectangle, draw, fill=white, midway] {$f_\psi$} (times1); 56 | \draw[-stealth, white, line width=1.5mm] (Xj) edge[bend right=30] (timesj); 57 | \draw[-stealth, thick] (Xj) edge[bend right=30] node[rectangle, draw, fill=white, midway] {$f_\psi$} (timesj); 58 | \draw[-stealth, thick] (Xn) edge[bend right=30] node[rectangle, draw, fill=white, midway] {$f_\psi$} (timesn); 59 | 60 | \draw[-, line width=1.5mm, white] (times1) -- (sum); 61 | \draw[-stealth, thick] (times1) -- (sum); 62 | \draw[-, line width=1.5mm, white] (timesj) -- (sum); 63 | \draw[-stealth, thick] (timesj) -- (sum); 64 | \draw[-stealth, thick] (timesn) -- (sum); 65 | \draw[-stealth, thick] (times1) -- (sum); 66 | 67 | \draw[-stealth, line width=1.5mm, white] (alpha1j) -- (times1); 68 | \draw[-stealth, thick, opacity=0.2] (alpha1j) -- (times1); 69 | \draw[-stealth, line width=1.5mm, white] (alphajj) -- (timesj); 70 | \draw[-stealth, thick, opacity=1] (alphajj) -- (timesj); 71 | \draw[-stealth, line width=1.5mm, white] (alphanj) -- (timesn); 72 | \draw[-stealth, thick, opacity=0.6] (alphanj) -- (timesn); 73 | 74 | \draw[-stealth, thick] (sum) -- (x_tprim); 75 | 76 | \end{tikzpicture} 77 | \end{document} -------------------------------------------------------------------------------- /Semi-supervised embedding/README.md: -------------------------------------------------------------------------------- 1 | # Semi-supervised embedding 2 | 3 | ## Notes 4 | 5 | A diagram representing the [semi-supervised embedding](https://dl.acm.org/citation.cfm?id=1390303) architecture, by Weston *et al.*. 6 | 7 | ## Output 8 | 9 | ![SemiEmb](https://www.dropbox.com/s/z5ajcmk2dpdwd0m/semi-supervised_embedding.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Overview of neural network architectures for graph-structured data analysis](https://www.cl.cam.ac.uk/~pv273/slides/CLGraph.pdf), *UCL AI Journal Club* 14 | -------------------------------------------------------------------------------- /Semi-supervised embedding/semi-supervised_embedding.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{calc,decorations.pathmorphing,positioning} 5 | 6 | \begin{document} 7 | \begin{tikzpicture} 8 | \node[very thick, densely dashed, draw=black,rectangle, minimum height=3.5em, minimum width=1.5em, xshift=15em, yshift=-1em, fill=lightgray] (rekt1) {}; 9 | 10 | \node[very thick, densely dashed, draw=black,rectangle, minimum height=3.5em, minimum width=1.5em, xshift=15em, yshift=-6.1em, fill=lightgray] (rekt2) {}; 11 | 12 | \draw[ultra thick] (rekt1) -- (rekt2); 13 | 14 | \node[] (c) at ($(rekt1)!0.5!(rekt2)$) {}; 15 | 16 | \node[circle, draw, thick] (f11) {}; 17 | \node[circle, draw, thick, below=0em of f11] (f12) {}; 18 | \node[circle, draw, thick, below=0em of f12] (f13) {}; 19 | \node[circle, draw, thick, below=2em of f13] (f21) {}; 20 | \node[circle, draw, thick, below=0em of f21] (f22) {}; 21 | \node[circle, draw, thick, below=0em of f22] (f23) {}; 22 | 23 | \node[left=1em of f12] (il1) {$\vec{f}_i$}; 24 | \node[left=1em of f22] (il2) {$\vec{f}_j$}; 25 | 26 | \node[rectangle, draw, thick] (Q) at ($(il1)!0.5!(il2)$) {?}; 27 | \draw[ultra thick] (il1) -- (Q); 28 | \draw[ultra thick] (il2) -- (Q); 29 | 30 | \draw[dashed, ultra thick] (Q) -- (c); 31 | 32 | \node[circle, draw, thick, right=4em of f11] (h11) {}; 33 | \node[circle, draw, thick, right=4em of f12] (h12) {}; 34 | \node[circle, draw, thick, right=4em of f13] (h13) {}; 35 | \node[circle, draw, thick, right=4em of f21] (h21) {}; 36 | \node[circle, draw, thick, right=4em of f22] (h22) {}; 37 | \node[circle, draw, thick, right=4em of f23] (h23) {}; 38 | 39 | \node[circle, draw, thick, right=4em of h11] (k11) {}; 40 | \node[circle, draw, thick, right=4em of h12] (k12) {}; 41 | \node[circle, draw, thick, right=4em of h13] (k13) {}; 42 | \node[circle, draw, thick, right=4em of h21] (k21) {}; 43 | \node[circle, draw, thick, right=4em of h22] (k22) {}; 44 | \node[circle, draw, thick, right=4em of h23] (k23) {}; 45 | 46 | \node[circle, draw, thick, right=4em of k11] (l11) {}; 47 | \node[circle, draw, thick, right=4em of k12] (l12) {}; 48 | \node[circle, draw, thick, right=4em of k13] (l13) {}; 49 | \node[circle, draw, thick, right=4em of k21] (l21) {}; 50 | \node[circle, draw, thick, right=4em of k22] (l22) {}; 51 | \node[circle, draw, thick, right=4em of k23] (l23) {}; 52 | 53 | \node[circle, draw, thick, right=4em of l12] (o1) {}; 54 | \node[circle, draw, thick, right=4em of l22] (o2) {}; 55 | \node[right=1em of o1] (ll1) {$y_i$}; 56 | \node[right=1em of o2] (ll2) {$y_j$}; 57 | 58 | \foreach \l in {1,2} 59 | \foreach \x in {1,2,3} 60 | \foreach \y in {1,2,3} 61 | \draw[-stealth, thick] (f\l\x) -- (h\l\y); 62 | 63 | \foreach \l in {1,2} 64 | \foreach \x in {1,2,3} 65 | \foreach \y in {1,2,3} 66 | \draw[-stealth, thick] (h\l\x) -- (k\l\y); 67 | 68 | \foreach \l in {1,2} 69 | \foreach \x in {1,2,3} 70 | \foreach \y in {1,2,3} 71 | \draw[-stealth, thick] (k\l\x) -- (l\l\y); 72 | 73 | \foreach \l in {1,2} 74 | \foreach \x in {1,2,3} 75 | \draw[-stealth, thick] (l\l\x) -- (o\l); 76 | 77 | \end{tikzpicture} 78 | \end{document} -------------------------------------------------------------------------------- /Semi-supervised learning/README.md: -------------------------------------------------------------------------------- 1 | # Semi-supervised learning 2 | 3 | ## Notes 4 | 5 | A simple sketch illustrating the benefits of incorporating unlabelled data to the supervised learning process. Can be easily presented as an animation as well. 6 | 7 | ## Output 8 | 9 | ![SemiSup](https://www.dropbox.com/s/64anp4jn9rcm2hl/semi-supervised_learning.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Unsupervised methods: Diving deep into autoencoders](http://www.cl.cam.ac.uk/~pv273/slides/UCLSlides.pdf), *Introduction to Deep Learning (COMPGI23), University College London* 14 | -------------------------------------------------------------------------------- /Semi-supervised learning/semi-supervised_learning.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \begin{document} 7 | \begin{tikzpicture} 8 | 9 | \draw[ultra thick, lightgray, dashed] (5.5, 2) -- (5.5, -2); 10 | \node[circle,inner sep=0.3em,fill=red,very thick] (X) at (4.5, 0.5) {}; 11 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (4.7, 0.1) {}; 12 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (5.2, 0.1) {}; 13 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (5.1, -0.3) {}; 14 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (5.6, -0.33) {}; 15 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (5.4, -0.7) {}; 16 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (5.8, -0.9) {}; 17 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (5.9, -1.3) {}; 18 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (6.4, -1.2) {}; 19 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (6.9, -1.1) {}; 20 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (7.4, -1.3) {}; 21 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (7.45, -1.7) {}; 22 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (7.8, -1.5) {}; 23 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (8.2, -1.4) {}; 24 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (8.3, -1.0) {}; 25 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (8.6, -1.3) {}; 26 | 27 | \node[circle,inner sep=0.3em,fill=blue,very thick] (Y) at (6.5, 0.5) {}; 28 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (6.1, 0.8) {}; 29 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (5.7, 0.9) {}; 30 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (5.8, 1.3) {}; 31 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (5.4, 1.15) {}; 32 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (5, 1.2) {}; 33 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (4.8, 1.5) {}; 34 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (4.3, 1.6) {}; 35 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (4.2, 1.2) {}; 36 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (3.8, 1.3) {}; 37 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (3.4, 1.3) {}; 38 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (3.4, 0.8) {}; 39 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (3.1, 1.1) {}; 40 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (2.75, 0.7) {}; 41 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (2.45, 0.1) {}; 42 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (2.35, 0.45) {}; 43 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (1.9, -0.04) {}; 44 | \node[circle,inner sep=0.3em,fill=gray,very thick] (Y) at (1.85, -0.5) {}; 45 | 46 | \draw[ultra thick, black, dashed](1.5,-1) cos 47 | (3,0) sin (4.5,1) cos (6,0) sin (7.5,-1) cos (9,0); 48 | 49 | \end{tikzpicture} 50 | \end{document} -------------------------------------------------------------------------------- /Shortest path problem/README.md: -------------------------------------------------------------------------------- 1 | # Shortest path problem 2 | 3 | ## Notes 4 | 5 | Another in a series of uses of `tkz-graph`, this graphic displays a weighted digraph without negative-weight cycles, and a highlighted shortest path. 6 | 7 | ## Output 8 | 9 | ![ShortestPathProblem](https://www.dropbox.com/s/e4c8narcmqsp87w/shortest_path_problem.png?raw=1) 10 | 11 | ## Source 12 | 13 | Linear programming and the Simplex algorithm, [mgcsweek v2.0](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Shortest path problem/shortest_path_problem.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{tkz-graph} 4 | 5 | \begin{document} 6 | \begin{tikzpicture}[scale=0.8,every node/.style={scale=0.7},font=\tt] 7 | \SetUpEdge[ lw = 0.75pt, 8 | color = red, 9 | labelcolor = white] 10 | \GraphInit[vstyle=Normal] 11 | \SetGraphUnit{2} 12 | \tikzset{VertexStyle/.append style={fill=red!50}} 13 | \Vertex{s} 14 | \tikzset{VertexStyle/.append style={fill=white}} 15 | \NOEA(s){a} 16 | \EA(a){d} 17 | \tikzset{VertexStyle/.append style={fill=blue!50}} 18 | \SOEA(d){t} 19 | \tikzset{VertexStyle/.append style={fill=white}} 20 | \EA(s){b} 21 | \EA(b){e} 22 | \SOEA(s){c} 23 | \EA(c){f} 24 | \tikzset{EdgeStyle/.style={-stealth, color=black}} 25 | \Edge[label=6](s)(a) 26 | \Edge[label=2](s)(b) 27 | \SetUpEdge[labeltext=red] 28 | \tikzset{EdgeStyle/.style={-stealth, color=red}} 29 | \Edge[label=2](s)(c) 30 | \SetUpEdge[labeltext=black] 31 | \tikzset{EdgeStyle/.style={-stealth, color=black}} 32 | \Edge[label=5](a)(d) 33 | \Edge[label=4](a)(e) 34 | \tikzset{EdgeStyle/.style={-stealth, color=black, bend left=15}} 35 | \Edge[label=4](b)(e) 36 | \Edge[label=-2](e)(b) 37 | \SetUpEdge[labeltext=red] 38 | \tikzset{EdgeStyle/.style={-stealth, color=red}} 39 | \Edge[label=1](c)(f) 40 | \SetUpEdge[labeltext=black] 41 | \tikzset{EdgeStyle/.style={-stealth, color=black}} 42 | \Edge[label=1](d)(t) 43 | \SetUpEdge[labeltext=red] 44 | \tikzset{EdgeStyle/.style={-stealth, color=red}} 45 | \Edge[label=3](e)(t) 46 | \Edge[label=2](f)(e) 47 | \SetUpEdge[labeltext=black] 48 | \tikzset{EdgeStyle/.style={-stealth, color=black}} 49 | \Edge[label=5](f)(t) 50 | \end{tikzpicture} 51 | \end{document} 52 | -------------------------------------------------------------------------------- /Sparse DGI/README.md: -------------------------------------------------------------------------------- 1 | # Sparse Deep Graph Infomax (DGI) 2 | 3 | ## Notes 4 | 5 | An illustration of the application of Deep Graph Infomax (DGI) to large-scale graph datasets (such as Reddit)---by way of _subsampling_, as is done by approaches such as GraphSAGE. Besides the usual colourful and decorative elements, here I have expressed node shifts using _polar coordinates_, to provide a faithful "radial" expansions of neighbourhoods. 6 | 7 | ## Output 8 | 9 | ![SpDGI](https://www.dropbox.com/s/my7yim6n5zpie0o/sparse_dgi.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Deep Graph Infomax](https://arxiv.org/abs/1809.10341), _ICLR 2019_ 14 | -------------------------------------------------------------------------------- /Supervised learning setup/README.md: -------------------------------------------------------------------------------- 1 | # Supervised learning setup 2 | 3 | ## Notes 4 | 5 | A simple and concise representation of the setup to a supervised learning problem. 6 | 7 | ## Output 8 | 9 | ![SupervisedLearningSetup](https://www.dropbox.com/s/kzenlcrlq5s8nhg/supervised_learning_setup.png?raw=1) 10 | 11 | ## Source 12 | 13 | Multiplex network inference, [mgcsweek v2.0](https://csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Supervised learning setup/supervised_learning_setup.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning, decorations.pathmorphing} 5 | 6 | \begin{document} 7 | \begin{tikzpicture}[node distance=1.5cm] 8 | \node[rectangle, very thick, draw] (learning) {Learning algorithm, $L$}; 9 | \node[rectangle, very thick, draw, below = of learning] (inference) {Labelling function, $h$}; 10 | \node[left = of learning] (train) {Training data, $\vec{s}$}; 11 | \node[left = of inference] (uns) {Unseen data, $x$}; 12 | \node[right = of inference] (lab) {Label, $y$}; 13 | 14 | \draw[-stealth, very thick] (train) -- (learning); 15 | \draw[-stealth, very thick, decoration={snake, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate] (learning) -- node[right] {$L(\vec{s})$} (inference); 16 | \draw[-stealth, very thick] (uns) -- (inference); 17 | \draw[-stealth, very thick] (inference) -- node[above] {$h(x)$} (lab); 18 | \end{tikzpicture} 19 | \end{document} 20 | -------------------------------------------------------------------------------- /Variational denoising autoencoder/README.md: -------------------------------------------------------------------------------- 1 | # Variational denoising autoencoder 2 | 3 | ## Notes 4 | 5 | A representation of a denoising variational autoencoder (VAE), drawn using careful draw ordering, decorated arrows, and appropriate node labels. Arguably, one of my favourite sketches in this repository. 6 | 7 | ## Output 8 | 9 | ![VDAE](https://www.dropbox.com/s/qnual22k90uzcm1/variational_denoising_autoencoder.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Unsupervised methods: Diving deep into autoencoders](http://www.cl.cam.ac.uk/~pv273/slides/UCLSlides.pdf), *Introduction to Deep Learning (COMPGI23), University College London* 14 | -------------------------------------------------------------------------------- /Variational denoising autoencoder/variational_denoising_autoencoder.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop,tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{arrows,decorations.pathmorphing,positioning} 5 | 6 | \definecolor{olivegreen}{rgb}{0,0.6,0} 7 | 8 | \begin{document} 9 | \begin{tikzpicture} 10 | 11 | \node (1) [draw, dashed, minimum height=15em, minimum width=15em, xshift=6.5em, fill=olivegreen, fill opacity=0.2, very thick, rectangle, rounded corners] {}; 12 | \node (la1) [below=0em of 1] {\emph{encoder}}; 13 | \node (2) [draw, dashed, minimum height=14em, fill = red, fill opacity=0.2,minimum width=14em, xshift=19em, very thick, rectangle, rounded corners] {}; 14 | \node (la1) [below=0em of 2] {\emph{decoder}}; 15 | \node (3) [draw, dashed, minimum height=16em, fill = blue, fill opacity=0.2,minimum width=5em, xshift=-1.5em, very thick, rectangle, rounded corners] {}; 16 | \node (la3) [below=0em of 3] {\emph{corrupt}}; 17 | 18 | \node[circle, thick, fill=red!50, draw] (x1) {}; 19 | \node[circle, thick, draw, fill=red!50, below=1em of x1] (x2) {}; 20 | \node[circle, thick, fill=red!50, draw, below=1em of x2] (x3) {}; 21 | \node[circle, thick, fill=red!50, draw, below=1em of x3] (x4) {}; 22 | \node[circle, thick, fill=red!50, draw, above=1em of x1] (x5) {}; 23 | \node[circle, thick, fill=red!50, draw, above=1em of x5] (x6) {}; 24 | \node[circle, thick, fill=red!50, draw, above=1em of x6] (x7) {}; 25 | 26 | \foreach \x in {1,...,7} 27 | \node at (x\x) (lx\x) {$\sim$}; 28 | 29 | \node[circle, thick, fill=white, left=2em of x1, draw] (i1) {}; 30 | \node[circle, thick, draw, fill=white, below=1em of i1] (i2) {}; 31 | \node[circle, thick, fill=white, draw, below=1em of i2] (i3) {}; 32 | \node[circle, thick, fill=white, draw, below=1em of i3] (i4) {}; 33 | \node[circle, thick, fill=white, draw, above=1em of i1] (i5) {}; 34 | \node[circle, thick, fill=white, draw, above=1em of i5] (i6) {}; 35 | \node[circle, thick, fill=white, draw, above=1em of i6] (i7) {}; 36 | 37 | \foreach \x in {1,...,7} 38 | \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick] (i\x) -- (x\x); 39 | 40 | \node[circle, thick, right=4em of x1, fill=white, draw] (xh1) {}; 41 | \node[circle, thick, draw, fill=white, below=1em of xh1] (xh2) {}; 42 | \node[circle, thick, fill=white, draw, below=1em of xh2] (xh3) {}; 43 | \node[circle, thick, fill=white, draw, above=1em of xh1] (xh4) {}; 44 | \node[circle, thick, fill=white, draw, above=1em of xh4] (xh5) {}; 45 | \node[circle, thick, fill=white, draw, right=8em of x1, yshift=5em] (hm1) {}; 46 | \node[circle, thick, draw, fill=white, below=0.5em of hm1] (hm2) {}; 47 | \node[circle, thick, draw, fill=white, below=0.5em of hm2] (hm3) {}; 48 | \node[circle, thick, draw, fill=white, above=0.5em of hm1] (hm4) {}; 49 | \node[circle, thick, fill=white, draw, right=8em of x1, yshift=-3em] (hs1) {}; 50 | \node[circle, thick, draw, fill=white, below=0.5em of hs1] (hs2) {}; 51 | \node[circle, thick, draw, fill=white, below=0.5em of hs2] (hs3) {}; 52 | \node[circle, thick, draw, fill=white, above=0.5em of hs1] (hs4) {}; 53 | \node[] at (hm1) (mu1) {$\mu$}; 54 | \node[] at (hm2) (mu2) {$\mu$}; 55 | \node[] at (hm3) (mu3) {$\mu$}; 56 | \node[] at (hm4) (mu4) {$\mu$}; 57 | \node[] at (hs1) (s1) {$\sigma$}; 58 | \node[] at (hs2) (s2) {$\sigma$}; 59 | \node[] at (hs3) (s3) {$\sigma$}; 60 | \node[] at (hs4) (s4) {$\sigma$}; 61 | 62 | \node[circle, thick, fill=lightgray, draw, right=12em of x1, yshift=1em] (h1) {}; 63 | \node[circle, thick, draw, fill=lightgray, below=1em of h1] (h2) {}; 64 | \node[circle, thick, draw, fill=lightgray, below=1em of h2] (h3) {}; 65 | \node[circle, thick, draw, fill=lightgray, above=1em of h1] (h4) {}; 66 | \node[circle, thick, right=16em of x1, fill=white, draw] (oh1) {}; 67 | \node[circle, thick, draw, fill=white, below=1em of oh1] (oh2) {}; 68 | \node[circle, thick, fill=white, draw, below=1em of oh2] (oh3) {}; 69 | \node[circle, thick, fill=white, draw, above=1em of oh1] (oh4) {}; 70 | \node[circle, thick, fill=white, draw, above=1em of oh4] (oh5) {}; 71 | \node[circle, thick, draw, fill=white, right=20em of x1] (o1) {}; 72 | \node[circle, thick, draw, fill=white, below=1em of o1] (o2) {}; 73 | \node[circle, thick, draw, fill=white, below=1em of o2] (o3) {}; 74 | \node[circle, thick, draw, fill=white, below=1em of o3] (o4) {}; 75 | \node[circle, thick, draw, fill=white, above=1em of o1] (o5) {}; 76 | \node[circle, thick, draw, fill=white, above=1em of o5] (o6) {}; 77 | \node[circle, thick, draw, fill=white, above=1em of o6] (o7) {}; 78 | \node[circle, thick, draw, fill=white, right=24em of x1] (oo1) {}; 79 | \node[circle, thick, draw, fill=white, below=1em of oo1] (oo2) {}; 80 | \node[circle, thick, draw, fill=white, below=1em of oo2] (oo3) {}; 81 | \node[circle, thick, draw, fill=white, below=1em of oo3] (oo4) {}; 82 | \node[circle, thick, draw, fill=white, above=1em of oo1] (oo5) {}; 83 | \node[circle, thick, draw, fill=white, above=1em of oo5] (oo6) {}; 84 | \node[circle, thick, draw, fill=white, above=1em of oo6] (oo7) {}; 85 | \node[] at (o1) (muu1) {$\mu$}; 86 | \node[] at (o2) (muu2) {$\mu$}; 87 | \node[] at (o3) (muu3) {$\mu$}; 88 | \node[] at (o4) (muu4) {$\mu$}; 89 | \node[] at (o5) (muu5) {$\mu$}; 90 | \node[] at (o6) (muu6) {$\mu$}; 91 | \node[] at (o7) (muu7) {$\mu$}; 92 | 93 | \foreach \x in {1,...,7} 94 | \foreach \y in {1,...,5} 95 | \draw[-stealth, thick] (x\x) -- (xh\y); 96 | 97 | \foreach \x in {1,...,5} 98 | \foreach \y in {1,...,4} 99 | \draw[-stealth, thick] (xh\x) -- (hm\y); 100 | 101 | \foreach \x in {1,...,5} 102 | \foreach \y in {1,...,4} 103 | \draw[-stealth, thick] (xh\x) -- (hs\y); 104 | 105 | \foreach \x in {1,...,4} 106 | \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick] (hs\x) -- (h\x); 107 | \foreach \x in {1,...,4} 108 | \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick] (hm\x) -- (h\x); 109 | 110 | \foreach \x in {1,...,5} 111 | \foreach \y in {1,...,4} 112 | \draw[-stealth, thick] (h\y) -- (oh\x); 113 | 114 | \foreach \x in {1,...,5} 115 | \foreach \y in {1,...,7} 116 | \draw[-stealth, thick] (oh\x) -- (o\y); 117 | 118 | \foreach \x in {1,...,7} 119 | \draw[-stealth, decoration={snake, pre length=0.01mm, segment length=2mm, amplitude=0.3mm, post length=1.5mm}, decorate, thick] (o\x) -- (oo\x); 120 | 121 | \node[left=0.5em of i1] (l1) {$\vec{x}$}; 122 | \node[above=0em of h4] (l2) {$\vec{z}$}; 123 | \node[right=0.5em of oo1] (l3) {$\vec{x}'$}; 124 | 125 | \end{tikzpicture} 126 | \end{document} -------------------------------------------------------------------------------- /Web graph/README.md: -------------------------------------------------------------------------------- 1 | # Web graph 2 | 3 | ## Notes 4 | 5 | In the original usage, this graph was used as a starting point for a PageRank example. In reality it's just a plain digraph, demonstrating some useful practices when building a graph in Ti*k*Z without using `tkz-graph`. 6 | 7 | ## Output 8 | 9 | ![WebGraph](https://www.dropbox.com/s/zscv882g9d5iwnt/web_graph.png?raw=1) 10 | 11 | ## Source 12 | 13 | Markov chains, PageRank and clustering, [mgcsweek v2.0](https://csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /Web graph/web_graph.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{positioning} 5 | 6 | \begin{document} 7 | \begin{tikzpicture} 8 | \node[circle, thick, draw] (0) {$d_0$}; 9 | \node[circle, thick, draw, below = 4.5em of 0] (1) {$d_1$}; 10 | \node[circle, thick, draw, right = 4.5em of 0] (2) {$d_2$}; 11 | \node[circle, thick, draw, right = 4.5em of 2] (3) {$d_3$}; 12 | \node[circle, thick, draw, right = 4.5em of 3] (6) {$d_6$}; 13 | \node[circle, thick, draw, above = 4.5em of 6] (5) {$d_5$}; 14 | \node[circle, thick, draw, below = 4.5em of 6] (4) {$d_4$}; 15 | 16 | \path[-stealth, very thick] (0) edge [bend right=45] (2); 17 | \path[-stealth, very thick] (2) edge [bend right=45] (0); 18 | \path[-stealth, very thick] (1) edge [bend right] (2); 19 | \path[-stealth, very thick] (1) edge [->, >=stealth, loop left] (1); 20 | \path[-stealth, very thick] (2) edge [->, >=stealth, loop above] (2); 21 | \path[-stealth, very thick] (3) edge [->, >=stealth, loop above] (3); 22 | \draw[-stealth, very thick] (2) -- (3); 23 | \path[-stealth, very thick] (3) edge [bend right] (4); 24 | \draw[-stealth, very thick] (5) -- (6); 25 | \draw[-stealth, very thick] (6) -- (3); 26 | \path[-stealth, very thick] (6) edge [bend right=45] (4); 27 | \path[-stealth, very thick] (4) edge [bend right=45] (6); 28 | \path[-stealth, very thick] (5) edge [->, >=stealth, loop right] (5); 29 | \path[-stealth, very thick] (6) edge [->, >=stealth, loop right] (6); 30 | \end{tikzpicture} 31 | \end{document} 32 | -------------------------------------------------------------------------------- /X-CNN/README.md: -------------------------------------------------------------------------------- 1 | # X-CNN 2 | 3 | ## Notes 4 | 5 | A diagram representing a cross-modal convolutional neural network (X-CNN) architecture. Features extensive use of three-dimensional cube nodes, with appropriate arrow positioning, redrawing and clipping. 6 | 7 | ## Output 8 | 9 | ![XCNN](https://www.dropbox.com/s/j805m0kr2f6egmk/x-cnn.png?raw=1) 10 | 11 | ## Source 12 | 13 | [X-CNN: Cross-modal Convolutional Neural Networks for Sparse Datasets](https://arxiv.org/abs/1610.00163), *IEEE SSCI 2016* 14 | -------------------------------------------------------------------------------- /X-LSTM/README.md: -------------------------------------------------------------------------------- 1 | # X-LSTM 2 | 3 | ## Notes 4 | 5 | A diagram representing a cross-modal long-short term memory (X-LSTM) architecture, in a hierarchical fashion (starting with a single LSTM cell, representing it as a component of a single unrolled LSTM block, then representing a cross-modal variant as the interchange of LSTM blocks on multimodal sequences). Features careful use of positioning and redrawing. 6 | 7 | ## Output 8 | 9 | ![XLSTM](https://www.dropbox.com/s/q4k65y5bhrfov7e/x-lstm.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Cross-modal Recurrent Models for Weight Objective Prediction from Multimodal Time-series Data](https://arxiv.org/abs/1709.08073), *NIPS ML4H 2017* 14 | -------------------------------------------------------------------------------- /de Bruijn graph/README.md: -------------------------------------------------------------------------------- 1 | # de Bruijn graph 2 | 3 | ## Notes 4 | 5 | A diagram of a de Bruijn graph (in the context of genome reconstruction), with its Eulerian cycle highlighted. Showcases once again the simplicity of using the `tkz-graph` package, as well as some rather tight maneuvering around the nodes. 6 | 7 | ## Output 8 | 9 | ![DeBruijnGraph](https://www.dropbox.com/s/g24a7z6drtsxu73/de_bruijn_graph.png?raw=1) 10 | 11 | ## Source 12 | 13 | [Bioinformatics algorithms: analysis of DNA sequences](http://www.csnedelja.mg.edu.rs/static/resources/v1.0/bioinformatics.pdf), [mgcsweek](http://www.csnedelja.mg.edu.rs) 14 | -------------------------------------------------------------------------------- /de Bruijn graph/de_bruijn_graph.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | \usepackage{tkz-graph} 4 | 5 | \begin{document} 6 | \begin{tikzpicture}[scale=0.8,every node/.style={scale=0.7},font=\tt] 7 | \SetUpEdge[lw = 1.5pt, 8 | color = black, 9 | labelcolor = white] 10 | \GraphInit[vstyle=Normal] 11 | \SetGraphUnit{2.5} 12 | \tikzset{VertexStyle/.append style={fill}} 13 | \Vertex{AT} 14 | \EA(AT){TG} 15 | \EA(TG){GG} 16 | \SO(GG){GC} 17 | \SO(GC){CG} 18 | \WE(CG){GT} 19 | \WE(GT){CA} 20 | \NO(CA){AA} 21 | \tikzset{EdgeStyle/.style={-stealth}} 22 | \Edge[label=ATG](AT)(TG) 23 | \Edge[label=TGG](TG)(GG) 24 | \Edge[label=GGC](GG)(GC) 25 | \Edge[label=GCG](GC)(CG) 26 | \Edge[label=CGT](CG)(GT) 27 | \Edge[label=GTG](GT)(TG) 28 | \Edge[label=TGC](TG)(GC) 29 | \Edge[label=GCA, style={pos=.3}](GC)(CA) 30 | \Edge[label=CAA](CA)(AA) 31 | \Edge[label=AAT](AA)(AT) 32 | 33 | \draw[thick, red, dashed] (AT) ++(160:13pt)coordinate(AT1) arc (-200:-340:13pt) coordinate(AT2); 34 | \draw[thick, red, dashed] (TG) ++(160:13pt)coordinate(TG1) arc (-200:-340:13pt) coordinate(TG2); 35 | \draw[thick, red, dashed] (GG) ++(160:13pt)coordinate(GG1) arc (-200:-400:13pt) coordinate(GG2); 36 | \draw[thick, red, dashed] (GC) ++(40:13pt)coordinate(GC1) arc (-320:-400:13pt) coordinate(GC2); 37 | \draw[thick, red, dashed] (CG) ++(40:13pt)coordinate(CG1) arc (-320:-520:13pt) coordinate(CG2); 38 | \draw[thick, red, dashed] (GT) ++(-20:13pt)coordinate(GT1) arc (-380:-580:13pt) coordinate(GT2); 39 | \draw[thick, red, dashed] (TG) ++(-140:13pt)coordinate(TG11) arc (-500:-440:13pt) coordinate(TG12); 40 | \draw[thick, red, dashed] (GC) ++(-550:13pt)coordinate(GC11) arc (-550:-540:13pt) coordinate(GC12); 41 | \draw[thick, red, dashed] (CA) ++(-660:13pt)coordinate(CA1) arc (-660:-590:13pt) coordinate(CA2); 42 | \draw[thick, red, dashed] (AA) ++(-490:13pt)coordinate(AA1) arc (-490:-590:13pt) coordinate(AA2); 43 | \draw[thick, red, dashed] (AT) ++(-490:13pt)coordinate(AT11) arc (-490:-590:13pt) coordinate(AT12); 44 | 45 | \draw[thick, red, dashed, rounded corners=3mm] (AT2) --(TG1); 46 | \draw[thick, red, dashed, rounded corners=3mm] (TG2) --(GG1); 47 | \draw[thick, red, dashed, rounded corners=3mm] (GG2) --(GC1); 48 | \draw[thick, red, dashed, rounded corners=3mm] (GC2) --(CG1); 49 | \draw[thick, red, dashed, rounded corners=3mm] (CG2) --(GT1); 50 | \draw[thick, red, dashed, rounded corners=3mm] (GT2) --(TG11); 51 | \draw[thick, red, dashed, rounded corners=3mm] (TG12) --(GC11); 52 | \draw[thick, red, dashed, rounded corners=3mm] (GC12) --(CA1); 53 | \draw[thick, red, dashed, rounded corners=3mm] (CA2) --(AA1); 54 | \draw[thick, red, dashed, rounded corners=3mm] (AA2) --(AT11); 55 | \end{tikzpicture} 56 | \end{document} 57 | -------------------------------------------------------------------------------- /git dataflow/README.md: -------------------------------------------------------------------------------- 1 | # git dataflow 2 | 3 | ## Notes 4 | 5 | An overview of all the possible flows of data within a single git repository. Features a novel type of decorated closed loop, dubbed a *portal*. 6 | 7 | ## Output 8 | 9 | ![GitDataflow](https://www.dropbox.com/s/e3opwglvzheta2x/git_dataflow.png?raw=1) 10 | 11 | ## Source 12 | 13 | *TBA* 14 | -------------------------------------------------------------------------------- /git dataflow/git_dataflow.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{decorations.pathmorphing} 5 | 6 | \definecolor{bluport}{HTML}{21ADFD} 7 | \definecolor{orgport}{HTML}{E37322} 8 | \definecolor{pplport}{HTML}{4F21E9} 9 | \definecolor{redport}{HTML}{701315} 10 | 11 | \begin{document} 12 | \begin{tikzpicture} 13 | 14 | \fill[pplport!15] (0, 0) ellipse (0.25 and 3); 15 | \fill[redport!15] (2.75, -3) rectangle (3.25, 3); 16 | \fill[bluport!15] (6, 0) ellipse (0.25 and 3); 17 | \fill[orgport!15] (9, 0) ellipse (0.25 and 3); 18 | 19 | \draw[thick, pplport] (0, 0) ellipse (0.25 and 3); 20 | \draw[ultra thick, pplport, decorate, decoration={snake, segment length=1mm, amplitude=0.3mm}] (0, 0) ellipse (0.23 and 3.05); 21 | \node[text height=1em, text depth=1em, pplport] (1) at (0, -3.5) {\emph{stash}}; 22 | 23 | \draw[ultra thick, redport] (2.75, -3) rectangle (3.25, 3); 24 | \node[text height=1em, text depth=1em, redport] (2) at (3, -3.5) {\emph{working directory}}; 25 | 26 | \draw[thick, orgport] (9, 0) ellipse (0.25 and 3); 27 | \draw[ultra thick, orgport, decorate, decoration={snake, segment length=1mm, amplitude=0.3mm}] (9, 0) ellipse (0.23 and 3.05); 28 | \node[text height=1em, text depth=1em, orgport] (4) at (9, -3.5) {\emph{repository}}; 29 | 30 | \draw[-stealth, very thick] (6, 2) -- node[above] {\tt\footnotesize git commit} (9, 2); 31 | \draw[-stealth, very thick] (9, 1) -- node[above] {\tt\footnotesize git checkout} (6, 1); 32 | \draw[-stealth, very thick] (9, 0) -- node[above] {\tt\footnotesize git reset} (6, 0); 33 | \draw[very thick] (6, -2) -- node[above] {\tt\scriptsize git diff -{}-staged} (9, -2); 34 | \draw[very thick] (3, -2.5) -- node[above, pos=0.75] {\tt\scriptsize git diff HEAD} (9, -2.5); 35 | \draw[-stealth, very thick] (9, -0.5) -- node[above, pos=0.25] {\tt\footnotesize git rebase} (3, -0.5); 36 | \draw[-stealth, very thick] (9, -1) -- node[above, pos=0.25] {\tt\footnotesize git merge} (3, -1); 37 | 38 | % draw the blue portal here for the portal effect 39 | \draw[thick, bluport] (6, 0) ellipse (0.25 and 3); 40 | \draw[ultra thick, bluport, decorate, decoration={snake, segment length=1mm, amplitude=0.3mm}] (6, 0) ellipse (0.23 and 3.05); 41 | \node[text height=1em, text depth=1em, bluport] (3) at (6, -3.5) {\emph{index}}; 42 | 43 | % Redraw some lines for piercing effect through blu port 44 | \draw[-stealth, very thick] (6, -0.5) -- (3, -0.5); 45 | \draw[-stealth, very thick] (6, -1) -- (3, -1); 46 | \draw[very thick] (3, -2.5) -- (6, -2.5); 47 | 48 | \draw[-stealth, very thick] (3, 2.5) -- node[above] {\tt\footnotesize git add/rm} (6, 2.5); 49 | \draw[-stealth, very thick] (3, 1.5) -- node[above] {\tt\footnotesize git stash save} (0, 1.5); 50 | \draw[-stealth, very thick] (6, 1) -- node[above] {\tt\footnotesize git checkout} (3, 1); 51 | \draw[-stealth, very thick] (0, 0.5) -- node[above] {\tt\footnotesize git stash pop} (3, 0.5); 52 | \draw[-stealth, very thick] (0, -0.5) -- node[above] {\tt\footnotesize git stash apply} (3, -0.5); 53 | \draw[very thick] (3, -1.5) -- node[above] {\tt\footnotesize git diff} (6, -1.5); 54 | \end{tikzpicture} 55 | \end{document} 56 | -------------------------------------------------------------------------------- /git workflow/README.md: -------------------------------------------------------------------------------- 1 | # git workflow 2 | 3 | ## Notes 4 | 5 | An overview of the most common workflows within a git repository and between repositories. Features a novel type of decorated closed loop, dubbed a *portal*. 6 | 7 | ## Output 8 | 9 | ![GitWorkflow](https://www.dropbox.com/s/fty7cahna4m8v2t/git_workflow.png?raw=1) 10 | 11 | ## Source 12 | 13 | *TBA* 14 | -------------------------------------------------------------------------------- /git workflow/git_workflow.tex: -------------------------------------------------------------------------------- 1 | \documentclass[crop, tikz]{standalone} 2 | \usepackage{tikz} 3 | 4 | \usetikzlibrary{decorations.pathmorphing} 5 | 6 | \definecolor{bluport}{HTML}{21ADFD} 7 | \definecolor{orgport}{HTML}{E37322} 8 | \definecolor{pplport}{HTML}{4F21E9} 9 | \definecolor{redport}{HTML}{701315} 10 | 11 | \begin{document} 12 | \begin{tikzpicture} 13 | \draw[thick, bluport] (0, 0) ellipse (2 and 1); 14 | \draw[ultra thick, bluport, decorate, decoration={snake, segment length=1mm, amplitude=0.3mm}] (0, 0) ellipse (2 and 1); 15 | \node[text height=1em, text depth=1em] (1) at (0, 1.5) {\tt git init}; 16 | \node[text height=1em, text depth=1em, align=center, bluport] (1) at (0, -0.25) {\tt ./git \\ repository}; 17 | 18 | \draw[thick, orgport] (6, 0) ellipse (2 and 1); 19 | \draw[ultra thick, orgport, decorate, decoration={snake, segment length=1mm, amplitude=0.3mm}] (6, 0) ellipse (2 and 1); 20 | \node[text height=1em, text depth=1em] (1) at (6, 1.5) {\tt git clone}; 21 | \node[text height=1em, text depth=1em, align=center, orgport] (1) at (6, -0.25) {\tt ./git \\ repository}; 22 | 23 | \draw[ultra thick, redport] (-1.75, -2) rectangle (1.75, -3.5); 24 | \node[text height=1em, text depth=1em, align=center, redport] (1) at (0, -3.25) {working directory \\ \& index of user 1}; 25 | 26 | \draw[ultra thick, pplport] (4.25, -2) rectangle (7.75, -3.5); 27 | \node[text height=1em, text depth=1em, align=center, pplport] (1) at (6, -3.25) {working directory \\ \& index of user 2}; 28 | 29 | \draw[very thick, stealth-stealth] (1.5, 0) -- node[above] {\tt git pull} node[below] {\tt git push} (4.5, 0); 30 | 31 | \draw[very thick, -stealth] (-0.2, -0.5) -- node[left] {\tt git pull} (-0.2, -2.4); 32 | \draw[very thick, -stealth] (0.2, -2.4) -- node[right] {\tt git commit} (0.2, -0.5); 33 | 34 | \draw[very thick, -stealth] (5.8, -0.5) -- node[left] {\tt git pull} (5.8, -2.4); 35 | \draw[very thick, -stealth] (6.2, -2.4) -- node[right] {\tt git commit} (6.2, -0.5); 36 | \end{tikzpicture} 37 | \end{document} 38 | -------------------------------------------------------------------------------- /muxstep pipeline/README.md: -------------------------------------------------------------------------------- 1 | # muxstep pipeline 2 | 3 | ## Notes 4 | 5 | The full training and testing pipeline of the [muxstep](https://github.com/PetarV-/muxstep) library. Probably the most complex Ti*k*Z figure I have created thus far; lots of fine-tuned positioning combined with scoping and decorations. 6 | 7 | ## Output 8 | 9 | ![MuxstepPipeline](https://www.dropbox.com/s/q9nufl2wd9sw4y5/muxstep_pipeline.png?raw=1) 10 | 11 | ## Source 12 | 13 | [muxstep: an open-source C++ multiplex HMM library for making inferences on multiple data types](http://bioinformatics.oxfordjournals.org/content/early/2016/04/13/bioinformatics.btw196), Bioinformatics -------------------------------------------------------------------------------- /À trous convolutions/README.md: -------------------------------------------------------------------------------- 1 | # À trous convolutions 2 | 3 | ## Notes 4 | 5 | A diagram representing a deep convolutional neural network with 1x3 à trous convolutions (with exponentially increasing dilation factors), illustrating its ability to capture long-range temporal dependencies without resorting to recurrent connections. 6 | 7 | ## Output 8 | 9 | ![ATrousConv](https://www.dropbox.com/s/q6i4ndwr4gnnlhz/a_trous_convolutions.png?raw=1) 10 | 11 | ## Source 12 | 13 | [A trip down long short-term memory lane](http://www.cl.cam.ac.uk/~pv273/slides/LSTMslides.pdf), *University of Cambridge Research Students Lecture Series* 14 | --------------------------------------------------------------------------------