<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Carlos Gaitán on Medium]]></title>
        <description><![CDATA[Stories by Carlos Gaitán on Medium]]></description>
        <link>https://medium.com/@cgaitan?source=rss-30b6ca9dd167------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*H7HRwxcSkuypcJE7ANPgCA.jpeg</url>
            <title>Stories by Carlos Gaitán on Medium</title>
            <link>https://medium.com/@cgaitan?source=rss-30b6ca9dd167------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 11:56:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cgaitan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Genomic Language Model for Zero-Shot Prediction of Promoter Indel Effects]]></title>
            <link>https://cgaitan.medium.com/a-genomic-language-model-for-zero-shot-prediction-of-promoter-indel-effects-a9b6407ed52d?source=rss-30b6ca9dd167------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9b6407ed52d</guid>
            <category><![CDATA[language-modeling]]></category>
            <category><![CDATA[drug-discovery]]></category>
            <category><![CDATA[genomics]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Carlos Gaitán]]></dc:creator>
            <pubDate>Sun, 27 Jul 2025 00:03:39 GMT</pubDate>
            <atom:updated>2025-07-28T16:22:10.590Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*byW_tuyn1Bydg33F" /><figcaption>Photo by <a href="https://unsplash.com/@sangharsh_l?utm_source=medium&amp;utm_medium=referral">Sangharsh Lohakare</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I was curious about how Large Language Models are being applied to solve problems in biology and came across this <a href="https://openreview.net/forum?id=KffXkipDH3">paper</a> from the GenBio workshop at the 2025 <a href="https://icml.cc/">ICML</a> conference. I summarized my learnings and provided additional context based on my cursory understanding of genomics. My intention is to identify gaps in my own understanding, though I hope this can also be useful for others to understand a complex area that often requires experience in different disciplines, including computer science and biology. If you find something is not quite accurate, please leave a comment or send me a message, I’d really appreciate it!</p><h3>A very basic and probably oversimplified context</h3><p>Since the completion of the <a href="https://en.wikipedia.org/wiki/Human_Genome_Project">Human Genome Project</a> in 2003, we have the ability to sequence the genome of any given individual. The promise had always been that this ability would unlock insights that would enable the identification of mutations that lead to diseases like cancer and Alzheimer’s disease, and subsequently the development of better treatments that modulate such mutations and lead to healthier lives.</p><p>The main challenge, however, remains in understanding which mutations are causal of a given disease. Some single base pair mutations, also known as <a href="https://en.wikipedia.org/wiki/Single-nucleotide_polymorphism">single nucleotide variants</a> or SNVs, have been identified as genetic causes of certain diseases. For example, it is widely known that the risk of Alzheimer’s disease is significantly higher for carriers of E4 alleles of the <a href="https://en.wikipedia.org/wiki/Apolipoprotein_E">APOE gene</a>, which may result from a single mutation or SNP (<a href="https://www.snpedia.com/index.php?title=Rs429358">rs429358-C</a>).</p><p>However, it is believed that many diseases are caused by more complex mutations involving mutations that span multiple nucleotides. These mutations often result in either additional nucleotides (insertions) or missing nucleotides (deletions) in an individual’s genome and are collectively known as <a href="https://en.wikipedia.org/wiki/Indel">indels</a>. Accurately predicting the effect of indels remains an open challenge in computational biology and Artificial Intelligence.</p><h3>Applying Language Modeling to Genomics</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k2LsKhflaAVDgneMIuHB1A.png" /></figure><p>The authors trained a “genomic language model” using millions of DNA sequences from <a href="https://en.wikipedia.org/wiki/Promoter_(genetics)">promoter</a> regions which they refer to as LOL-EVE (which stands for: Language of Life for Evolutionary Variant Effects). Like other language models, it is an <a href="https://aws.amazon.com/what-is/autoregressive-models/">autoregressive model</a>, which, in the context of machine learning, means it predicts the next token based on all previous tokens in a sequence. The difference in this case is that a token is not a word, but a <a href="https://en.wikipedia.org/wiki/Nucleotide">nucleotide</a> in a genomic sequence. A model that accurately predicts the next nucleotide is useful since it would need to learn the “language” of genomics. This encoded “knowledge” could then be used for many different purposes, including predicting the effect of a particular mutation without needing to perform time-consuming and expensive experiments. The ability of a model to predict a task that it hasn’t been explicitly trained for is referred to as <a href="https://en.wikipedia.org/wiki/Zero-shot_learning">zero-shot learning</a>.</p><p>Importantly, the authors provide information about the genomic sequence to the model as additional context. Specifically, each promoter sequence is augmented with information about its species and <a href="https://en.wikipedia.org/wiki/Clade">clade</a>, as well as information about the gene closest to the promoter region being learned. Each of these elements is provided as an <a href="https://aws.amazon.com/what-is/embeddings-in-machine-learning/">embedding</a>, which is a numeric vector representation of a discrete element (in this case, the discrete elements are either genes, clades or species).</p><p>So, the task of the model is to predict the next nucleotide, given all preceding nucleotides, as well as the embeddings of the species, clade and most proximal gene. This gives the model <strong>evolutionary information</strong> that allows it to make more accurate predictions that leverage additional contextual information.</p><p>The authors also came up with three benchmarks for evaluating performance of different models, all of which have significant importance as evaluation tasks in genomics: ultra-rare variant, causal eQTL prioritization and transcription factor binding site disruption.</p><h4>Ultra-Rare Variant Prioritization</h4><p>Identifying rare mutations in the genome is relevant as these are often correlated with disease. A model that accurately predicts the next nucleotide would assign a low probability to a nucleotide that does not frequently occur at a particular location (in other words, a rare variant).</p><p>Since different models will predict scores in different ranges, we can compare the score assigned to a variant sequence with that assigned to a wild type (common) sequence using the formula:</p><blockquote>score = log(p(x_var) / p(x_wt))</blockquote><p>A rare sequence should have a lower probability than a common one. The ratio between the two probabilities should therefore be smaller than 1 and its logarithm will be a negative number. The smaller the ratio, the larger the <strong>absolute</strong> magnitude of its logarithm. A good model will thus predict negative scores that are larger in absolute magnitude for ultra-rare variants.</p><p>The score above compares the prediction of the same model for two different sequences. In order to compare its ability to distinguish between rare and common variants with different models, we can subsequently compute a ratio of scores:</p><blockquote>score ratio = score_ultra / score_common</blockquote><p>Hence, a model that is skilled at identifying rare variant sequences will result in a large scoreultra and a small scorecommon, both in absolute magnitude and a larger score ratio.</p><p>Using this scoring methodology, their model performs relatively well at identifying ultra-rare variants when evaluated on indels stratified by their length:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6B2TKv1uCqQIJtuf" /><figcaption>Table taken from [1] Shearer, Courtney A., et al.</figcaption></figure><h4>Causal eQTL Prioritization</h4><p>Expression Quantitative Trait Loci or eQTLs are genomic variants associated with changes in gene expression. These are regions (<strong>loci</strong>) in the genome that are associated with certain phenotypes (<strong>traits</strong>), which can be <strong>quantitatively</strong> measured in gene <strong>expression</strong> assays. They used a method called SuSiE to categorize variants as either causal or background and then they evaluate the model’s ability to distinguish between the two classes. Since this is a binary classification task, they can use standard classification metrics, such as the area under the ROC curve (ROC AUC), which can be interpreted as the probability of the model assigning a higher score to the positive class.</p><p>The ROC AUC score is a single scalar value between 0 and 1. The authors plot the ROC AUC using different “slippage cutoffs” and show that their model outperforms every other model in every cutoff.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/0*kzWbNB1ASKAG9WgA" /><figcaption>Figure taken from [1] Shearer, Courtney A., et al.</figcaption></figure><h4>Transcription Factor Binding Disruption</h4><p>In simple terms, a <a href="https://en.wikipedia.org/wiki/Transcription_factor">transcription factor</a> is a protein that binds to a specific DNA sequence in promoter regions and controls the rate of transcription. Mutations in these binding sites can cause disruptions in this process, leading to disease states. From the paper:</p><p><em>“Disruptions to TF binding sites (TFBS) can impact gene regulation, with the severity depending on the evolutionary constraint and expression characteristics of the target gene.”</em></p><p>A good model should assign lower disruption scores to genes that are consistently expressed in different tissues, or low “expression variability”. The hypothesis is that genes that are consistently expressed in various tissues are less tolerant to regulatory perturbations. They design a metric called delta accuracy, which essentially calculates how often a model correctly assigns lower scores to genes with low expression variability compared to genes with high variability. This metric ranges from -0.5 to 0.5. Their model performs best amongst all models included in the study.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BbgWTmdhm0IXax2O" /><figcaption>Figure taken from [1] Shearer, Courtney A., et al.</figcaption></figure><h3>Wrapping up</h3><p>It is encouraging to learn how the application of a well-established ML architecture such as the Transformer and a non-trivial degree of ingenuity can push the boundaries of what we can do at the intersection of AI and genomics. The authors benchmarked LOL-EVE against other well-established models in genomics and demonstrate their approach effectively outperforms them at predicting indels within promoter regions of the genome. They focused on what seems to be an underinvestigated area, while suggesting an opportunity in “developing region-specific language models for identifying non-coding variants”, advancing our understanding of biology and human disease.</p><p>I believe one of the most promising applications of artificial intelligence and large language models is in improving our understanding of biology, which can lead to new insights about the causes of many diseases affecting the lives of millions of people around the world. These insights will inevitably lead to the development of better interventions that allow us to treat and potentially prevent many diseases with genetic causes, and dramatically impact the lives of people who currently have no effective treatments.</p><h3>References</h3><p>[1] Shearer, Courtney A., et al. “<a href="https://openreview.net/pdf?id=KffXkipDH3">A Genomic Language Model for Zero-Shot Prediction of Promoter Indel Effects.</a>” <em>ICML 2025 Generative AI and Biology (GenBio) Workshop</em>.</p><p>[2] <a href="https://genbio-workshop.github.io/2025/"><em>ICML 2025 Generative AI and Biology (GenBio) Workshop</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9b6407ed52d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Predicting gene expression with Machine Learning: an explanation in simple terms]]></title>
            <link>https://cgaitan.medium.com/predicting-gene-expression-with-machine-learning-an-explanation-in-simple-terms-c2f134b40598?source=rss-30b6ca9dd167------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2f134b40598</guid>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[genomics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[gene-expression-analysis]]></category>
            <category><![CDATA[biotechnology]]></category>
            <dc:creator><![CDATA[Carlos Gaitán]]></dc:creator>
            <pubDate>Mon, 01 Jan 2024 18:20:36 GMT</pubDate>
            <atom:updated>2024-01-02T22:13:37.423Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_9hqRpkEvCHeK5Pv" /><figcaption>Photo by <a href="https://unsplash.com/@sangharsh_l?utm_source=medium&amp;utm_medium=referral">Sangharsh Lohakare</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Some of the ML papers in the genomics space can at first seem intimidating, since there is a vast amount of domain knowledge necessary to fully understand them. Here I briefly introduce some of the challenges in interpreting the genome before describing one of the most recent advances in Machine Learning applied to the gene expression prediction problem. My focus is not as much in the model architecture (though it is covered at a high level), but in understanding why such a model is useful, the kinds of data that were used for training it, and the types of outputs it provides. Understanding the problems that have been solved with ML, those that still exist, as well as the practical applications of existing approaches is critical to understand how the work we do as ML practitioners helps move the field forward and accelerate our understanding of human evolution and disease.</p><p>My aim is to refine my own understanding by writing things in my own words and letting others point out gaps in my comprehension. If you find something that doesn’t sound quite right, please let me know and I’ll be more than happy to correct it. I hope this can also be useful to other ML practitioners getting exposed to the application of ML in genomics for the first time.</p><h3>The challenges in understanding our genome</h3><p>The completion of the <a href="https://en.wikipedia.org/wiki/Human_Genome_Project">Human Genome Project</a> in 2003 meant that, for the first time in history, we had a complete map of the DNA that lies in every human cell. This marked a momentous achievement and opened up all sorts of possibilities, including a better understanding of genetic diseases. The opportunities, it seemed, were endless, as we would in a short time be able to develop cures for many conditions with a genetic origin.</p><p>It turns out that being able to read the nucleotides that make up our genome was only the first step. Since then, scientists around the world have been studying the genome, in an effort to identify associations between genetic variants and disease (for example, in <a href="https://en.wikipedia.org/wiki/Genome-wide_association_study">genome-wide association studies</a>). Once we’re able to identify the mutations that lead to certain disease phenotypes, we can design interventions that either fix the mutations in the DNA (through gene editing techniques, for example) or correct the effect of these mutations in the cell.</p><p>However, identifying the precise genetic changes that cause the development of disease is far from trivial. The following are some examples of the many challenges:</p><ul><li><a href="https://www.ncbi.nlm.nih.gov/books/NBK595930/#:~:text=Analysis%20of%20the%20assembled%20sequences,%25%20is%20&#39;intergenic&#39;%20DNA.">Less than 2%</a> of the 3 billion bases in our genome <a href="https://en.wikipedia.org/wiki/Human_genome#Coding_vs._noncoding_DNA">codes</a> for proteins. Interpreting the remaining 98% is more challenging as mutations in this region may or may not affect the function of other genes and their subsequent translation into proteins.</li><li>While some diseases are caused by a mutation in a single nucleotide (also called <a href="https://en.wikipedia.org/wiki/Single-nucleotide_polymorphism">SNP</a>), many others are thought to be the result of complex interactions between multiple genes and the elements that regulate them.</li><li>There are many complex interactions between <a href="https://en.wikipedia.org/wiki/Regulation_of_gene_expression">regulatory elements</a> in our genome. These are sequences of DNA that affect the function of other genes, and they can be adjacent to the gene they regulate, hundreds of thousands of bases away, or even in different chromosomes!</li><li>Finding the sequence that causes a gene to be down- or up-regulated is challenging due to <a href="https://en.wikipedia.org/wiki/Linkage_disequilibrium">Linkage Disequilibrium</a> (see <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8837575/">[4]</a> for a more intuitive explanation of LD). In short, Linkage Disequilibrium between two positions in the genome exists when the variants at these positions (i.e.: their <a href="https://en.wikipedia.org/wiki/Allele">alleles</a>) are correlated with each other; in other words, their co-occurrence in the genome is not random.</li><li>Because of this, observational studies, such as genome-wide association studies, which analyze the genomes of a large population, often result in thousands of DNA to phenotype associations that are not truly causal of the disease phenotype being studied.</li></ul><p>At the same time, the amount of genomic data available for research has been steadily increasing, while the cost of sequencing has dramatically come down. There is a strong need to devise algorithms that can allow us to reliably predict the effect of genetic mutations in the human cell. Researchers have been leveraging Machine Learning to build algorithms that are able to predict gene expression based purely on the DNA sequence of an individual.</p><p>DeepMind <a href="https://deepmind.google/discover/blog/predicting-gene-expression-with-ai/">published a paper in 2021</a> detailing the inner workings of one such algorithm called Enformer. This deep learning model outperformed the then state-of-the-art approach at predicting gene expression from DNA. The main innovation that enabled the breakthrough was the application of the <a href="https://huggingface.co/learn/nlp-course/chapter1/4">Transformer architecture</a> to the problem of gene expression prediction.</p><h3>Predicting gene expression</h3><p>Gene expression can be estimated by measuring the amount of <a href="https://en.wikipedia.org/wiki/Transcription_(biology)">RNA transcripts</a> in a cell at a particular time. DNA transcription into RNA is therefore a continuous measure and is regulated by many complex biological processes, including the aforementioned regulatory elements in the genome. Regulation causes genes to be expressed in larger and smaller amounts, and this is exactly what we want models to learn to accurately predict.</p><p>There are, however, many different types of molecular assays used in measuring gene expression. Examples include the <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3975069">RNA-Seq and Cap Analysis of Gene Expression (CAGE)</a> technologies. Both of these technologies involve running wet-lab experiments on tissue or cell samples that allow scientists to quantitatively measure the amount of RNA expressed by different genes. These experiments generate the raw data that can be used to train models like Enformer.</p><p>The expression of certain genes depends on the type of tissue from which the cells were extracted. Even though every cell in our bodies contains roughly the same DNA information, the function of genes and the proteins that get made in each type of cell vary significantly. This is largely what makes neurons, hepatocytes (liver cells) and skin cells, to name a few examples, different from each other.</p><p>This means we can generate gene expression datasets not only by applying different molecular assay technologies, but also by running those assays on different tissues. We can leverage this diversity of information by training a machine learning model to learn what expression looks like for the same gene on different assays and tissues. Our hope is that the model can learn the general rules that cause genes to be expressed in some tissues, but not in others.</p><p>We achieve this goal by leveraging a multi-task architecture, in which a model is tasked with predicting expression of one input sequence on multiple different tasks, i.e.: molecular assays and tissues. This allows us to increase the amount of data used to train the model, as well as to force the model to extract more robust features that are useful in predicting expression on different types of molecular assays. In each of the tasks, the model needs to predict the <a href="https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-12-494">genomic track</a> that most closely matches the experimental data in a particular assay.</p><p>We can take this one step further by not only predicting gene expression on data collected from human cells, but also on other organisms, such as mice. The Enformer architecture takes an input DNA sequence of roughly 200,000 bases (or, equivalently, 200 kilo-bases or kb) and is tasked with predicting 5,313 different genomic tracks for a human sample and 1,643 tracks for a mouse sample. Again, this allows us to train the shared layers of the model using more data, and learn more generalizable features that are able to accurately predict RNA expression from a DNA sequence.</p><h3>The innovation in Enformer</h3><p>One of the limitations of the previous state-of-the-art approach was that it could only incorporate information from a sequence of 40 kilo-bases when making a prediction at a particular position. The model, in other words, does not have access to regulatory elements located more than 20 kb away from either side of the position for which the amount of RNA expression is being predicted. This is a problem, because, as discussed earlier, we know of the existence of regulatory elements, such as <a href="https://en.wikipedia.org/wiki/Enhancer_(genetics)">enhancers</a> and <a href="https://en.wikipedia.org/wiki/Repressor">repressors</a>, located hundreds of thousands of bases away from the gene they regulate. The model is therefore inherently limited as it cannot “see” these distal regulatory elements when making a prediction.</p><p>Prior to the publishing of the Enformer model, the best algorithms relied on convolutional layers both to extract meaningful representations from the raw DNA sequence as well as to incorporate information from larger regions of the input sequence. The <a href="https://theaisummer.com/receptive-field/">receptive field</a> of the model was expanded through the use of <a href="https://paperswithcode.com/method/dilated-convolution">dilated convolutions</a>, which allowed the model to capture up to 40 kilo-bases when making a prediction.</p><p>The Transformer architecture used by the Enformer model still uses convolutions to compress the long input sequence into a dense embedding vector. However, the team replaced dilated convolutions with multi-head <a href="https://sebastianraschka.com/blog/2023/self-attention-from-scratch.html">self-attention</a> layers, similar to popular architectures used in the NLP literature. This allowed the model to directly incorporate information from a much larger input space and eliminated the need of stacking multiple convolutional layers to do so, allowing the model to incorporate information from a context 5 times larger compared to other approaches. From the <a href="https://www.nature.com/articles/s41592-021-01252-x">paper</a>:</p><p><em>“This allows the model, for example, to refine the prediction at a TSS by gathering information from all relevant regions, such as enhancers regulating the gene. Since each position directly attends to all other positions in the sequence, they allow for a much better information flow between distal elements. By contrast, convolutional layers require many successive layers to reach distal elements due to their local receptive field. Using transformer layers allowed us to substantially increase the receptive field, reaching distal regulatory elements up to 100 kb away while still being able to effectively integrate their information.”</em></p><p>In the paper, the authors demonstrate that the model in fact leverages information present in distal regulatory elements to make predictions. To do so, the authors computed two types of contribution scores: They looked at both the attention matrix averaged across all layers, as well as computed gradients relative to the input for each layer. They found that contribution scores highlighted areas of biological relevance, including enhancers located more than 20 kb away from the genome. Furthermore, these contribution scores could be used to prioritize candidate enhancers and validate them in molecular assays. The hope is that this could be used to dramatically reduce the search space when attempting to validate a presumed association between a candidate enhancer and its target gene in a molecular assay.</p><p>This <a href="https://storrs.io/enformer/">blog post</a> does a great job at explaining the Enformer architecture at a high level.</p><h3>Final Thoughts</h3><p>Building models capable of accurately predicting gene expression based solely on DNA sequences remains an unsolved problem today. At the same time, doing so would likely represent an important milestone in many disciplines, including drug development. By accurately identifying the effect of different DNA sequence variations on RNA expression, scientists can set out to design drugs and other interventions that modulate the transcription process, either at the DNA or RNA level. Importantly, this would accelerate the pace of innovation as it would dramatically reduce the number of experiments that need to be run, and subsequently the cost and time it takes for a new intervention to reach patients.</p><p>Enformer represents a promising step forward in this direction.</p><h3>To Learn More</h3><p>[1] Avsec, Ž., Agarwal, V., Visentin, D. <em>et al.</em> <a href="https://www.nature.com/articles/s41592-021-01252-x">Effective gene expression prediction from sequence by integrating long-range interactions</a>. <em>Nat Methods</em> 18, 1196–1203 (2021). <a href="https://doi.org/10.1038/s41592-021-01252-x">https://doi.org/10.1038/s41592-021-01252-x</a></p><p>[2] Avsec, Ž., <a href="https://deepmind.google/discover/blog/predicting-gene-expression-with-ai/">Predicting gene expression with AI</a>.</p><p>[3] Storrs, Erik. Enformer: <a href="https://storrs.io/enformer/">Effective gene expression prediction from sequence by integrating long-range interactions</a>.</p><p>[4] Wang QS, Huang H. Methods for statistical fine-mapping and their applications to auto-immune diseases. Semin Immunopathol. 2022 Jan;44(1):101–113. doi: <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8837575/">10.1007/s00281–021–00902–8</a>. Epub 2022 Jan 18. PMID: 35041074; PMCID: PMC8837575.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2f134b40598" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Biologically-infused graph neural networks for antiviral prediction]]></title>
            <link>https://cgaitan.medium.com/biologically-infused-graph-neural-networks-for-antiviral-prediction-3f332e9e74f7?source=rss-30b6ca9dd167------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f332e9e74f7</guid>
            <category><![CDATA[virtual-screening]]></category>
            <category><![CDATA[drug-discovery]]></category>
            <category><![CDATA[bioinformatics]]></category>
            <category><![CDATA[graph-neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Carlos Gaitán]]></dc:creator>
            <pubDate>Fri, 11 Aug 2023 16:56:24 GMT</pubDate>
            <atom:updated>2023-08-12T14:21:57.339Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ko_r8o2i4AV-pDmI" /><figcaption>Photo by <a href="https://unsplash.com/@vlisidis?utm_source=medium&amp;utm_medium=referral">Terry Vlisidis</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Naturally, computational approaches have been developed over the years to predict these properties of interest. More recently, machine learning methods like Graph Neural Networks have been successfully applied to this end. One prominent example is their use in the discovery of a new antibiotic, later named Halicin. By leveraging Graph Neural Networks, MIT scientists were able to identify that the already-existing compound was effective against bacteria, including E. Coli, A. baumannii and C. difficile, effectively “discovering” a new antibiotic [1].</p><p>Graph Neural Networks (GNNs) are neural networks that operate on data structured as graphs. Since molecules can naturally be represented as graphs, GNNs have been a common approach for learning to predict molecular properties from the molecular structure. These properties may include binding affinity, toxicity or antiviral activity as in the case of halicin (see <a href="https://en.wikipedia.org/wiki/ADME">ADME</a>).</p><p>However, in order to train a model with good performance at predicting these properties, one needs to have enough labeled data that the model can learn from. This presents a challenge for new diseases like COVID-19, for which data that associates existing drugs and their interactions with the virus may not exist.</p><h3>Infusing biological knowledge to the model</h3><p>Wengong Jin et al., at MIT developed a creative solution to this problem. They figured out a way to leverage auxiliary datasets containing drug-target interaction (DTI) data between different molecules and the biological targets they may inhibit. In other words, they incorporated information about the drugs that they wanted to predict antiviral activity for, and the known information about whether or not these drugs inhibit certain protein targets. This biological information is available from datasets such as the <a href="https://ncats.nih.gov/expertise/covid19-open-data-portal">NCATS</a> and <a href="https://www.ebi.ac.uk/about">ChemBL</a> datasets, provided the National Institutes of Health and the European Bioinformatics Institute, respectively.</p><p>Using these supplementary datasets, they were able to incorporate biological data on top of the molecular (chemical) structure that is typically used for training GNNs. This allowed them to train a model on a limited amount of data and achieve superior performance compared to models trained solely on the molecular structure.</p><h3>The technical details</h3><p>Combining the NCATS and ChemBL data results in a sparse matrix that cannot be used for training a performant model, since most of the entries are missing. Thus, before training a model to predict antiviral activity, they trained a model to learn to predict the missing drug-target interactions. Instead of developing two separate models, they were able to train a <strong>single GNN model</strong> to learn both the missing DTI features, as well as antiviral activity, which was the ultimate goal. The training happens end-to-end, i.e.: there is no need to split the training process into separate stages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u1EOKZ6hpocgtQKiipiIiA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kkYKTgkSwm4VzYyRCRtAfw.png" /><figcaption>(Left) The combined data from ChemBL and NCATS, which is a highly sparse matrix unsuitable for model training. (Right) The complete matrix after end-to-end learning using the GNN. These predicted features can now be used for learning antiviral activity. Source: <a href="https://www.youtube.com/watch?v=AHVJv5RNqKs">MIT’s Deep Learning in the Life Sciences course, Spring 2021.</a></figcaption></figure><p>The key that allows the model to learn to predict drug-target interactions (i.e.: complete the matrix above) lies in the following lines of code (comments below are my own, their full implementation can be found on <a href="https://github.com/wengong-jin/ComboNet/blob/master/covid_train.py">Github</a>). The model encoder is a GNN, which transforms a molecule represented by its SMILES string (see <a href="https://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system">Simplified molecular-input line-entry system</a>) into a dense vector. The encoded vector is then split into two parts: the first part contains as many elements as the number of columns (targets) in the DTI dataset.</p><p><em># Encode the smiles representation using the GNN, and use the first N positions of the vector as DTI predictions, where N is equal to the number of columns in the matrix of interactions.<br> # Note we are only calling the </em><strong><em>encoder</em></strong><em> and not the entire network (encoder + fully-connected network)</em><br><strong> preds = model.encoder(smiles)[:, :targets.size(1)]</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JNh2NKEoUmWdRdOUH4xNZA.png" /><figcaption>The triangles represent the additional biological features we are learning in parallel with the chemical features, represented as circles. Source: <a href="https://www.youtube.com/watch?v=AHVJv5RNqKs">MIT’s Deep Learning in the Life Sciences course, Spring 2021.</a></figcaption></figure><p>They then compute a loss between this trimmed vector and the known drug-target interaction labels. However, it’s important to only calculate the loss on the ground truth labels, i.e.: those existing in the original sparse matrix, since only those should be used as true labels. Therefore, they apply a binary mask to the calculated losses before adding them all up.</p><p><strong>By separating out the first </strong><strong>targets.size(1) elements of the GNN-encoded vector and computing a loss only on these elements, they force the network to learn features that correspond to predictions of target inhibition by each of the molecules, i.e.: the columns in the matrix of drug-target interactions!</strong></p><p><em># We then compute the loss between these encoded representations and the targets vector, thus<br> # encouraging the network to learn to predict each one of the drug-target interactions in the DTI dataset.<br> # These representations will be used when running the forward pass for the antiviral activity prediction (out main objective).</em><br><strong> dti_loss = loss_func(preds, targets)<br>dti_loss = (dti_loss * mask).sum() / mask.sum()</strong></p><p>They then run another forward pass on the model. This time, they run the <strong>entire model</strong>, including the encoder (GNN) and the fully-connected network that maps the learned vector representation to a score representing antiviral activity. A loss is computed between the predictions (scores) and <em>covid</em> targets (a binary variable representing antiviral activity for each drug).</p><p><em># We now run the entire model on the batch. The output vector contains both the DTI features, as well as the chemical features.<br> preds = model(smiles, mode=0)<br> # We compute a </em><strong><em>different</em></strong><em> loss on the antiviral activity predictions.</em><br><strong> covid_loss = loss_func(preds, targets)</strong></p><p>The final loss is a linear combination of the dti_loss and the covid_loss, which allows them to train the model end to end. The learning process will optimize all of the trainable parameters, including the combined vector representation output by the encoder.</p><p><em># We combine the dti_loss and the covid_loss (full vector) before we run backpropagation</em><br><strong>loss = args.dti_lambda * dti_loss + … + args.single_lambda * (src_loss + covid_loss)<br> loss.backward()</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tTdiYpcSF7Lk7OXhx_8_rw.png" /><figcaption>The entire model pipeline, including the encoder (GNN) and fully-connected network. Source: <a href="https://www.youtube.com/watch?v=AHVJv5RNqKs">MIT’s Deep Learning in the Life Sciences course, Spring 2021.</a></figcaption></figure><p>Using this clever approach, the MIT team was able to leverage both molecular and biological data from molecules and learn their association with antiviral activity. In their paper published at the <a href="https://www.pnas.org/doi/epdf/10.1073/pnas.2105070118">Proceedings of the National Academy of Sciences (PNAS)</a> publication, they show superior performance compared to methods that are not able to exploit both types of data. Their approach also allows for training a single model end-to-end, which is advantageous in a limited data regime, where it might be otherwise challenging to train two separate models.</p><p>The entire lecture by Wengong Jin given to MIT students is a great and very accessible introduction to the field of AI in drug discovery. Part 1 introduces the main approaches to drug discovery: virtual screening and De Novo drug design. In part 2 of the lecture, Wengong discusses the biologically-infused approach I described, and further explains how the model above was extended to predict antiviral synergy, or whether a combination of drugs is more effective than the sum of its parts. In part 3, he covers De Novo drug-design.</p><p>I am grateful for folks like Wengong and the entire team at MIT for making this content available and accessible. I hope this post helps folks understand the content in more detail. Please let me know what you think!</p><h3>References</h3><p>[1] <a href="https://www.theguardian.com/society/2020/feb/20/antibiotic-that-kills-drug-resistant-bacteria-discovered-through-ai">Powerful antibiotic discovered using machine learning for first time</a> [The Guardian, Feb 2020]</p><p>[2] Jin, W.; Stokes, J.M.; Eastman, R.T.; Itkin, Z.; Zakharov, A.V.; Collins, J.J.; Jaakkola, T.S.; Barzilay, R. <a href="https://www.pnas.org/doi/epdf/10.1073/pnas.2105070118">Deep learning identifies synergistic drug combinations for treating COVID-19</a>. <em>Proc. Natl. Acad. Sci. USA</em> 2021, <em>118</em>, e2105070118.</p><p>[3] <a href="https://www.youtube.com/watch?v=AHVJv5RNqKs">AI for Drug Design — Lecture 16 — Deep Learning in the Life Sciences (Spring 2021)</a></p><p>[4] ComboNet implementation on <a href="https://github.com/wengong-jin/ComboNet/tree/master">Github</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f332e9e74f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uplift Modeling]]></title>
            <link>https://cgaitan.medium.com/uplift-modeling-e780a85dbfb5?source=rss-30b6ca9dd167------2</link>
            <guid isPermaLink="false">https://medium.com/p/e780a85dbfb5</guid>
            <category><![CDATA[causal-inference]]></category>
            <category><![CDATA[applied-machine-learning]]></category>
            <category><![CDATA[data-insights]]></category>
            <category><![CDATA[uplift-modeling]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Carlos Gaitán]]></dc:creator>
            <pubDate>Tue, 10 Aug 2021 13:52:56 GMT</pubDate>
            <atom:updated>2021-08-21T02:59:02.560Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*beYOGZMl_cMP_026I0KZ7A.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/JiLTJODH5j4">Cristina Gottardi, Unsplash</a></figcaption></figure><p>Companies often want to understand the factors that lead a person to buy a product. At Spotify, for example, we’re interested in knowing what influences someone’s decision to purchase a premium Subscription. The purchase event is often referred to as a conversion and Machine Learning engineers often build predictive models to predict the probability of conversion, given known characteristics of the customer.</p><p>However, it could be just as, if not more valuable, to understand how new features or changes to the product might impact the baseline conversion probability for an individual user. The product change in question is called “the treatment” and the effect on the outcome we are interested in is called “uplift”. Uplift modeling is a set of techniques we can use to estimate the causal impact of a treatment on the outcome. From <a href="https://arxiv.org/abs/1908.05372">[1] Zhao and Harinen</a>:</p><p><em>“Uplift modeling is an emerging machine learning approach for estimating the treatment effect at an individual or subgroup level. It can be used for optimizing the performance of interventions such as marketing campaigns and product designs. Uplift modeling can be used to estimate which users are likely to benefit from a treatment and then prioritize delivering or promoting the preferred experience to those users.“</em></p><p>This area of machine learning goes by many names, including: Heterogeneous Treatment Effects estimation, incremental response modeling, covariate adjustment and response surface modeling. It is useful in many scenarios in which we’re interested in identifying the people who are most likely to benefit from a new feature, so that we can potentially target only those people. It is also useful when a particular product change might have positive effects for some users and negative ones for others.</p><p>Uplift modeling can be applied in many industries, from marketing campaigns in which users can be targeted for promotions to healthcare applications, for example, identifying patients with varying levels of response to a new drug, including spotting adverse effects on specific sub-populations.</p><p><em>“Uplift modeling is different from standard predictive models in marketing in that it attempts to predict the treatment effect rather than whether or not a user is likely to convert or not. These two are not necessarily the same. […] Uplift modeling is needed because a high treatment effect and a high probability to convert do not necessarily coincide.” </em><a href="https://arxiv.org/abs/1908.05372"><em>[1] Zhao, Harinen</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l_5Oo5hPTT5pbKGL" /></figure><p><em>Image from </em><a href="https://towardsdatascience.com/a-quick-uplift-modeling-introduction-6e14de32bfe0"><em>[5] S. Temple, A Quick Uplift Modeling Introduction</em></a><em>.</em></p><p>From an implementation perspective, there are two broad types of uplift models: Meta-Learners and modifications to existing algorithms to directly optimize uplift.</p><h3><strong>Meta-Learners</strong></h3><p>Meta-Learners leverage well-known ML algorithms that can be plugged into the uplift framework. One of the main advantages of meta learners is that we can use existing and efficient implementations of these algorithms, leading to faster development as well as more efficient training and inference performance when applied to large datasets.</p><p><strong>S-Learner (Single Model Learner)</strong></p><p>The simplest way to calculate uplift is to train a single model to predict the outcome (i.e.: conversion) using the treatment as a feature. This treatment feature is simply a boolean indicator of whether the user received the treatment. Because we’re interested in estimating the uplift for subsequently targeting users, we use pre-treatment features for training the model.</p><p>Once we train a model, we predict uplift for a given individual by getting the prediction probabilities for that user under treatment and control and calculating their difference, or: Uplift(X) = P(Y|X, T=1) - P(Y|X, T=0),</p><p>where P(Y|X, T=t) is given by our model prediction.</p><p><strong>T-Learner (Two-Model Learner)</strong></p><p>Often, the outcome looks very different for users who received the treatment compared to those who did not, and it can be hard for a single model to accurately model these two different response functions. Therefore, we can build on the S-Learner approach by training two separate models, one for treated users and one for control users, to predict the outcome. We still take the difference of their predictions to estimate the uplift for a given user, or:</p><p>Uplift(X) = P1(Y|X) - P2(Y|X), where P1 was trained on treated users and P0 was trained on control users.</p><p>X-Learner and R-Learners are slightly more complicated and deserve their own blog post. These, along with uplift models that modify existing algorithms, attempt to optimize the treatment effect directly, as opposed to calculating it as the difference between the predicted outcomes. X-Learners and R-Learners can be less prone to bias induced by regularization and result in a more accurate uplift estimation than S-Learners and T-Learners.</p><h3><strong>Evaluation</strong></h3><p>Improving the predictive accuracy of the outcome (e.g.: accuracy or precision of conversion) does not necessarily imply that the models will have better performance at identifying users with the highest uplift. In fact, there is no guarantee that the model will learn a strong correlation between the treatment and the outcome during training, assuming there is one. This problem is described in more detail in this MIT lecture on <a href="https://www.youtube.com/watch?v=gRkUhg9Wb-I&amp;t=4066s">Causal Inference</a>. We therefore need new metrics we can use for evaluating the skill of an uplift learner, as proposed in [2] and [3].</p><p>One such metric we can use is the area under the Qini curve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*29FfddwfgHam2KnI" /></figure><p><em>Image from </em><a href="https://docplayer.net/39418076-Testing-a-new-metric-for-uplift-models.html"><em>Naranjo, Testing a New Metric for Uplift Models</em></a></p><p>At a high level, the steps to plot the Qini curve are:</p><ol><li>Rank all control and treatment observations from highest to lowest predicted uplift.</li><li>Split these ranked observations into bins.</li><li>Estimate the actual uplift as the difference between the conversion rates of the two groups. The <strong>key assumption</strong> here is to think of these binned observations/users as “similar” since they fell into the same bin when ranked by uplift. Under this (strong) assumption, we can think of the control observations as counterfactuals for the treated observations.</li><li>Plot the cumulative actual uplift value for each bin.</li></ol><h3><strong>To Learn More</strong></h3><p>[1] <a href="https://arxiv.org/abs/1908.05372">Zhao, Harinen. Uplift Modeling for Multiple Treatments with Cost Optimization</a>.</p><p>[2] <a href="http://proceedings.mlr.press/v67/gutierrez17a/gutierrez17a.pdf">Gutiérrez, Gérardy. Causal Inference and Uplift Modeling: A review of the literature</a>.</p><p>[3] <a href="https://docplayer.net/39418076-Testing-a-new-metric-for-uplift-models.html">Naranjo, Testing a New Metric for Uplift Models</a>.</p><p>[4] MIT 6.S897 Machine Learning for Healthcare, Spring 2019, <a href="https://www.youtube.com/watch?v=gRkUhg9Wb-I&amp;t=4066s">Lecture 14: Causal Inference</a>.</p><p>[5] <a href="https://towardsdatascience.com/a-quick-uplift-modeling-introduction-6e14de32bfe0">S. Temple, A Quick Uplift Modeling Introduction</a>.</p><p>[6] <a href="https://causalml.readthedocs.io/en/latest/">CausalML python package</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e780a85dbfb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Eulogy Virtues]]></title>
            <link>https://cgaitan.medium.com/eulogy-virtues-9df58911493a?source=rss-30b6ca9dd167------2</link>
            <guid isPermaLink="false">https://medium.com/p/9df58911493a</guid>
            <category><![CDATA[finding-meaning]]></category>
            <category><![CDATA[road-to-character]]></category>
            <dc:creator><![CDATA[Carlos Gaitán]]></dc:creator>
            <pubDate>Fri, 05 Mar 2021 01:56:57 GMT</pubDate>
            <atom:updated>2021-03-05T01:56:57.213Z</atom:updated>
            <content:encoded><![CDATA[<p>We spent a significant amount of our time developing what the author <a href="https://en.wikipedia.org/wiki/The_Road_to_Character">David Brooks calls résumé virtues</a>. Some of us are constantly striving to learn so that we are prepared for that job interview. We work long hours and harder than anyone else so that we climb the corporate ladder. We spend considerable time and effort taking courses, improving our communication skills, learning how to invest wisely so that we can aspire to buy a home and travel the world. These are all résumé virtues and many of us live our lives around them.</p><p>I first heard about the concept of eulogy virtues when Josh Radnor (How I Met Your Mother) mentioned it in his<a href="https://www.youtube.com/watch?v=E3lEs1OhKv4&amp;t=535s"> interview on Dan Harris’ 10% podcast</a>. The best way to think about our eulogy virtues is by asking the following question to ourselves: If today was our last day alive, what would people say in our funeral tomorrow? What would people truly remember about us? Would it be how much time we spent at the office? Or would it be the time when we helped them move into a new apartment, the times when we were good listeners and the times when we did something for them without expecting anything in return?</p><p>One of the most delightful aspects of reading is finding the same idea expressed in different ways and in various types of books. One of the main ideas in Mark Manson’s <a href="https://www.audible.com/pd/The-Subtle-Art-of-Not-Giving-a-F-ck-Audiobook/B01I28NFEE?qid=1614556698">The Subtle Art of Not Giving a F*ck</a> is that the only question that matters is: “What is your legacy? How will the world be different and better when you’re gone? What mark will you have made? What influence will you have caused? Confronting the reality of our own mortality is important because it obliterates all the superficial values in life.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5PBv29lbUDR6jEOpjRzfkQ.jpeg" /></figure><h3>We postpone the things that matter</h3><p>Tim Urban, who has given one of the most popular and funniest <a href="https://www.youtube.com/watch?v=arj7oStGLkU">TED talks</a> ever, uses the framework of thinking about our own death when deciding whether spending time on a given project or with a given person is worthwhile. In his chapter on Tim Ferriss’ <a href="https://www.audible.com/pd/Tribe-of-Mentors-Audiobook/B082VK89T8">Tribe of Mentors</a> he says: “If I were on my deathbed today would I be happy with the amount of time I spent with this person?” He calls this the epitaph test, but the idea is the same.</p><p>What’s interesting is that Tim Urban gave what’s probably the most popular talk on procrastination. He explains that there are two types of procrastination: one that has a deadline and one that doesn’t. The problem is that the most important and meaningful endeavors in life usually don’t have a deadline. We work hard to finish the presentation we need to deliver at a meeting the next day, but we hardly invest in exploring that new career we have always been passionate about. We fail to make time to volunteer and help others. We postpone starting our own project that might one day be able to leave the world better than we found it. We delay spending time with our loved ones and letting them know how much they mean to us.</p><p>Mark Manson says we avoid thinking about death-related questions “because they’re hard, scary and because we have no f*cking clue what we’re doing. When we avoid this question, we let trivial values take control of our desires and ambitions.” Our minds are driven by a constant drive to achieve the next promotion, earn a bigger paycheck or otherwise satisfy our own feeling of importance. Once we achieve these goals, our minds waste no time in finding something new to worry about or a new unfulfilled dream. As <a href="https://www.youtube.com/watch?v=a9J8GaeDqVc">Jim Carrey</a> said: “I am the two-times Golden Globe-winning actor Jim Carrey. I don’t dream normal dreams. I dream about being the three times Golden Globe-winning actor Jim Carrey. Because then, I will be enough.”</p><p>Perhaps we should start realizing that these empty values are not leading us to true fulfillment and take a hard look at the difference we’re making day after day. We should consider taking a hard look at our <a href="https://youtu.be/arj7oStGLkU?t=792">life calendar</a> and start working on our eulogy virtues before it’s too late. Maybe then we will go to bed at night with a sense of true fulfillment, knowing that if this was our last day on Earth, someone would have an inspiring story to tell at our funeral.</p><p><em>“This is the lie we tell ourselves our whole lives. As soon as we get the next meal, party, vacation, sexual encounter, as soon as we get married, get a promotion… then, everything will be just fine.</em></p><p><em>We live so much of our lives pushed forward by these if-only thoughts and yet, the itch remains. The pursuit of happiness becomes the source of unhappiness.”</em></p><p>- <a href="https://www.audible.com/pd/10-Happier-Revised-Edition-Audiobook/0062964283?qid=1614906394&amp;sr=1-1&amp;ref=a_search_c3_lProduct_1_1&amp;pf_rd_p=83218cca-c308-412f-bfcf-90198b687a2f&amp;pf_rd_r=Q5CGQCHDZE6NDZPRYEW1">Dan Harris, 10% Happier</a>.</p><p>Inspired by:</p><p><a href="https://www.youtube.com/watch?v=E3lEs1OhKv4&amp;t=535s">Josh Radnor in an interview with Dan Harris</a>, 10% Happier podcast</p><p><a href="https://www.youtube.com/watch?v=arj7oStGLkU">Inside of the mind of a master procrastinator</a>, Tim Urban</p><p><a href="https://www.youtube.com/watch?v=a9J8GaeDqVc">Jim Carrey’s speech</a> at the Golden Globe Awards, 2016</p><p><a href="https://www.audible.com/pd/The-Subtle-Art-of-Not-Giving-a-F-ck-Audiobook/B01I28NFEE?qid=1614556698">The Subtle Art of Not Giving a F*ck</a>, Mark Manson</p><p><a href="https://www.audible.com/pd/Tribe-of-Mentors-Audiobook/B082VK89T8">Tribe of Mentors</a>, Tim Ferriss</p><p><a href="https://www.audible.com/pd/10-Happier-Revised-Edition-Audiobook/0062964283?qid=1614906394&amp;sr=1-1&amp;ref=a_search_c3_lProduct_1_1&amp;pf_rd_p=83218cca-c308-412f-bfcf-90198b687a2f&amp;pf_rd_r=Q5CGQCHDZE6NDZPRYEW1">10% Happier, Dan Harris</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9df58911493a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning to edit DNA]]></title>
            <link>https://cgaitan.medium.com/learning-to-edit-dna-93a3a491455f?source=rss-30b6ca9dd167------2</link>
            <guid isPermaLink="false">https://medium.com/p/93a3a491455f</guid>
            <category><![CDATA[biotechnology]]></category>
            <category><![CDATA[crispr]]></category>
            <category><![CDATA[genomics]]></category>
            <category><![CDATA[dna-editing]]></category>
            <category><![CDATA[biohacking]]></category>
            <dc:creator><![CDATA[Carlos Gaitán]]></dc:creator>
            <pubDate>Mon, 25 Jan 2021 13:03:26 GMT</pubDate>
            <atom:updated>2021-02-02T20:31:20.924Z</atom:updated>
            <content:encoded><![CDATA[<p>I started learning about gene editing by watching a few TED talks, including Jennifer Doudna’s fascinating presentation on CRISPR. The potential of using technology to improve human lives has always intrigued me, and in my opinion, there are few causes more meaningful and impactful than alleviating human suffering by advancing therapies and one day curing diseases like cancer and Alzheimer’s. I also read the exceptional book “A Crack in Creation” by Jennifer Doudna and Samuel Sternberg, which did nothing but fuel my excitement and curiosity about this area.</p><p>I eventually decided it would be my career goal to learn Machine Learning and one day apply it on curing diseases or improving healthcare. Early in 2020, a serendipitous conversation with a person I was interviewing led me to find out that there was a lab in Brooklyn whose mission was to democratize biotechnology and make it accessible to everyone. I looked up their website and found they were offering courses on anything from Biohacking to Neuroscience to… yes, Gene Editing with CRISPR! I didn’t think twice and signed up for the CRISPR course and its prerequisite: Introduction to Biohacking.</p><p><strong>Introduction to Biohacking</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pnO2BtTN5CCR2jkHtKWXwQ.png" /></figure><p>The introductory course covered many basic concepts of biotechnology and molecular biology. We reviewed what DNA is and how to read it, the Central Dogma of Molecular Biology, as well as some of the techniques we would be using during the course, including Polymerase Chain Reaction (PCR), gel electrophoresis and Sanger sequencing, the most common method of gene sequencing today. It was a lot of information to absorb, but the instructors Julie Wolf (PhD in Microbiology) and Elizabeth Tuck (M.S. in Molecular Cell Biology) were always happy to slow down and explain concepts in detail. In fact, they seemed as passionate when explaining concepts as I was when learning about the impressive workings of molecules in our cells.</p><p>After learning the theory, we collected cells from the inside of our own cheeks using q-tips, and centrifuged them in the lab so that they could be isolated and sent to a DNA sequencing company for analysis. Once the results were back the following week, they showed us how to interpret the results using our own sequenced DNA in a computer, similar to what we would get from companies like 23andMe, but we were doing the interpretation ourselves!</p><p>We also inserted a gene into a plasmid that would give bacteria fluorescence under UV light, and then set up an experiment so that bacteria would integrate this plasmid and grow a colony in a dish. The next day, we looked at our bacteria and they were glowing bright green in the dark, confirming the success of our experiment. It was amazing not only to learn that genes can give bacteria fluorescence, but also to clone the DNA into bacteria ourselves and get a sense of what working in biotechnology might look like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M6l4xjO2jv__Ze-iifzQJg.jpeg" /></figure><p><strong>Genome Editing with CRISPR Cas9</strong></p><p>A few weeks later I came back to take a more advanced course, where I would get to use the revolutionary technology of genome editing with CRISPR! This is a technology that was invented in 2012 and it has the potential to cure many diseases that have an underlying genetic cause, including cancer, sickle cell disease, hemophilia, cystic fibrosis and thousands more. The implications of this technology go beyond curing diseases, as it can also be used to solve many agricultural problems, such as making crops more resistant to plagues and slow down ripening, and prevent people from malnutrition or hunger in many parts of the world. Therefore, I was fascinated with the opportunity to be able to learn and use the technology in this course.</p><p>In particular, we learned how to combine the Cas9 protein with the guide RNA against our gene of interest (ADE2) into a single molecular complex (RNP), use it to digest (“cut”) the DNA of yeast containing this gene, and have the yeast use a repair template we also engineered to join the broken DNA back together. Our engineered repair template contained a gene called GFP, which causes yeast to appear green under UV light (hence the name of the gene: “green fluorescent protein”). Just like in the previous course, if our procedure worked as expected, we would be able to see green fluorescence in the yeast and would’ve effectively edited DNA at a precise location in the yeast genome using CRISPR-Cas9.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iiEtGk7ovvtvNOzt2_w_oQ.jpeg" /></figure><p><strong>Final Thoughts</strong></p><p>To say that I was amazed by everything I learned and did while I attended the courses is an understatement. I came out with fascination at two different levels:</p><p>The first one was learning about the microorganisms that we interact with all the time, such as viruses and bacteria, and the incredible complexity they have evolved with, one of them being the CRISPR immune system in bacteria. It was riveting to understand how molecules that exist in nature, such as enzymes or ribosomes, can so faithfully read a strand of DNA and produce all sorts of proteins and chemical reactions that make us who we are. Furthermore, as a software engineer, I had no idea such enzymes could be “programmed” with different strands of RNA or DNA to recognize different genes and thus serve as defense against viral infections for bacteria.</p><p>I am also marveled at our level of understanding of these tiny molecules that are so hard to observe. It is often said that we know very little about how the human body and the different illnesses that affect us work. However, I cannot help but wonder at the level of ingenuity and curiosity that has led us to discoveries like CRISPR as a tool for gene editing. The mere fact that we discovered one of the many ways in which bacteria defend themselves from viruses, identified the molecules that are essential in this immune system and found a way to harness these molecules to not only break the DNA molecule in a desired location in the genome, but also to repair harmful mutations back to healthy genes is simply incredible.</p><p>My experience at Genspace was eye-opening and left me motivated to continue learning about molecular biology and its potential to solve many of the big issues affecting humanity today. I hope to find an opportunity to use technology, including Machine Learning, in this fascinating and impactful cause. Ten years from now, I would like to look back at how I’ve spent my time and know that I’ve contributed to something meaningful, and that my work has helped people live better lives.</p><p>I am grateful for people who are dedicating their careers to democratizing science, in particular those that are not easily accessible like biotechnology and molecular biology. Keep inspiring others.</p><p><strong>To Learn More</strong></p><p><a href="https://www.genspace.org/classes">Classes at Genspace</a>, making biotechnology accessible to everyone.</p><p>Books:</p><p><a href="https://www.audible.com/pd/A-Crack-in-Creation-Audiobook/B072QWW81B?source_code=GPAGBSH0508140001&amp;ipRedirectOverride=true&amp;ds_rl=1257028&amp;ds_rl=1260658&amp;ds_rl=1258208&amp;gclid=CjwKCAiAr6-ABhAfEiwADO4sfYKGk7b6SelpyVCZhUSlYWdnPoYHI64zw36khyVxXuUe-yB4hDZDGxoCapMQAvD_BwE&amp;gclsrc=aw.ds">A Crack In Creation</a>, Jennifer Doudna, Samuel Sternberg.</p><p>Videos and talks:</p><p><a href="https://www.youtube.com/watch?v=TdBAHexVYzc&amp;list=ULMgnnQ2CN6yY&amp;index=1400">How CRISPR lets us edit DNA | Jennifer Doudna</a> (TED)</p><p><a href="https://www.youtube.com/watch?v=KSrSIErIxMQ">Nobel Lecture: Jennifer Doudna, Nobel Prize in Chemistry 2020</a> (YouTube)</p><p><a href="https://www.khanacademy.org/science/biology/biotech-dna-technology#dna-sequencing-pcr-electrophoresis">DNA Analysis Methods</a> (PCR, Gel electrophoresis, DNA sequencing) — Khan Academy</p><p><a href="https://www.youtube.com/playlist?list=PLJicmE8fK0EiuxzIxoeC7R3-EFUrtaf9t">Understanding genetics playlist (TED-ED)</a></p><p>Documentaries:</p><p><a href="https://www.netflix.com/title/81220944">Human Nature</a> — Netflix</p><p><a href="https://www.netflix.com/title/80216752">“Explained” Season 1 Episode 9: Designer DNA</a> — Netflix</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93a3a491455f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Towards making Machine Learning work in the real world]]></title>
            <link>https://cgaitan.medium.com/towards-making-machine-learning-work-in-the-real-world-b9c116ee10d7?source=rss-30b6ca9dd167------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9c116ee10d7</guid>
            <category><![CDATA[jeremy-howard]]></category>
            <category><![CDATA[ml-engineering]]></category>
            <category><![CDATA[full-stack-deep-learning]]></category>
            <category><![CDATA[applied-machine-learning]]></category>
            <category><![CDATA[machine-learning-tips]]></category>
            <dc:creator><![CDATA[Carlos Gaitán]]></dc:creator>
            <pubDate>Mon, 14 Dec 2020 13:14:29 GMT</pubDate>
            <atom:updated>2020-12-14T13:14:29.470Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the biggest challenges in Machine Learning today is in moving from a research model, often considered a prototype and useful to test out hypotheses and ideas, to a reliable, maintainable and reproducible model that works in a production environment and delivers real value to an organization.</p><p>A frequently cited paper is <a href="https://proceedings.neurips.cc/paper/2015/file/86df7dcfd896fcaf2674f757a2463eba-Paper.pdf">Hidden Technical Debt in Machine learning systems</a> published by Google in 2015. The paper provides a visual representation of the complexity surrounding a prediction model in a production environment and gives the reader an intuition of the amount of code that might be required in writing these. One of its key points is that in order to develop an effective and robust system, we need to consider many aspects beyond the actual modeling code. It is not uncommon to spend significantly more time and effort in developing the systems that surround the model than in the model itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*7kSKI9Rnjhr4CwntjY2LBg.png" /><figcaption><em>Image above was taken from: </em><a href="https://proceedings.neurips.cc/paper/2015/file/86df7dcfd896fcaf2674f757a2463eba-Paper.pdf"><em>Hidden Technical Debt in Machine learning system</em></a><em>s by Google Inc.</em></figcaption></figure><p>Former OpenAI researcher Josh Tobin shared some interesting insights about the challenge of real-world Machine Learning on a <a href="https://open.spotify.com/episode/4Dt2eWHCX8OjRf4RGWKW6o?si=NcoBG09lRsuaEPxr0bA4Hw">recent episode</a> of the Gradient Dissent podcast. He thinks the methodology for ML development is still immature, and that there is a big opportunity in coming up with the “agile” of Machine Learning. While at OpenAI, he gathered insights from highly successful ML practitioners and taught it as a course at UC Berkeley that is now <a href="https://course.fullstackdeeplearning.com/">available online</a>.</p><p>Among the questions teams need to think about when planning ML projects are:</p><ul><li>How do we build reproducible pipelines and prevent us from losing the ability to train a good model?</li><li>What tests do we need to write for an ML system?</li><li>How do we deploy and monitor systems in production? Do we have the right tools to debug and troubleshoot ML systems?</li><li>How do we choose between different projects? How do we assess feasibility and impact for each project?</li><li>What’s the best way to communicate expectations to leadership and get buy-in?</li><li>How do we manage an ML team composed of different disciplines, including engineers and researchers? How do we create a collaborative environment between these?</li></ul><p>Some of these questions are discussed in the <a href="https://course.fullstackdeeplearning.com/">Full Stack Deep Learning online course</a>, which I found can be a very helpful framework for thinking about these problems and having a starting point. Josh also shared some insights and useful recommendations in the podcast episode. These are based on his experience as an ML researcher, as well as knowledge gathered from experts:</p><p><strong>Start small and gradually add complexity</strong></p><p>What makes debugging Machine Learning systems hard is that flaws in the system often mean the model doesn’t improve as much or as fast as it could. Unlike traditional software though, there are no obvious exceptions or errors being thrown. This makes it harder to validate that the system is working at its full potential. A strategy that can save a lot of time in the long run is to start with a small system we know what to expect from, validate it works properly, and only then start adding layers of complexity.</p><p>One specific implementation of this idea is when training a new model. It is often a good idea to test the Machine Learning code by overfitting a very small subset of the data (e.g.: a single batch of data). Any reasonable model architecture should be able to drive the loss down to zero and memorize the data. That way, we ensure there are no obvious bugs in the Machine Learning code before adding complexity to the architecture or training on a larger dataset, when it becomes much harder to pinpoint the issue. This approach is also suggested by Jeremy Howard in his amazing <a href="https://course19.fast.ai/videos/?lesson=8">2019 Deep Learning for Coders course</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*eiB43WGSupMatCsQ-EvExQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x5ZOzbydjX_o8xI7R3XgWw.png" /><figcaption><em>Pictures above were taken from the </em><a href="https://course19.fast.ai/videos/?lesson=8"><em>2019 Deep Learning for Coders</em></a><em> course.</em></figcaption></figure><p><strong>Focus on the key ideas from fewer papers</strong></p><p>The industry is moving at a very fast pace and thousands of papers are published every month. Rather than attempting to keep up with numerous new papers, it is more useful to deeply understand the main ideas from the most important papers. Josh has seen that the most successful people have sometimes spent weeks understanding and even implementing these key concepts.</p><p><strong>Spend enough time getting practical, hands-on experience</strong></p><p>The field of Machine Learning can be intimidating at first, given the amount of theory behind many of the state-of-the-art algorithms and the pace of change in the industry. Many people get discouraged when faced with the task of understanding complex mathematical equations in research papers. Others spend too much time learning theory before getting practical experience on their own projects and writing code.</p><p>Both Jeremy Howard and Josh Tobin stress the importance of coding and hands-on experience as this helps practitioners understand the inputs and outputs of a Machine Learning system and how it can be used in the real world. The coding experience serves not only as useful context for people to understand where a prediction algorithm fits in the broader picture of a Machine Learning system, but also helps practitioners develop an intuition of how an algorithm works, which ultimately provides a different view of the same mathematical notation that at first seemed daunting.</p><p><strong>Conclusion</strong></p><p>It is an exciting time in Machine Learning as academics and industry practitioners figure out how to reliably move from a research model to a production-grade system that works in the real world. People from leading companies and research labs are compiling these guidelines based on what has worked and what hasn’t, and sometimes driving conversations to help advance the speed of iteration in the industry as a whole. This presents an opportunity for those of us in the field to drive discussions in their own organizations. It also helps us adopt the right mindset around Machine Learning projects and set the right expectations and goals when we plan projects within our teams.</p><p>What are other resources of best practices for making ML work in production? What have been the most influential papers or courses in your ML journey? Where do you agree or disagree with the ideas presented in this article?</p><p>I’d love to hear your thoughts, please do comment with suggestions and give feedback on this post.</p><p><strong>To Learn More</strong></p><p>[1] D. Sculley, Gary Holt, Daniel Golovin, Eugene Davydov, Todd Phillips, Dietmar Ebner, Vinay Chaudhary, Michael Young, Jean-Francois Crespo, and Dan Dennison. 2015. <a href="https://proceedings.neurips.cc/paper/2015/file/86df7dcfd896fcaf2674f757a2463eba-Paper.pdf">Hidden technical debt in Machine learning systems</a>. In Proceedings of the 28th International Conference on Neural Information Processing Systems — Volume 2 (NIPS’15). MIT Press, Cambridge, MA, USA, 2503–2511.</p><p>[2] <a href="https://course19.fast.ai/videos/?lesson=8">2019 Practical Deep Learning for Coders</a>, Jeremy Howard (Fast AI).</p><p>[3]<a href="https://course.fullstackdeeplearning.com/"> Full Stack Deep Learning</a>, Josh Tobin et al.</p><p>[4] <a href="https://open.spotify.com/episode/4Dt2eWHCX8OjRf4RGWKW6o?si=NcoBG09lRsuaEPxr0bA4Hw">Slow down and change one thing at a time — Advancing AI research</a> with Josh Tobin. Gradient Dissent podcast.</p><p>[5] <a href="http://martin.zinkevich.org/rules_of_ml/rules_of_ml.pdf">M. Zinkevich. Rules of Machine Learning: Best Practices for ML Engineering</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9c116ee10d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I got my first job at Microsoft]]></title>
            <link>https://cgaitan.medium.com/how-i-got-my-first-job-at-microsoft-422320a1ec2f?source=rss-30b6ca9dd167------2</link>
            <guid isPermaLink="false">https://medium.com/p/422320a1ec2f</guid>
            <category><![CDATA[programming-interviews]]></category>
            <category><![CDATA[itesm]]></category>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[Carlos Gaitán]]></dc:creator>
            <pubDate>Sat, 22 Aug 2020 12:48:07 GMT</pubDate>
            <atom:updated>2020-08-22T12:48:07.307Z</atom:updated>
            <content:encoded><![CDATA[<p>From: <a href="https://www.cgaitan.com/blog/how-i-got-my-first-job-at-microsoft">https://www.cgaitan.com/blog/how-i-got-my-first-job-at-microsoft</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2-8Q874l7txMU--9ec_i8g.jpeg" /></figure><p>One of the stories I like to share whenever I’ve gotten a chance to talk to students at universities is how I got my first job at one of the world’s leading tech companies. I try to encourage them to always pursue their goals, however far they might seem to be at first, just as I proved to myself that there is little to lose and much to gain when we are determined to go after them.</p><p>I attended college at Tecnológico de Monterrey, a world-class university in Mexico. At the time, Microsoft was one of the few major technology companies in the US that was recruiting software engineers at my university. For some of us in my Computer Science class, it was a dream to end up working at a company like Microsoft. At the same time though, it seemed a really tough challenge. The interviews were known to be particularly hard. One not only needed to come up with a clever solution to a problem never seen before, but also write working code on a whiteboard, all in a very limited amount of time and while explaining one’s own thoughts in a foreign language. On top of it, there is significant pressure as the interviewee is well aware that their performance in the next 45 minutes may as well change the direction of their professional career.</p><p>All of this made me very nervous, but never discouraged me from applying. At some point in my life I adopted the mindset that discipline and hard work can get you very far, and putting yourself in uncomfortable situations is sometimes the best way for you to grow and push yourself beyond your perceived limits.</p><p>Since Microsoft was hiring both summer interns and new graduates I applied to an internship as early as during my sophomore year. Engineers and recruiters from the company came every year to a jobs fair at the university campus, where they would go over your resume and potentially have you write some simple code on the spot. If it all went well, they schedule a screening interview for you a few weeks later, also at the university. If the feedback from this first interview was positive, you were invited to a full round of interviews at the Headquarters in Redmond, Washington.</p><p>The first time I applied, I made it through the screening round and was invited to a full day of interviews on-site. I was very excited and nervous at the same time. Unfortunately though, I received an email about a week after my interviews saying they wouldn’t be making an offer this time. I was of course very disappointed, but at the same time, I thought about many things that I could’ve done better during the interviews. In one of the interviews, for example, the interviewer asked me to email him later if I came up with a solution to one of the problems we discussed. I regretted not having done so at all.</p><p>The following year, I decided to apply again. I went to the jobs fair and got selected to be screened a few weeks later. I was assigned to be interviewed by an engineer named Gerardo. I don’t remember the specifics of this interview, but I wasn’t selected to come on-site. My self-confidence dropped and I realized it might not be as easy to get through the screening round again. If only I had seized the opportunity I had the prior year! I decided to apply for the third time in my Senior year and followed the same process. As fate would have it, I was assigned to the same interviewer at the screening phase and I didn’t meet the bar to move forward to the on-site round, once again.</p><p>The Computer Science program at Tec de Monterrey is 4.5 years long, so after the equivalent of my Senior year I only had one more semester to go. I remember I had picked significant interest in management consulting (I even went through interviews with The Boston Consulting Group and Bain &amp; Company) and wasn’t planning on applying to Microsoft anymore. The day of the annual jobs fair, I remember heading towards the building where it gets hosted every year. I left the building after chatting with a few companies, but not Microsoft. As I headed home, I said to myself: “what do I have to lose?”. I turned around and went back towards Microsoft’s booth.</p><p>I got an email a few days later saying I would be interviewing with Gerardo once again. This would be the third year in a row I would be testing my skills with the same person, and fourth year in a row with the same company. On the interview day, Gerardo even greeted me warmly and thanked me for applying again. To be honest, I was even somewhat embarrassed that he recognized me. In retrospect, I now feel proud that I never let these thoughts and feelings dissuade me from applying and that I didn’t give up trying.</p><p>I did my best during the interview and got an email a few days later saying I would be invited to the final round of interviews in December, this time in Mexico City. I tried to learn from previous mistakes. I believe I took the preparation more seriously and made it a priority in my daily schedule. The day of the interviews came and I was just as nervous as the first time I applied, but this time I knew how to manage my nerves a bit better and tried to focus on the problems and showing my skills. I felt confident in my performance in 3 of my 4 interviews. However, if I had learned something so far was that one’s perception might be very different than the interviewer’s. I was optimistic, but I waited patiently for the results.</p><p>On December 23rd, I noticed an email from the recruiter at Microsoft, telling me that he noticed I hadn’t indicated the likelihood of accepting an offer in the information I provided. He wanted to know because, in fact, I had an offer to join Microsoft as a full-time Software Development Engineer in Test. This would be my very first job after graduating from university.</p><p>To this day, I am grateful for the lessons learned when things didn’t go the way I planned. I am grateful to the people who gave me a chance, as well as to those who showed me when I needed to improve along the way. My experience is one I am proud to share and I hope it encourages others who might think their own goals are out of reach.</p><p>“There’s no such thing as failure, there’s only feedback, and it’s what we do with that feedback that will ultimately determine how successful we will be.”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=422320a1ec2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>