---
title: "Machine Learning"
description: "622 posts about Machine Learning, summarised, each linking to the original."
---

# Machine Learning
> 622 posts about Machine Learning, summarised, each linking to the original.

## Articles

### [Getting Started with Transformers on Habana Gaudi](https://yomu.fyi/post/getting-started-with-transformers-on-habana-gaudi.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Julien Simon
- Published: Apr 26, 2022
- Type: Tutorial

Habana Labs and Hugging Face partnered to accelerate Transformer model training using Habana Gaudi accelerators, which offer up to 40% better price performance than recent GPU-based Amazon EC2 instances. Setting up the environment requires launching an Amazon EC2 dl1.24xlarge instance using the Habana Deep Learning Base AMI on Ubuntu 20.04. Inside an interactive PyTorch Docker container configured for Habana runtimes, users install the Optimum Habana package from source along with necessary dependencies. Fine-tuning the bert-large-uncased-whole-word-masking model on the GLUE MRPC task completes in 2 minutes and 12 seconds with an F1 score of 0.9181. Utilizing EC2 Spot Instances reduces the hourly compute cost by 70%, from $13.11 down to $3.93.


### [Introducing Hugging Face for Education 🤗](https://yomu.fyi/post/introducing-hugging-face-for-education.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Violette
- Published: Apr 25, 2022
- Type: Announcement

Hugging Face established an initiative to teach machine learning to 5 million people by the end of 2023. As machine learning expands across software development and impacts non-technical users, adapting workforce skills and assisting educators with ethical considerations become critical challenges. The educational framework provides browser-based model testing widgets, documentation on model biases, and free courses covering Natural Language Processing, Deep Reinforcement Learning, and interactive demo creation. Instructors receive free infrastructure to create Hub classrooms, alongside a multilingual toolkit spanning topics like Transformers and Gradio. Through ongoing global tours and free compute events, the organization supports collaborative machine learning education across diverse experience levels.


### [Supercharged Customer Service with Machine Learning](https://yomu.fyi/post/supercharged-customer-service-with-machine-learning.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Patrick von Platen
- Published: Apr 25, 2022
- Type: Tutorial

Customer support teams often receive high volumes of messages that cannot all be answered manually. To prioritize urgent inquiries, support workflows can be modeled as a text classification task to identify the most unsatisfied customers. Using the Hugging Face ecosystem, an NLP pipeline is established by selecting the Amazon reviews multi dataset and fine-tuning a DeBERTa model for sentiment classification across five granular categories. Evaluation on test data shows that the model identifies roughly 95% of unsatisfied messages with an 11.7% false-positive rate on satisfied messages, potentially reducing human triage workload by 83%. For production deployment, performance can be optimized through hardware acceleration, lower precision arithmetic, open-source libraries like Optimum and ONNX Runtime, and inference servers.


### [CO2 Emissions and the 🤗 Hub: Leading the Charge](https://yomu.fyi/post/co2-emissions-and-the-hub-leading-the-charge.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Sasha Luccioni, Zachary Mueller, Nate Raw
- Published: Apr 22, 2022
- Type: Tutorial

Training and deploying machine learning models produces greenhouse gas emissions determined by infrastructure runtime, hardware type, and energy grid carbon intensity. Hugging Face introduced mechanisms to measure, report, and filter models based on their carbon footprint to improve ecological transparency. Using the huggingface\_hub library, practitioners can query HfApi.list\_models with an emissions\_thresholds parameter to filter models by maximum or minimum carbon emissions measured in grams. In addition, installing the codecarbon package enables the Transformers Trainer to automatically attach CodeCarbonCallback and log training emissions to an emissions.csv file. Users can then publish these measured values directly into model card metadata under co2\_eq\_emissions for public tracking.


