<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hussein Mahdi</title>
    <description>The latest articles on DEV Community by Hussein Mahdi (@_hm).</description>
    <link>https://dev.to/_hm</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg</url>
      <title>DEV Community: Hussein Mahdi</title>
      <link>https://dev.to/_hm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_hm"/>
    <language>en</language>
    <item>
      <title>this loses money when ___" is brilliant.</title>
      <dc:creator>Hussein Mahdi</dc:creator>
      <pubDate>Wed, 07 Oct 2026 23:18:09 +0000</pubDate>
      <link>https://dev.to/_hm/-9bh</link>
      <guid>https://dev.to/_hm/-9bh</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/infoinlet1/a-junior-asked-me-how-i-knew-the-code-was-wrong-i-couldnt-answer-him-1m1i" class="crayons-story__hidden-navigation-link"&gt;A junior asked me how I knew the code was wrong. I couldn't answer him.&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
      &lt;a href="https://dev.to/infoinlet1/a-junior-asked-me-how-i-knew-the-code-was-wrong-i-couldnt-answer-him-1m1i" class="crayons-article__context-note crayons-article__context-note__feed"&gt;&lt;p&gt;Highlights intuition vs explicit rules&lt;/p&gt;

&lt;/a&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/infoinlet1" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3941862%2Fcec34100-b85a-4c9e-8061-55c585109946.jpeg" alt="infoinlet1 profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/infoinlet1" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Info Inlet
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Info Inlet
                
                
              
              &lt;div id="story-author-preview-content-4790328" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/infoinlet1" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3941862%2Fcec34100-b85a-4c9e-8061-55c585109946.jpeg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Info Inlet&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/infoinlet1/a-junior-asked-me-how-i-knew-the-code-was-wrong-i-couldnt-answer-him-1m1i" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Oct 3&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/infoinlet1/a-junior-asked-me-how-i-knew-the-code-was-wrong-i-couldnt-answer-him-1m1i" id="article-link-4790328"&gt;
          A junior asked me how I knew the code was wrong. I couldn't answer him.
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag crayons-tag--filled  " href="/t/discuss"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;discuss&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/career"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;career&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/infoinlet1/a-junior-asked-me-how-i-knew-the-code-was-wrong-i-couldnt-answer-him-1m1i" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;30&lt;span class="hidden s:inline"&gt;&amp;nbsp;reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/infoinlet1/a-junior-asked-me-how-i-knew-the-code-was-wrong-i-couldnt-answer-him-1m1i#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              18&lt;span class="hidden s:inline"&gt;&amp;nbsp;comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            7 min read
          &lt;/small&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>beginners</category>
      <category>career</category>
      <category>debugging</category>
      <category>mentorship</category>
    </item>
    <item>
      <title>New code is upload of new model 🚀🥇</title>
      <dc:creator>Hussein Mahdi</dc:creator>
      <pubDate>Thu, 17 Sep 2026 23:12:34 +0000</pubDate>
      <link>https://dev.to/_hm/new-code-is-upload-of-new-model-3g8o</link>
      <guid>https://dev.to/_hm/new-code-is-upload-of-new-model-3g8o</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/_hm/predicting-drug-drug-interactions-with-hypergraphs-on-two-cpu-cores-212c" class="crayons-story__hidden-navigation-link"&gt;Predicting Drug-Drug Interactions with Hypergraphs — on Two CPU Cores&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/_hm" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" alt="_hm profile" class="crayons-avatar__image" width="700" height="700"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/_hm" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Hussein Mahdi
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Hussein Mahdi
                
                
              
              &lt;div id="story-author-preview-content-4640877" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/_hm" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" class="crayons-avatar__image" alt="" width="700" height="700"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Hussein Mahdi&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/_hm/predicting-drug-drug-interactions-with-hypergraphs-on-two-cpu-cores-212c" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Sep 13&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/_hm/predicting-drug-drug-interactions-with-hypergraphs-on-two-cpu-cores-212c" id="article-link-4640877"&gt;
          Predicting Drug-Drug Interactions with Hypergraphs — on Two CPU Cores
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/productivity"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;productivity&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/architecture"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;architecture&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/machinelearning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;machinelearning&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/_hm/predicting-drug-drug-interactions-with-hypergraphs-on-two-cpu-cores-212c#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            5 min read
          &lt;/small&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Predicting Drug-Drug Interactions with Hypergraphs — on Two CPU Cores</title>
      <dc:creator>Hussein Mahdi</dc:creator>
      <pubDate>Sun, 13 Sep 2026 06:04:00 +0000</pubDate>
      <link>https://dev.to/_hm/predicting-drug-drug-interactions-with-hypergraphs-on-two-cpu-cores-212c</link>
      <guid>https://dev.to/_hm/predicting-drug-drug-interactions-with-hypergraphs-on-two-cpu-cores-212c</guid>
      <description>&lt;p&gt;When a patient takes several medications at once, two of them can interact in ways that cause real harm. DrugBank catalogues 86 distinct mechanisms for how this happens — one drug slowing another's metabolism, increasing its toxicity, blunting its effect, and so on. Screening every pair by hand does not scale.&lt;/p&gt;

