Machine Learning Engineering

Signal Processing – Filters

Signal Processing – Filters

Hung ManhAug 24, 20232 min read

Never really have been working with signals before, I first needed a basic fundamental understanding of filters. The following are my notes about low-pass and high-pass filters taking of the youtube video made by ritvikmath. Terminology low frequency: signal doesn’t…

How to divide two timestamps in equal chunks

How to divide two timestamps in equal chunks

Hung ManhAug 9, 20233 min read

TLDR: pd.date_range(start=s, end=e, periods=period) Task Given two timestamps, how to create equally spaced out times between them? My first thought, when it comes to creating evenly spaced numbers is using linspace. This would require transforming the datetimes into unix timestamps,…

PyTorch – expected scalar type Float but found Double

PyTorch – expected scalar type Float but found Double

Hung ManhDec 14, 20222 min read

TLDR: The default datatype of a numpy array translates to double/float64. If a Tensor is created from that array using torch.as_tensor it will adopt that datatype, which is not compatible with the default datatype of a neural network model which…

Training languagemodel – RuntimeError the expanded size of the tensor (100) must match the existing size (64) at non singleton dimension 1.

Training languagemodel – RuntimeError the expanded size of the tensor (100) must match the existing size (64) at non singleton dimension 1.

Hung ManhJul 4, 20221 min read

Context I trained a new languagemodel from scratch using huggingface’ framework and a preconfiguration of Roberta Model on a custom dataset. Now i wanted to vectorize a new dataset using the pretrained model. Observation I receive an error: RuntimeError the…

SentenceTransformer – float object is not subscriptable

SentenceTransformer – float object is not subscriptable

Hung ManhJun 1, 20222 min read

TLDR: np.nan objects are of type float Observation I was trying to apply the SentenceTransformer (v2.2.0) on a list of custom documents to create embeddings for each of them, however i would get the error “TypeError: ‘float’ object is not…

Visual Explanation of Multi Head Attention

Visual Explanation of Multi Head Attention

Hung ManhMay 28, 20225 min read

Why does changing the number of heads not change the number of parameters in the model? – That was the question i was asking myself. After drawing out the matrix multiplication and having gained the insight, i’d like to share…

How to evaluate the Transformer Trainer

How to evaluate the Transformer Trainer

Hung ManhMay 4, 20222 min read

If you initialized a Trainer object, it will do the training boiler plate for you. Using the TrainingArguments, you can additionally customize your training process. One important argument is the evaluation_strategy which is set to “no” by default, thus no…

Difference between the Tokenizer and the PreTrainedTokenizer class

Difference between the Tokenizer and the PreTrainedTokenizer class

Hung ManhMar 17, 20224 min read

I just got tossed into the cold water of the 🤗 Transformer framework and had some initial troubles with understanding the components. I’d like to write down my understanding of the Tokenizer and on how to add special_tokens to them,…

How To Calculate the mean Average Precision (mAP) in object detection- an overview

How To Calculate the mean Average Precision (mAP) in object detection- an overview

Hung ManhDec 2, 202012 min read

As a grad student, just entering the world of object detection i found it quite helpful, that there are a lot of resources especially blog posts, made easy to quickly digest complex concepts and ideas. If you type in related…

hungsblog | Nguyen Hung Manh | Dresden
Scroll to Top