### [How we reduced our CI YAML files from 1800 lines to 50 lines](https://yomu.fyi/post/how-we-reduced-our-ci-yaml-files-from-1800-lines-to-50-lines.md)
- Company: [Grab](https://yomu.fyi/company/grab.md)
- Author: Jia Long Loh
- Published: Apr 19, 2022
- Type: Problem & solution

Grab's Cauldron Machine Learning Platform team managed continuous delivery across multiple pipelines by using nested GitLab CI configurations, but soon encountered platform limitations such as the 100-include ceiling and bloated 1,800-line YAML files. To address these constraints, the team implemented GitLab Dynamic Child Pipelines to programmatically create execution stages on the fly. They built a command-line utility in Rust that runs git diff against the base branch, extracts pipeline and stage metadata using configurable stop patterns, and applies a template to produce a dynamic CI definition. On the master branch, the tool fetches the diff artifact from the source branch through the GitLab API to execute identical generation logic. This architectural shift reduced the root CI file from 1,800 lines down to a constant 50 lines, allowing configuration size to remain stable regardless of repository growth.


### [Machine Learning Experts - Lewis Tunstall](https://yomu.fyi/post/machine-learning-experts-lewis-tunstall.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Britney Muller
- Published: Apr 13, 2022
- Type: Explainer

In this interview with Britney Muller, Hugging Face machine learning engineer Lewis Tunstall discusses his background, his book Natural Language Processing with Transformers, and tooling optimizations for deploying transformer models. Tunstall notes that large model parameter sizes often lead to high latency, making off-the-shelf transformers impractical for responsive applications like chatbots. To resolve this issue, he developed single-line export tooling within the transformers library to convert models into the ONNX format. This conversion enables engineers to run PyTorch models in TensorFlow or on specialized hardware, achieving faster latency and higher throughput. Tunstall also recounts co-authoring the O'Reilly book with Leandro von Werra and Thom Wolf, collaborating on the Hugging Face Course, and training a GPT-2 model named code parrot on Python code.


### [Habana Labs and Hugging Face Partner to Accelerate Transformer Model Training](https://yomu.fyi/post/habana-labs-and-hugging-face-partner-to-accelerate-transformer-model-t.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Susan Lansing
- Published: Apr 12, 2022
- Type: Announcement

Training transformer models across computer vision, speech, and natural language processing tasks at scale often demands heavy compute resources, incurring significant time and financial expense. To address these bottlenecks, Habana Labs and Hugging Face partnered to integrate the SynapseAI software suite into the Hugging Face Optimum open-source library. This integration allows machine learning practitioners to accelerate transformer training workflows on Habana Gaudi processors using minimal code adjustments. Habana Gaudi hardware, featured in Amazon EC2 DL1 instances and Supermicro X12 servers, incorporates ten 100 Gigabit Ethernet ports per processor to scale from single units to thousands of chips. The combined hardware and software architecture supports TensorFlow and PyTorch while delivering price and performance metrics up to 40% lower than comparable training alternatives.


### [The Magic of Merlin: Shopify's New Machine Learning Platform](https://yomu.fyi/post/the-magic-of-merlin-shopify-s-new-machine-learning-platform.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Apr 6, 2022
- Type: Explainer

Shopify’s machine learning platform team redesigned its infrastructure to accommodate varied use cases, dependencies, data types, integrations, and production requirements. Merlin uses an open-source stack in which on-demand Merlin Workspaces run as short-lived Ray clusters on Kubernetes, while projects isolate code and dependencies in Docker-based environments. Its first iteration focuses on training and batch inference, with users moving from local or Jupyter-based prototypes to automated production workflows through the Merlin API, Airflow, or Oozie. Shopify validated the platform by migrating its product categorization workflows, using Ray Train for distributed TensorFlow training and Ray ActorPool for batch inference; planned extensions include online inference, model lifecycle management, and machine learning monitoring.


### [~Don't~ Repeat Yourself](https://yomu.fyi/post/don-t-repeat-yourself.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Patrick von Platen
- Published: Apr 5, 2022
- Type: Explainer

Hugging Face's Transformers library intentionally departs from the traditional "Don't repeat yourself" (DRY) software design principle by adopting a single model file policy. This architecture places all code required for a model's forward pass into a dedicated file, avoiding centralized shared modules for components like attention mechanisms. Because machine learning research evolves rapidly and published model architectures remain static, isolating code protects individual models from breaking changes and lowers contribution barriers for the open-source community. To maintain consistency without manually syncing duplicated code across successor models, the library uses automated tooling driven by Copied from comments. While this approach complicates unified API enforcement and component-wide research integration, Transformers validates API consistency by running approximately 20,000 automated tests daily.


### [Introducing Decision Transformers on Hugging Face 🤗](https://yomu.fyi/post/introducing-decision-transformers-on-hugging-face.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Edward Beeching, Thomas Simonini
- Published: Mar 28, 2022
- Type: Announcement

Hugging Face has integrated the Decision Transformer architecture into its transformers library and Hub, expanding support for offline reinforcement learning. Unlike standard reinforcement learning methods that maximize returns by learning value functions or policies through active environment interaction, Decision Transformers model trajectories as conditional sequence problems. The model feeds past states, actions, and target returns-to-go over a context window into a GPT-2 autoregressive backbone to generate future actions. Evaluating pre-trained continuous control checkpoints requires standardizing observations with training set statistics and iteratively updating the target return based on received rewards. This sequence modeling paradigm enables practitioners to adjust agent behaviors and skill levels directly by specifying different target returns at runtime.


### [Machine Learning Experts - Margaret Mitchell](https://yomu.fyi/post/machine-learning-experts-margaret-mitchell.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Britney Muller
- Published: Mar 23, 2022
- Type: Explainer

Machine learning models often internalize harmful dataset skews and fail to evaluate real-world contexts accurately. During work on vision-to-language generation, visual recognition systems learned to misinterpret destructive disasters as positive scenes because training images predominantly featured sunsets and fireworks. Addressing these structural flaws requires moving beyond benchmark optimization toward critical data analysis, dataset genealogies, and standardized ethical AI protocols. ML organizations must establish shared vocabularies for power differentials and dismantle competitive cultural norms that marginalize underrepresented contributors. Furthermore, lowering technical barriers—such as enabling non-engineers to inspect data without SQL—allows diverse stakeholders to evaluate models and prevent widening societal power divides.


### [Announcing the 🤗 AI Research Residency Program](https://yomu.fyi/post/announcing-the-ai-research-residency-program.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Douwe Kiela
- Published: Mar 22, 2022
- Type: Announcement

Hugging Face launched a nine-month Research Residency Program designed to train participants into impactful machine learning researchers. Residents collaborate directly with researchers from the Science Team to formulate research questions, develop novel machine learning techniques, and openly publish their findings. The initiative specifically encourages proposals from marginalized groups—including women, LGBTQ+ individuals, people of color, and working-class communities—to address disparities exacerbated by artificial intelligence progress. Applicants must demonstrate mathematical and programming abilities through coursework, open-source projects, and end-to-end proposals targeting positive societal impact. The full-time role is fully remote, provides benefits including medical coverage depending on location, and excludes concurrent student enrollment or employment.


### [Fine-Tune a Semantic Segmentation Model with a Custom Dataset](https://yomu.fyi/post/fine-tune-a-semantic-segmentation-model-with-a-custom-dataset.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Tobias Cornille, Niels Rogge
- Published: Mar 17, 2022
- Type: Tutorial

Fine-tuning a semantic segmentation model requires domain-appropriate training data and an efficient pipeline. Existing autonomous driving datasets feature roadway imagery captured by cars, creating a distribution mismatch for sidewalk-based delivery robots. To resolve this discrepancy, a dedicated dataset of sidewalk imagery is loaded from the Hugging Face Hub, split into training and test sets, and augmented on-the-fly using SegformerImageProcessor and torchvision. The smallest SegFormer architecture, B0, is fine-tuned using Hugging Face's Trainer API with mean Intersection over Union evaluation metrics. The final pipeline pushes the fine-tuned model to the Hub and executes inference by upsampling output logits to original image dimensions.


### [Accelerate BERT inference with Hugging Face Transformers and AWS Inferentia](https://yomu.fyi/post/accelerate-bert-inference-with-hugging-face-transformers-and-aws-infer.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Philipp Schmid
- Published: Mar 16, 2022
- Type: Tutorial

Production deployments of BERT and Transformer architectures often face cost and latency challenges because these models are significantly larger and more computationally intensive than traditional algorithms. To optimize text classification workloads, developers can compile vanilla PyTorch models for AWS Inferentia using the AWS Neuron SDK and its tracing utilities. Because the Neuron SDK requires static tensor dimensions, the model is traced with fixed input lengths and packaged alongside a custom inference script configuring one Neuron Core per worker. Deploying the resulting artifacts to an Amazon SageMaker ml.inf1.xlarge endpoint yields an average latency of 5 to 6 milliseconds for a sequence length of 128 across 10,000 synchronous evaluation requests.


### [Image search with 🤗 datasets](https://yomu.fyi/post/image-search-with-datasets.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Daniel van Strien
- Published: Mar 16, 2022
- Type: Tutorial

Hugging Face datasets expanded its capabilities by introducing an Image feature type, enabling image processing and integration with vector indexing tools. The library was applied to a sample of historical book embellishments extracted via OCR from the British Library. Images were loaded using the ImageFolder loader, enriched with filename metadata, and pushed to the Hugging Face Hub. A FAISS index and CLIP embeddings were used to retrieve images matching natural language queries, such as categories, specific objects, and boolean operators. While the retrieval system demonstrated reasonable semantic search results across various prompts, full public deployment was avoided due to CLIP model card restrictions and potential bias in the historical dataset.


### [Guiding Text Generation with Constrained Beam Search in 🤗 Transformers](https://yomu.fyi/post/guiding-text-generation-with-constrained-beam-search-in-transformers.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Chan Woo Kim
- Published: Mar 11, 2022
- Type: Explainer

Constrained beam search introduces direct control over generated text in Hugging Face Transformers. Standard beam search operates token-by-token without knowing the optimal step to force specific words or phrases, making it difficult to enforce mandatory vocabulary or choose between alternative expressions. To resolve this, the generate interface accepts constraints through arguments such as force\_words\_ids and a list of Constraint subclasses like PhrasalConstraint. This mechanism enables disjunctive constraints, where generation must include at least one phrase from a provided set, alongside strictly required sequences. Consequently, practitioners can inject prior knowledge or formatting requirements directly at generation time rather than filtering candidate outputs afterward.


### [BERT 101 - State Of The Art NLP Model Explained](https://yomu.fyi/post/bert-101-state-of-the-art-nlp-model-explained.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Britney Muller
- Published: Mar 2, 2022
- Type: Explainer

Developed in 2018 by Google AI Language, Bidirectional Encoder Representations from Transformers addresses the historical challenge of machines lacking contextual understanding of human language. The model relies on an encoder-only Transformer architecture pre-trained on a 3.3-billion-word corpus consisting of Wikipedia and Google BooksCorpus. Training simultaneously combines masked language modeling, which hides 15% of tokenized words to enforce bidirectional context learning, with next sentence prediction across balanced sentence pairs. Pre-trained on Cloud TPUs over four days, BERT unifies solutions for more than eleven common NLP tasks and can be fine-tuned on task-specific annotated data within minutes. Unmasking experiments demonstrate that the model can also inherit distinct societal and gender biases from its underlying training corpora when predicting professions.


### [Shopify's Playbook for Scaling Machine Learning](https://yomu.fyi/post/shopify-s-playbook-for-scaling-machine-learning.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Feb 11, 2022
- Type: Explainer

Shopify describes how its machine-learning practice grew from a first order-fraud product into a portfolio used across products such as Shopify Capital, product categorization, and Help Center search. The playbook starts with choosing a user-important problem, validating trustworthy and accessible data, tracing downstream dependencies, understanding existing solutions, and optimizing for product outcomes rather than model scores alone. To productionize models, Shopify recommends well-defined training, verification, and testing pipelines, deployment decisions based on volume and user commitment, and platform practices that encode validated standards without abstracting too early. Its fraud pipeline builds models in Python, serializes them with PMML for deployment in Ruby-based production systems, and uses Apache Airflow to schedule operations. The account concludes that scaling is a full-stack problem requiring data scientists and data engineers to align on one roadmap and goal.


### [Fine-Tune ViT for Image Classification with 🤗 Transformers](https://yomu.fyi/post/fine-tune-vit-for-image-classification-with-transformers.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Nate Raw
- Published: Feb 11, 2022
- Type: Tutorial

Vision Transformer models bring transformer architectures to computer vision by splitting images into grids of sub-image patches and projecting them into token sequences. To classify healthy and diseased leaves using the beans dataset, the Hugging Face datasets and transformers libraries enable streamlined data ingestion and model fine-tuning. Preprocessing relies on ViTImageProcessor paired with lazy on-the-fly dataset transforms to dynamically generate normalized pixel tensors. Training leverages ViTForImageClassification with the Trainer API, requiring remove\_unused\_columns set to False so raw image data is preserved for batch collation. Over four training epochs, fine-tuning the google/vit-base-patch16-224-in21k checkpoint achieves an evaluation accuracy of 98.5% alongside an evaluation loss of 0.0637.


### [Getting Started with Sentiment Analysis using Python](https://yomu.fyi/post/getting-started-with-sentiment-analysis-using-python.md)
- Company: [Hugging Face](https://yomu.fyi/company/hugging-face.md)
- Author: Federico Pascual
- Published: Feb 2, 2022
- Type: Tutorial

Modern natural language processing tools allow developers to perform sentiment analysis without deep machine learning expertise. Sentiment analysis categorizes text polarity into positive, negative, or neutral labels to extract insights from large volumes of social posts, reviews, and support tickets. Using the Hugging Face Transformers library and the Hub, practitioners can quickly run pre-trained transformer pipelines or target specific multilingual and emotion-detection models with minimal Python code. For custom requirements, developers can fine-tune models like DistilBERT using the IMDB dataset via the Trainer API or train models automatically with AutoNLP. Applying these workflows to social media data enables automated sentiment distribution analysis and visualization using pandas, matplotlib, and word clouds.


[Newer posts](https://yomu.fyi/topic/machine-learning/page/26.md) · [Older posts](https://yomu.fyi/topic/machine-learning/page/28.md)