&lt;p&gt;Most machine learning approaches to this problem split it in two: one model decides &lt;em&gt;whether&lt;/em&gt; two drugs interact, a completely separate one decides &lt;em&gt;how&lt;/em&gt;. That split is convenient for benchmarking and awkward for anything practical.&lt;/p&gt;

&lt;p&gt;We built &lt;strong&gt;H²GNN&lt;/strong&gt; to do both in one hierarchy, using nothing but SMILES strings as input. The code is now public, and the whole thing runs on two CPU cores.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Code:&lt;/strong&gt; &lt;a href="https://github.com/Hu8MA/HHGNN" rel="noopener noreferrer"&gt;github.com/Hu8MA/HHGNN&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Paper:&lt;/strong&gt; &lt;a href="https://doi.org/10.1109/ECAI69016.2026.11613729" rel="noopener noreferrer"&gt;ECAI 2026, IEEE Xplore&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why hypergraphs
&lt;/h2&gt;

&lt;p&gt;In an ordinary graph, an edge joins exactly two nodes. That is a poor fit for a lot of chemistry. A molecular substructure is not a relationship between two drugs — it is something that dozens of drugs share simultaneously. An interaction mechanism is not a property of one pair; it is a category that hundreds of pairs fall into.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;hyperedge&lt;/strong&gt; can connect any number of nodes at once, which lines up with both of those facts. H²GNN uses two hypergraphs stacked on top of each other.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 1: the chemical hypergraph
&lt;/h3&gt;

&lt;p&gt;Take a SMILES string and slide a window of size &lt;em&gt;k&lt;/em&gt; across it. Each window is a substring — a rough proxy for a local chemical arrangement. Every distinct substring becomes a &lt;strong&gt;node&lt;/strong&gt;, and every drug becomes a &lt;strong&gt;hyperedge&lt;/strong&gt; connecting the substrings it contains.&lt;/p&gt;

&lt;p&gt;At &lt;code&gt;k = 9&lt;/code&gt;, that gives 29,462 substructure nodes, 1,709 drug hyperedges, and 96,656 connections between them.&lt;/p&gt;

&lt;p&gt;A single hypergraph attention layer runs over this structure. Attention flows at the hyperedge level, then the node level, and the result is a 128-dimensional embedding per drug learned end to end from raw SMILES. An MLP decoder takes the embeddings of two drugs and predicts whether they interact.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result: 98.46% ROC-AUC, 93.20% accuracy.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For comparison, a Random Forest on 4,096-dimensional Morgan fingerprints gets 88% ROC-AUC. A two-layer GCN gets 95%.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 2: the interaction-type hypergraph
&lt;/h3&gt;

&lt;p&gt;Here is the part I find most interesting, and it is a small conceptual shift with a large effect.&lt;/p&gt;

&lt;p&gt;The obvious way to classify interaction mechanisms is to attach a label to each drug pair and train a classifier. We did something else: &lt;strong&gt;each of the 86 interaction types becomes a hyperedge&lt;/strong&gt;, connecting every drug that participates in that type. Drugs are the nodes. The type stops being a label on the data and becomes an object in the graph with its own learned representation.&lt;/p&gt;

&lt;p&gt;This hypergraph is tiny — 1,709 drug nodes, 86 type hyperedges, 13,486 connections. Hyperedge sizes range wildly: type 42 touches 5 drugs, type 49 touches 1,308.&lt;/p&gt;

&lt;p&gt;Drug nodes are initialized with the embeddings transferred from Stage 1, not randomly. Attention then flows hyperedge → node → hyperedge, so the type hyperedges — which are the prediction target — end up holding the final aggregated representation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result: 85.73% Top-1 and 98.11% Top-3 accuracy across 86 classes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That twelve-point gap between Top-1 and Top-3 is itself useful. The correct mechanism is almost always among the top three even when it is not ranked first, which is exactly what you want if a clinician is reading the output rather than a downstream script.&lt;/p&gt;

&lt;h2&gt;
  
  
  The ablations that mattered
&lt;/h2&gt;

&lt;p&gt;Two experiments did more to convince me the design was right than any headline number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Attention direction.&lt;/strong&gt; Stage 2's drug nodes start out well-informed, carrying transferred chemical knowledge, while the type hyperedges start from one-hot vectors. So it seemed plausible that flowing attention from the informed side — node → hyperedge → node — would work better.&lt;/p&gt;

