Odin Hoff Gardå

↪︎ Projects

A collection of my coding and research projects.

Below are some of the projects I’ve worked on recently.

Pixelizer

GitHub Repo

A simple Streamlit tool I put together quickly for my own use to pixelate images with custom color palettes and optional dithering. It supports palette imports, including HEX files from Lospec.com, does not use AI, and can be used both for compressing images for the web and for creating pixel art-like images.

RAG-based Personal Chatbot

Now you can chat with me (link) without me being online! This was a hobby project to create a personal chatbot using Retrieval-Augmented Generation (RAG) techniques. A collection of Markdown files about me are chunked and embedded into a vector database using Chonkie and Chroma, respectively. Combining this with the Llama-3.1 8B Instruct language model using the Hugging Face inference API, I built...

Chatbot from Scratch

GitHub Repo

For the course “Deep Learning (INF265)” at the University of Bergen (UiB) in the spring of 2025, I created a project where the goal was to implement a transformer model from scratch and train it on a dataset of question-answer pairs. The model is a decoder-only transformer that uses causal self-attention to generate answers to short questions. This is similar to the GPT-2 architecture,...

Traffic Volume Forecasting with Graph Neural Networks

GitHub Repo

Can we use geometric priors to improve traffic volume forecasting? In this project, we use Graph Neural Networks (GNNs) to predict traffic volume in western Norway (Bergen area) using historical traffic data. Using both a manually crafted graph encoding road connectivity and a nearest neighbor graph based on sensor locations. I did this project as part of the course INF367A on geometric deep...

Solving NRK's Former with Monte Carlo Tree Search

GitHub Repo

In this project, I implemented the Single-Player Monte Carlo Tree Search (SP-MCTS) (Schadd et al., 2008) algorithm to solve NRK Former, a puzzle game developed by the Norwegian Broadcasting Corporation (NRK). The goal of the game is to remove all blocks from a 9x7 grid using as few moves as possible by clicking on connected blocks of the same color.

Check out the repository and try it out...

3D Point Cloud Classification with Geometric Deep Learning

GitHub Repo

This repository contains code for conducting experiments on 3D point cloud classification using various geometric deep learning architectures. The experiments are performed on the ModelNet40 dataset, which consists of 3D models from 40 different categories. The starting point for this repository was the DeepSets architecture for permutation invariant learning on sets (for example point clouds). We...

Group Equivariant Convolutional Neural Networks

GitHub Repo

The goal of this project was to implement and compare group equivariant convolutional neural networks (GCNNs) against standard convolutional neural networks (CNNs) and a smoothed version of CNNs (averaging over all group symmetries) on a binary stereo image classification task (sunny or rainy weather). The group considered in this project is the dihedral group of order 8 which acts on stereo...

Dentology: Topology for Dentists

GitHub Repo

Using topological data analysis (TDA) to detect cavities in 3D models of teeth. This is done by computing the persistent homology of the sublevel sets of a height function on the tooth surface. The idea is that cavities will correspond to topological features (specifically, 1-dimensional holes) that persist over a wide range of height values. This was an April Fools project I made for fun, but the...

Codenames Spymaster Bot

GitHub Repo

In this project, I developed a spymaster bot for the popular board game Codenames using pre-trained word embeddings and a scoring function inspired by contrastive learning methods. The bot generates clues by analyzing the relationships between words in the game, aiming to connect multiple words from the same team while avoiding words associated with the opposing team, neutral words, and the...

SimCLR from Scratch

GitHub Repo

In this project, I implemented SimCLR for self-supervised learning of embeddings of plankton image data. The main components were the random augmentation module, the projection head, and the NT-Xent based loss function. I observed that SimCLR performed best on this small dataset compared to other models, likely due to its ability to learn general features without overfitting. It would be...

Python Crash Course for INF264

GitHub Repo

A Python crash course on NumPy and Matplotlib I made for students taking the course INF264 – Introduction to Machine Learning at the University of Bergen. It consists of Jupyter notebooks covering the basics of NumPy and Matplotlib with exercises to practice. It also comes with solutions to the exercises and a guide on how to set up a Python environment using Anaconda.

ArcFace and Triplet Network

GitHub Repo

In this project, I implemented a Triplet Network with various online mining strategies to improve training, and the Angular Margin Loss from ArcFace. The goal was to create latent representations of plankton images and compare performance on the downstream task of training a simple classifier on embeddings. Both models achieved good separation on average for all classes in the training data, but...

Q-Learning Tutorial in Norwegian

GitHub Repo

This is a tutorial I made for students taking INF100 (Introduction to Programming) in spring 2024. Our goal is to create a program where an agent learns to solve a maze using Q-learning, a form of reinforcement learning. The repository contains a step-by-step guide to implementing the Q-learning algorithm in Python, along with the slides I used for the accompanying lecture. Note that the tutorial...

Ordl - Wordle clone for your terminal

GitHub Repo

A simple terminal-based Wordle clone written in Python, designed for quick gameplay while waiting for machine learning models to train. The game uses a dictionary of five-letter Norwegian words, but the word list can swapped out for other languages or custom lists.

SLEDE8 Disassembler

GitHub Repo

A simple disassembler for the esoteric programming language SLEDE8, invented by PST (Norwegian Police Security Service) for one of their Christmas CTFs. Probably not useful for anything now that the CTF is over, but I made it for fun and as a learning exercise in Python.