Python 52.4%
TeX 47.6%
1% ============================================================================2% TikZ: Robust tabular neural network architecture3% ============================================================================4\begin{tikzpicture}[5 font=\small,6 >=Latex,7 node distance=6mm and 6mm,8 box/.style={rounded corners=2pt, draw=black!55, align=center,9 minimum height=8mm, inner sep=3pt, text width=24mm},10 cat/.style={box, fill=NavyBlue!8},11 num/.style={box, fill=OliveGreen!10, text width=30mm},12 emb/.style={box, fill=BurntOrange!14, text width=22mm},13 op/.style={box, fill=black!5},14 spine/.style={box, fill=black!6, text width=52mm},15 res/.style={box, fill=Plum!10, text width=52mm, minimum height=11mm},16 outb/.style={box, fill=NavyBlue!16, text width=34mm, font=\bfseries},17 detail/.style={rounded corners=2pt, draw=black!40, dashed, fill=Plum!5,18 align=left, text width=40mm, inner sep=4pt, font=\footnotesize},19 ar/.style={->, thick, black!65}20]2122% ---- inputs ----23\node[cat] (city) {City index\\{\footnotesize (195 cats)}};24\node[cat, right=of city] (type) {Type index};25\node[cat, right=of type] (src) {Source index};26\node[num, right=10mm of src] (numin) {Numeric features\\{\footnotesize $\approx$45: area, lot, beds,\\baths, age, amenities,\\rooms, GPT specs}};2728% ---- embeddings / bn ----29\node[emb, below=of city] (ecity) {Embedding\\{\footnotesize dim 29}};30\node[emb, below=of type] (etype) {Embedding\\{\footnotesize dim 4}};31\node[emb, below=of src] (esrc) {Embedding\\{\footnotesize dim 2}};32\node[op, below=of numin, text width=30mm] (bn) {BatchNorm\\{\footnotesize + missingness flags}};3334\draw[ar] (city)--(ecity); \draw[ar] (type)--(etype);35\draw[ar] (src)--(esrc); \draw[ar] (numin)--(bn);3637% ---- concat ----38\node[spine, below=12mm of etype.south, xshift=8mm] (concat)39 {Concatenate \;$\rightarrow$\; $\mathbb{R}^{\,\text{emb}+\text{num}}$};40\draw[ar] (ecity) |- (concat.west);41\draw[ar] (etype) -- (concat);42\draw[ar] (esrc) -- (concat);43\draw[ar] (bn) -| (concat.east);4445% ---- projection ----46\node[spine, below=of concat] (proj) {Linear $\rightarrow$ 256\;\; (trunk)};47\draw[ar] (concat)--(proj);4849% ---- residual blocks ----50\node[res, below=of proj] (resb)51 {Residual block \;$\times\,3$\\{\footnotesize BN $\to$ GELU $\to$ Lin$_{512}$ $\to$ Dropout $\to$ Lin$_{256}$ \;$\oplus$\; skip}};52\draw[ar] (proj)--(resb);5354% ---- head ----55\node[spine, below=of resb] (head)56 {Head:\; BatchNorm $\to$ GELU $\to$ Linear$_{1}$};57\draw[ar] (resb)--(head);5859% ---- output ----60\node[outb, below=of head] (out) {$\widehat{\ln(\text{Price})}$};61\draw[ar] (head)--(out);6263% ---- residual detail callout ----64\node[detail, right=10mm of resb] (dtl)65 {\textbf{Res block:} $x \mapsto x + f(x)$\\66 $f=$ Lin$_{256}\!\circ$Drop$\circ$Lin$_{512}\!\circ$GELU$\circ$BN};67\draw[->, dashed, black!45] (resb.east)--(dtl.west);6869% ---- training / ensemble annotation ----70\node[detail, right=10mm of head, text width=42mm, fill=OliveGreen!6, draw=black!40] (train)71 {\textbf{Training (robust):}\\72 Huber loss $\cdot$ AdamW $\cdot$ cosine LR\\73 grad-clip 5 $\cdot$ dropout $\cdot$ early stop};7475% ---- ensemble + blend ----76\node[op, below=8mm of out, text width=64mm, fill=NavyBlue!7] (ens)77 {Ensemble of 3 seeds (average) \;$\Rightarrow$\; blend 50/50 with gradient boosting};78\draw[ar] (out)--(ens);7980\end{tikzpicture}81