&lt;p&gt;It does not. It falls apart:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Configuration&lt;/th&gt;
&lt;th&gt;Top-1 Acc.&lt;/th&gt;
&lt;th&gt;PR-AUC&lt;/th&gt;
&lt;th&gt;Macro F1&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;hyperedge → node → hyperedge&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;85.73%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;87.24&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;81&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;node → hyperedge → node&lt;/td&gt;
&lt;td&gt;67.42%&lt;/td&gt;
&lt;td&gt;63.54&lt;/td&gt;
&lt;td&gt;48&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Aligning the attention flow with the prediction target beats starting from the richer initialization, and the rare classes are the first thing you lose. The type hyperedge has to be where aggregation ends.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Embedding transfer.&lt;/strong&gt; Replace the transferred Stage 1 embeddings with an all-ones vector and hold everything else fixed:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Initialization&lt;/th&gt;
&lt;th&gt;Top-1 Acc.&lt;/th&gt;
&lt;th&gt;PR-AUC&lt;/th&gt;
&lt;th&gt;Weighted F1&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Stage 1 embeddings&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;85.73%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;87.24&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;86&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;All-ones vector&lt;/td&gt;
&lt;td&gt;82.52%&lt;/td&gt;
&lt;td&gt;85.70&lt;/td&gt;
&lt;td&gt;82&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A 3.21-point drop. The hierarchy earns its keep.&lt;/p&gt;

&lt;p&gt;There is also a third result I did not expect. During cleaning, 406 drug pairs turned out to carry more than one interaction type; we kept the first and set the others aside. The model never saw those secondary labels for those pairs. It surfaced &lt;strong&gt;94.7% of them&lt;/strong&gt; within its Top-3 predictions anyway — meaning the hypergraph learned something about multi-mechanistic pharmacology rather than memorizing one label per pair.&lt;/p&gt;

&lt;h2&gt;
  
  
  The efficiency story
&lt;/h2&gt;

&lt;p&gt;This is the part that surprised me most, and it is worth spelling out for anyone who assumes graph learning implies a GPU budget.&lt;/p&gt;

&lt;p&gt;Everything above was trained and evaluated on &lt;strong&gt;Google Colab's free tier&lt;/strong&gt;: two vCPUs, no GPU. We chose it deliberately, for two reasons. It gives every run an identical environment, and its resource ceiling is close to the hardware actually available in a hospital pharmacy.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Training time&lt;/th&gt;
&lt;th&gt;Hardware&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Interaction-Type HGNN (ours, 1 layer)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;18.6 min&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;CPU, 2 cores&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GCN (2 layers)&lt;/td&gt;
&lt;td&gt;75.6 min&lt;/td&gt;
&lt;td&gt;GPU (T4)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GraphSAGE (2 layers)&lt;/td&gt;
&lt;td&gt;148.5 min&lt;/td&gt;
&lt;td&gt;GPU (T4)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XGBoost&lt;/td&gt;
&lt;td&gt;225.6 min&lt;/td&gt;
&lt;td&gt;CPU&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Four to twelve times faster — and it still beat GraphSAGE, the strongest baseline, by 4.8 points of Top-1 accuracy and 22 points of macro F1.&lt;/p&gt;

&lt;p&gt;The baselines had advantages we did not give ourselves: precomputed Morgan fingerprints as input features, and inverse-frequency class weighting during training to stay stable under the severe class imbalance. Single-layer variants of the GCN and GraphSAGE did not converge at all; both had to be deepened and moved to GPU for the comparison to run. A Graph Attention Network never converged and was dropped.&lt;/p&gt;

&lt;p&gt;Peak RAM increase during training: 0.29 GB.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is in the repo
&lt;/h2&gt;

&lt;p&gt;The dataset is DrugBank — 1,709 drugs, 191,877 unique interaction pairs, 86 types, built by merging two benchmark sources so that every drug has a SMILES string.&lt;/p&gt;

&lt;p&gt;Everything needed to reproduce the numbers is there:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Colab notebooks for all 48 experiments, with inline outputs&lt;/li&gt;
&lt;li&gt;Pre-computed k-mer files for k = 3, 6, 9, 12&lt;/li&gt;
&lt;li&gt;Hypergraph structure files and index maps&lt;/li&gt;
&lt;li&gt;The exact seeded train/validation/test partitions, verified for zero leakage&lt;/li&gt;
&lt;li&gt;Baseline notebooks (GCN, GAT, GraphSAGE, XGBoost, Random Forest)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open a notebook, point it at the data files, run all cells. Free tier is enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does not do
&lt;/h2&gt;

