Category Archives: PyTorch

Dealing With PyTorch Training Data That Has IDs

When working with PyTorch (or Keras) neural networks, a surprisingly tricky task is dealing with training data that has IDs. Data IDs are useful when analyzing a model to diagnose items that are incorrectly predicted. You need to store the … Continue reading

Posted in PyTorch | 1 Comment

Using a Hugging Face Fine-Tuned Binary Classification Model

I’ve been taking a deep dive into the Hugging Face (HF) open-source code library for natural language processing (NLP) with a transformer architecture (TA) model. In previous explorations, I fine-tuned a pretrained HF DistilBERT model (110 million parameters) to classify … Continue reading

Posted in PyTorch | Leave a comment

Computing Accuracy of a Hugging Face Fine-Tuned Binary Classification Model

I’ve been slowly but surely walking through Hugging Face (HF) documentation examples. HF is an open-source code library for transformer architecture (TA) systems for natural language processing (NLP). In a recent exploration, I refactored a documentation example that tackled the … Continue reading

Posted in PyTorch | Leave a comment

Fine-Tuning a Hugging Face DistilBERT Model for IMDB Sentiment Analysis

Over the past few weeks I’ve been walking through some of the examples in the Hugging Face (HF) code library. HF provides a set of APIs over Transformer Architecture (TA) models for natural language processing (NLP). Using HF is not … Continue reading

Posted in PyTorch | Leave a comment

Ordinal Classification Using PyTorch in Visual Studio Magazine

I wrote an article titled “Ordinal Classification Using PyTorch” in the October 2021 edition of the Microsoft Visual Studio Magazine. See https://visualstudiomagazine.com/articles/2021/10/04/ordinal-classification-pytorch.aspx. The goal of an ordinal classification problem is to predict a discrete value, where the set of possible … Continue reading

Posted in PyTorch | Leave a comment

A Sentence Fill-in-The-Blank Example Using Hugging Face

Deep neural transformer architecture (TA) systems have revolutionized the field of natural language processing (NLP). Unfortunately, TA systems are incredibly complex and implementing such a system from scratch can take months. Enter the Hugging Face code library. Terrible name, excellent … Continue reading

Posted in Machine Learning, PyTorch | Leave a comment

Computing the Similarity Between Two Machine Learning Datasets in Visual Studio Magazine

I wrote an article titled “Computing the Similarity Between Two Machine Learning Datasets” in the September 2021 edition of Microsoft Visual Studio Magazine. See https://visualstudiomagazine.com/articles/2021/09/20/dataset-similarity.aspx. A common task in many machine learning scenarios is the need to compute the similarity … Continue reading

Posted in Machine Learning, PyTorch | Leave a comment

Finding Reliable Negatives For Positive and Unlabeled Learning (PUL) Datasets

Suppose you have a machine learning dataset for training, where only a few data items have a positive label (class = 1), but all the other data items are unlabeled and could be either negative (class = 0) or positive. … Continue reading

Posted in Machine Learning, PyTorch | Leave a comment

Natural Language Question-Answering Using Hugging Face

I’m currently on a multi-week mission to explore the Hugging Face (HF) code library for Transformer Architecture (TA) systems for natural language processing (NLP) and today I did a question-answer (QA) example. Whew! That’s a lot of acronyms in an … Continue reading

Posted in PyTorch | Leave a comment

Determining If Two Sentences Are Paraphrases Of Each Other Using Hugging Face

Deep neural systems based on Transformer Architecture (TA) have revolutionized the field of natural language processing (NLP). Unfortunately, TA systems are insanely complex, meaning that implementing a TA system from scratch is not feasible, and implementing TA using a low-level … Continue reading

Posted in PyTorch | Leave a comment