&lt;p&gt;Being honest about the boundaries, since these are the interesting problems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;SMILES only.&lt;/strong&gt; No protein-target, pathway, or side-effect information. Chemical structure carries the entire representation. Additional modalities could enter as further hyperedge families.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No severity prediction.&lt;/strong&gt; The model reports the mechanism and its likelihood, not how bad the reaction will be — which is often the thing that actually drives a clinical decision.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1,709 drugs.&lt;/strong&gt; DrugBank now holds over 4,000, so plenty of approved drugs cannot yet be screened.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pairs only.&lt;/strong&gt; Real polypharmacy is not pairwise. The hypergraph formulation could express simultaneous multi-drug combinations directly; we just have not done it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That last one bothers me the most, because the machinery is already there. A hyperedge over three co-administered drugs is a perfectly natural object in this framework.&lt;/p&gt;

&lt;p&gt;If any of these interest you, contributions are welcome — there is a contributing guide in the repo, and the issue tracker is open.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt; &lt;a href="https://github.com/Hu8MA/HHGNN" rel="noopener noreferrer"&gt;github.com/Hu8MA/HHGNN&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Paper:&lt;/strong&gt; &lt;a href="https://doi.org/10.1109/ECAI69016.2026.11613729" rel="noopener noreferrer"&gt;Hierarchical Hypergraph Neural Networks for Multi-Type Drug–Drug Interaction Prediction&lt;/a&gt;, ECAI 2026, IEEE Xplore&lt;/p&gt;

&lt;p&gt;Thanks to the DrugBank Foundation for access to the curated drug data that made the dataset complete.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>architecture</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Who wants to know what the library is in the context of artificial intelligence development?</title>
      <dc:creator>Hussein Mahdi</dc:creator>
      <pubDate>Sun, 12 Jul 2026 22:14:04 +0000</pubDate>
      <link>https://dev.to/_hm/who-wants-to-know-what-the-library-is-in-the-context-of-artificial-intelligence-development-3l9f</link>
      <guid>https://dev.to/_hm/who-wants-to-know-what-the-library-is-in-the-context-of-artificial-intelligence-development-3l9f</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/_hm/numpy-vs-list-simd-vector-processing-with-concrete-mathematical-example-1m16" class="crayons-story__hidden-navigation-link"&gt;NumPy vs List: SIMD Vector Processing with Concrete Mathematical Example&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/_hm" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" alt="_hm profile" class="crayons-avatar__image" width="700" height="700"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/_hm" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Hussein Mahdi
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Hussein Mahdi
                
              
              &lt;div id="story-author-preview-content-3241341" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/_hm" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" class="crayons-avatar__image" alt="" width="700" height="700"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Hussein Mahdi&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/_hm/numpy-vs-list-simd-vector-processing-with-concrete-mathematical-example-1m16" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Feb 9&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/_hm/numpy-vs-list-simd-vector-processing-with-concrete-mathematical-example-1m16" id="article-link-3241341"&gt;
          NumPy vs List: SIMD Vector Processing with Concrete Mathematical Example
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/programming"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;programming&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/tutorial"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;tutorial&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/_hm/numpy-vs-list-simd-vector-processing-with-concrete-mathematical-example-1m16#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>performance</category>
      <category>python</category>
    </item>
    <item>
      <title>For anyone interested in learning about the history, concepts, and philosophy of graph neural networks, please refer to this article.</title>
      <dc:creator>Hussein Mahdi</dc:creator>
      <pubDate>Thu, 09 Jul 2026 21:32:09 +0000</pubDate>
      <link>https://dev.to/_hm/for-anyone-interested-in-learning-about-the-history-concepts-and-philosophy-of-graph-neural-299l</link>
      <guid>https://dev.to/_hm/for-anyone-interested-in-learning-about-the-history-concepts-and-philosophy-of-graph-neural-299l</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/_hm/graph-neural-networks-theoretical-foundations-and-core-mechanisms-a-review-of-the-groundbreaking-1llp" class="crayons-story__hidden-navigation-link"&gt;Revisiting the 2009 GNN Paper: Foundations (Part 1)&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/_hm" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" alt="_hm profile" class="crayons-avatar__image" width="700" height="700"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/_hm" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Hussein Mahdi
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Hussein Mahdi
                
              
              &lt;div id="story-author-preview-content-2258688" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/_hm" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" class="crayons-avatar__image" alt="" width="700" height="700"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Hussein Mahdi&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/_hm/graph-neural-networks-theoretical-foundations-and-core-mechanisms-a-review-of-the-groundbreaking-1llp" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Feb 4 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/_hm/graph-neural-networks-theoretical-foundations-and-core-mechanisms-a-review-of-the-groundbreaking-1llp" id="article-link-2258688"&gt;
          Revisiting the 2009 GNN Paper: Foundations (Part 1)
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/machinelearning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;machinelearning&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/tutorial"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;tutorial&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/programming"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;programming&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/_hm/graph-neural-networks-theoretical-foundations-and-core-mechanisms-a-review-of-the-groundbreaking-1llp#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            9 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>ai</category>
      <category>computerscience</category>
      <category>deeplearning</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>The first article in the Panda Library Mastery series</title>
      <dc:creator>Hussein Mahdi</dc:creator>
      <pubDate>Tue, 07 Jul 2026 22:08:27 +0000</pubDate>
      <link>https://dev.to/_hm/the-first-article-in-the-panda-library-mastery-series-58oj</link>
      <guid>https://dev.to/_hm/the-first-article-in-the-panda-library-mastery-series-58oj</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/_hm/mastering-pandas-part-1-reading-sorting-displaying-data-48h0" class="crayons-story__hidden-navigation-link"&gt;Mastering Pandas — Part 1: Reading, Sorting &amp;amp; Displaying Data&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/_hm" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" alt="_hm profile" class="crayons-avatar__image" width="700" height="700"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/_hm" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Hussein Mahdi
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Hussein Mahdi
                
              
              &lt;div id="story-author-preview-content-3285907" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/_hm" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" class="crayons-avatar__image" alt="" width="700" height="700"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Hussein Mahdi&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/_hm/mastering-pandas-part-1-reading-sorting-displaying-data-48h0" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Feb 26&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/_hm/mastering-pandas-part-1-reading-sorting-displaying-data-48h0" id="article-link-3285907"&gt;
          Mastering Pandas — Part 1: Reading, Sorting &amp;amp; Displaying Data
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/tutorial"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;tutorial&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/python"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;python&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/programming"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;programming&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/_hm/mastering-pandas-part-1-reading-sorting-displaying-data-48h0#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            8 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>beginners</category>
      <category>datascience</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>The Leash That Makes AI Polite</title>
      <dc:creator>Hussein Mahdi</dc:creator>
      <pubDate>Tue, 09 Jun 2026 07:05:00 +0000</pubDate>
      <link>https://dev.to/_hm/the-leash-that-makes-ai-polite-3g9n</link>
      <guid>https://dev.to/_hm/the-leash-that-makes-ai-polite-3g9n</guid>
      <description>&lt;h2&gt;
  
  
  How a 1951 statistics formula quietly keeps your chatbot from going feral
&lt;/h2&gt;

&lt;p&gt;Two ideas sit underneath every modern AI assistant you've ever used. One is a 70-year-old equation. The other is the training trick that turned a text-prediction engine into something you'd actually want to talk to. They're connected — and the connection is more interesting than either alone.&lt;/p&gt;

&lt;h3&gt;
  
  
  First: measuring surprise
&lt;/h3&gt;

&lt;p&gt;Start with &lt;strong&gt;Kullback–Leibler divergence&lt;/strong&gt;. The name is intimidating; the idea isn't. It measures how different two sets of expectations are.&lt;/p&gt;

&lt;p&gt;Picture a weather forecaster. Reality is: 70% sunny, 30% rain. But you wake up convinced it's a coin flip — 50/50 — and dress accordingly. KL divergence is the price you pay, on average, for believing the wrong thing. Get caught in the rain, get overdressed in the sun — small mismatches, small cost. If instead you believed it was &lt;em&gt;always&lt;/em&gt; sunny and walked into a downpour, the cost is enormous.&lt;/p&gt;

&lt;p&gt;That's the whole concept. Two numbers: how things actually are, and what you assumed. KL puts a single value on the gap.&lt;/p&gt;

&lt;p&gt;Three things to remember about it. It's zero only when your belief is perfect. It can climb toward infinity when you're badly wrong. And it's lopsided — being too optimistic and being too pessimistic don't cost the same. It isn't a tidy ruler; it's a penalty for surprise.&lt;/p&gt;

&lt;h3&gt;
  
  
  Then: teaching taste
&lt;/h3&gt;

&lt;p&gt;Now the second idea. A raw language model is a spectacularly good guesser of the next word, trained on a firehose of internet text. It is &lt;em&gt;not&lt;/em&gt; helpful, honest, or polite. It will cheerfully complete a sentence in whatever direction the statistics pull it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RLHF — Reinforcement Learning from Human Feedback&lt;/strong&gt; — fixes that. Show humans two answers to the same question, ask which is better, collect thousands of these judgments, and train a second model to predict human taste. Then nudge the language model to chase higher scores from that taste-model. That's how it learns to be useful instead of merely plausible.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where they meet
&lt;/h3&gt;

&lt;p&gt;Here's the catch. Let a model chase a reward with no restraint, and it cheats. It discovers that flattery scores well, that vague hedging is rarely wrong, that "Great question!" pleases the crowd. Left alone, it drifts into a sycophantic mush — gaming the score while forgetting how to talk.&lt;/p&gt;

&lt;p&gt;So engineers attach a leash. At every step they ask: how far has the model drifted from its original self? That distance is measured with &lt;strong&gt;KL divergence&lt;/strong&gt;. Drift a little, fine. Drift too far, and the penalty pulls it back.&lt;/p&gt;

&lt;p&gt;The polished, agreeable voice of your favorite chatbot is the product of exactly this tension: a reward pulling it toward what people like, and a 1951 formula tugging the other way, whispering &lt;em&gt;don't go feral.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>machinelearning</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Which is more important to a data scientist: NumPy or List 🎇? But should they also consider performance 🤔?

This article explains.

Read it; it will be helpful.</title>
      <dc:creator>Hussein Mahdi</dc:creator>
      <pubDate>Sun, 31 May 2026 22:45:56 +0000</pubDate>
      <link>https://dev.to/_hm/which-is-more-important-to-a-data-scientist-numpy-or-list-but-should-they-also-consider-3mid</link>
      <guid>https://dev.to/_hm/which-is-more-important-to-a-data-scientist-numpy-or-list-but-should-they-also-consider-3mid</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/_hm/numpy-vs-list-simd-vector-processing-with-concrete-mathematical-example-1m16" class="crayons-story__hidden-navigation-link"&gt;NumPy vs List: SIMD Vector Processing with Concrete Mathematical Example&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/_hm" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" alt="_hm profile" class="crayons-avatar__image" width="700" height="700"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/_hm" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Hussein Mahdi
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Hussein Mahdi
                
              
              &lt;div id="story-author-preview-content-3241341" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/_hm" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" class="crayons-avatar__image" alt="" width="700" height="700"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Hussein Mahdi&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/_hm/numpy-vs-list-simd-vector-processing-with-concrete-mathematical-example-1m16" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Feb 9&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/_hm/numpy-vs-list-simd-vector-processing-with-concrete-mathematical-example-1m16" id="article-link-3241341"&gt;
          NumPy vs List: SIMD Vector Processing with Concrete Mathematical Example
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/programming"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;programming&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/tutorial"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;tutorial&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/_hm/numpy-vs-list-simd-vector-processing-with-concrete-mathematical-example-1m16#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Hussein Mahdi</dc:creator>
      <pubDate>Sun, 31 May 2026 12:26:01 +0000</pubDate>
      <link>https://dev.to/_hm/-52el</link>
      <guid>https://dev.to/_hm/-52el</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/_hm/the-math-behind-neural-networks-explained-like-nobody-did-for-me-a58" class="crayons-story__hidden-navigation-link"&gt;The Math Behind Neural Networks — Explained Like Nobody Did for Me 🧨&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/_hm" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" alt="_hm profile" class="crayons-avatar__image" width="700" height="700"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/_hm" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Hussein Mahdi
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Hussein Mahdi
                
              
              &lt;div id="story-author-preview-content-3743801" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/_hm" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" class="crayons-avatar__image" alt="" width="700" height="700"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Hussein Mahdi&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/_hm/the-math-behind-neural-networks-explained-like-nobody-did-for-me-a58" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;May 24&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/_hm/the-math-behind-neural-networks-explained-like-nobody-did-for-me-a58" id="article-link-3743801"&gt;
          The Math Behind Neural Networks — Explained Like Nobody Did for Me 🧨
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/machinelearning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;machinelearning&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/datascience"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;datascience&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/deeplearning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;deeplearning&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/_hm/the-math-behind-neural-networks-explained-like-nobody-did-for-me-a58" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;6&lt;span class="hidden s:inline"&gt;&amp;nbsp;reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/_hm/the-math-behind-neural-networks-explained-like-nobody-did-for-me-a58#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            1 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>What will you think of when you read about a neural network!!? Mathematics? 🤔</title>
      <dc:creator>Hussein Mahdi</dc:creator>
      <pubDate>Tue, 26 May 2026 23:18:26 +0000</pubDate>
      <link>https://dev.to/_hm/-39k2</link>
      <guid>https://dev.to/_hm/-39k2</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/_hm/the-math-behind-neural-networks-explained-like-nobody-did-for-me-a58" class="crayons-story__hidden-navigation-link"&gt;The Math Behind Neural Networks — Explained Like Nobody Did for Me 🧨&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/_hm" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" alt="_hm profile" class="crayons-avatar__image" width="700" height="700"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/_hm" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Hussein Mahdi
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Hussein Mahdi
                
              
              &lt;div id="story-author-preview-content-3743801" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/_hm" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1277859%2Fba172896-c33b-474a-a6b0-68b14dc75819.jpg" class="crayons-avatar__image" alt="" width="700" height="700"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Hussein Mahdi&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/_hm/the-math-behind-neural-networks-explained-like-nobody-did-for-me-a58" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;May 24&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/_hm/the-math-behind-neural-networks-explained-like-nobody-did-for-me-a58" id="article-link-3743801"&gt;
          The Math Behind Neural Networks — Explained Like Nobody Did for Me 🧨
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/machinelearning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;machinelearning&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/datascience"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;datascience&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/deeplearning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;deeplearning&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/_hm/the-math-behind-neural-networks-explained-like-nobody-did-for-me-a58" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;6&lt;span class="hidden s:inline"&gt;&amp;nbsp;reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/_hm/the-math-behind-neural-networks-explained-like-nobody-did-for-me-a58#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            1 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>The Math Behind Neural Networks — Explained Like Nobody Did for Me 🧨</title>
      <dc:creator>Hussein Mahdi</dc:creator>
      <pubDate>Sun, 24 May 2026 23:09:41 +0000</pubDate>
      <link>https://dev.to/_hm/the-math-behind-neural-networks-explained-like-nobody-did-for-me-a58</link>
      <guid>https://dev.to/_hm/the-math-behind-neural-networks-explained-like-nobody-did-for-me-a58</guid>
      <description>&lt;p&gt;How does a neural network actually learn to be less wrong?&lt;/p&gt;

&lt;p&gt;Not the hand-wavy version. The real one. The one with the derivative, the chain rule, and the loss surface that nobody draws for you when you start.&lt;/p&gt;

&lt;p&gt;I got tired of tutorials that skip steps, so I wrote the series I wish I had when I began. No formula without explanation. No "as you can see." No magic.&lt;/p&gt;

&lt;p&gt;It is now live on GoPenAI — and I am sharing it here on dev.to for the first time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part 1 — Where the math actually begins&lt;/strong&gt;&lt;br&gt;
Slope → linear regression → error (MSE). One continuous idea, built from the ground up. We stop right at the moment the real question appears: now that we can measure how wrong the model is, how does it learn to be less wrong?&lt;br&gt;
👉 &lt;a href="https://blog.gopenai.com/the-math-behind-neural-networks-explained-like-nobody-did-for-me-cda519ef63e8" rel="noopener noreferrer"&gt;https://blog.gopenai.com/the-math-behind-neural-networks-explained-like-nobody-did-for-me-cda519ef63e8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part 2 — How the network actually learns&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The derivative — slope, but instantaneous&lt;/li&gt;
&lt;li&gt;Gradient descent — walking down the loss surface&lt;/li&gt;
&lt;li&gt;Multiple layers — how a single neuron becomes a network&lt;/li&gt;
&lt;li&gt;Backpropagation — the chain rule, finally demystified
👉 &lt;a href="https://blog.gopenai.com/the-math-behind-neural-networks-explained-like-nobody-did-for-me-7db69dc6f1bd" rel="noopener noreferrer"&gt;https://blog.gopenai.com/the-math-behind-neural-networks-explained-like-nobody-did-for-me-7db69dc6f1bd&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;What is the one concept in neural network math that confused you the most when you started? Drop it in the comments — it might become a future chapter.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>deeplearning</category>
    </item>
    <item>
      <title>Building QuizTest — A WPF Quiz Application for Educational Institutions</title>
      <dc:creator>Hussein Mahdi</dc:creator>
      <pubDate>Thu, 23 Apr 2026 08:13:00 +0000</pubDate>
      <link>https://dev.to/_hm/building-quiztest-a-wpf-quiz-application-for-educational-institutions-3nam</link>
      <guid>https://dev.to/_hm/building-quiztest-a-wpf-quiz-application-for-educational-institutions-3nam</guid>
      <description>&lt;h1&gt;
  
  
  Building QuizTest — A WPF Quiz Application for Educational Institutions
&lt;/h1&gt;

&lt;p&gt;I'm excited to share &lt;strong&gt;QuizTest&lt;/strong&gt;, a WPF desktop quiz application I built in C# and which is now actively used at Al-Mustaqbal University. What started as a small tool for a sports-college competition has grown into a flexible platform used by the College of Science's AI Department.&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hu8MA/QuizeTest" rel="noopener noreferrer"&gt;github.com/Hu8MA/QuizeTest&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem I Wanted to Solve
&lt;/h2&gt;

&lt;p&gt;Most quiz applications I came across fell into one of two categories: either they were heavy web-based platforms that required internet access and accounts, or they were rigid desktop tools where editing questions meant touching the source code. For classroom use and university events in Iraq, I needed something simpler. Instructors should be able to change questions on the fly without asking a developer, and the app should run offline on any Windows machine.&lt;/p&gt;

&lt;p&gt;That's how QuizTest was born.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;p&gt;The application is built on a deliberately minimal stack. It uses &lt;strong&gt;C#&lt;/strong&gt; with &lt;strong&gt;WPF&lt;/strong&gt; on &lt;strong&gt;.NET 6.0&lt;/strong&gt; for the desktop UI, and relies on &lt;strong&gt;ClosedXML&lt;/strong&gt; for reading the Excel-based question bank. That's essentially it. No database, no server, no cloud dependency.&lt;/p&gt;

&lt;h2&gt;
  
  
  From v1.0 to v2.0 — A Lesson in Simplification
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Version 1.0&lt;/strong&gt; was used in an inter-university competition hosted by the College of Sports at Al-Mustaqbal University, involving multiple Iraqi universities. It worked well, but it relied on Entity Framework and SQLite to store questions. Every time a professor wanted to update the question bank, someone had to edit the database or rebuild the project. It felt heavier than it needed to be.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Version 2.0&lt;/strong&gt; rethought the architecture. I removed the database entirely and replaced it with two simple files: &lt;code&gt;Questions.xlsx&lt;/code&gt; for the question bank and &lt;code&gt;Settings.txt&lt;/code&gt; for configuration. Any instructor can now open the Excel file, edit questions, save, and relaunch the app. No developer required. This version is currently in use by the Department of Artificial Intelligence.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the Question Bank Works
&lt;/h2&gt;

&lt;p&gt;Questions live in a plain spreadsheet with three columns: &lt;code&gt;Id&lt;/code&gt;, &lt;code&gt;Text&lt;/code&gt;, and &lt;code&gt;Answer&lt;/code&gt;. For example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Id&lt;/th&gt;
&lt;th&gt;Text&lt;/th&gt;
&lt;th&gt;Answer&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Machine learning requires labeled data.&lt;/td&gt;
&lt;td&gt;FALSE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Python is an interpreted language.&lt;/td&gt;
&lt;td&gt;TRUE&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The application loads the workbook at startup through &lt;code&gt;QuestionLoader.cs&lt;/code&gt;, which uses ClosedXML to parse the rows into a list of question objects. From there, a random subset is selected based on the configured question count, so every quiz session feels fresh even with the same bank.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Version 1.0 was used for the sports department events at Al-Mustaqbal University, while version 2.0 was used for the artificial intelligence department competition events at the same university in 2026.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Configurable Settings Without Recompiling
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;Settings.txt&lt;/code&gt; file keeps things refreshingly simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="py"&gt;QuestionCount&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;20&lt;/span&gt;
&lt;span class="py"&gt;TimePerQuestion&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;15&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;SettingsLoader.cs&lt;/code&gt; reads this file at launch and applies the values to the quiz engine. Want a 10-question quiz with 30 seconds per question? Change two numbers and save. This small design decision has made the tool genuinely usable by non-technical staff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Structure
&lt;/h2&gt;

&lt;p&gt;The codebase stays intentionally flat and readable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Quize/
├── Images/
├── ModelData.cs
├── QuestionLoader.cs
├── SettingsLoader.cs
├── MainWindow.xaml(.cs)
├── QuizWindow.xaml(.cs)
├── ResultWindow.xaml(.cs)
├── Questions.xlsx
└── Settings.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three windows handle the full user flow. &lt;code&gt;MainWindow&lt;/code&gt; is the landing screen, &lt;code&gt;QuizWindow&lt;/code&gt; runs the timed question-by-question experience with visual indicators, and &lt;code&gt;ResultWindow&lt;/code&gt; displays the final score.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;If you want to try it yourself, clone the repo and open &lt;code&gt;Quize.sln&lt;/code&gt; in Visual Studio. Install the ClosedXML NuGet package, then build and run. You'll need .NET 6.0 or later on a Windows machine. Swap in your own questions by editing &lt;code&gt;Questions.xlsx&lt;/code&gt;, and you're ready to go.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/Hu8MA/QuizeTest.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;I'd like to extend QuizTest with support for multiple-choice questions (the current version handles true/false), a richer result screen with per-question review, and possibly a simple question-editor UI for instructors who prefer not to work in Excel. I'm also considering a lightweight export feature so results can be saved as a report after each session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing Thoughts
&lt;/h2&gt;

&lt;p&gt;QuizTest is a reminder that sometimes the best upgrade is removing complexity rather than adding it. Dropping the database in v2.0 made the app smaller, faster, and dramatically easier for real users to maintain.&lt;/p&gt;

&lt;p&gt;If you find the project useful, have ideas for features, or want to contribute, the repository is open and MIT-licensed. Issues and pull requests are very welcome.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Repository:&lt;/strong&gt; &lt;a href="https://github.com/Hu8MA/QuizeTest" rel="noopener noreferrer"&gt;github.com/Hu8MA/QuizeTest&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading — I'd love to hear your thoughts in the comments.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>programming</category>
      <category>devops</category>
      <category>database</category>
    </item>
  </channel>
</rss>
