<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hi, I'm Joel on jwhogg</title><link>https://jwhogg.github.io/</link><description>Recent content in Hi, I'm Joel on jwhogg</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 07 Dec 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://jwhogg.github.io/index.xml" rel="self" type="application/rss+xml"/><item><title>why-rs: A Causal Inference Library in Rust</title><link>https://jwhogg.github.io/portfolio/portfolio6/</link><pubDate>Sun, 07 Dec 2025 00:00:00 +0000</pubDate><guid>https://jwhogg.github.io/portfolio/portfolio6/</guid><description>&lt;p&gt;&lt;a href="https://github.com/jwhogg/why-rs"&gt;Github🔗&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;An under-development project, where I&amp;rsquo;m trying to build out a Causal Inference library in Rust. I found there wasn&amp;rsquo;t much in the way of CI libraries in Rust, and
I was underwhelemed with the level of support for the ones I&amp;rsquo;ve used in Python, so I decided to try and build my own, which I hope to make use of throughout
my PhD and extend to suit my purposes.&lt;/p&gt;</description></item><item><title>Radial Chess</title><link>https://jwhogg.github.io/portfolio/portfolio5/</link><pubDate>Sun, 01 Dec 2024 00:00:00 +0000</pubDate><guid>https://jwhogg.github.io/portfolio/portfolio5/</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/jwhogg/Radial-Chess-Backend"&gt;Github- Back end 🔗&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jwhogg/Radial-Chess-Frontend"&gt;Github- Front end 🔗&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- &lt;img width="60%" alt="Screenshot 2024-10-25 at 14 31 29" src="https://github.com/user-attachments/assets/eeb29645-a658-4d88-ac06-09dfc15afd10"&gt; --&gt;
&lt;p&gt;&lt;figure&gt;
 &lt;img
 src="https://jwhogg.github.io/images/radial_chess_ui.png#large"
 alt="Radial Chess UI"
 loading="lazy"
 
 /&gt;
 &lt;figcaption&gt;Radial Chess UI&lt;/figcaption&gt;
 &lt;/figure&gt;

&lt;span class="text-gray-500 text-sm"&gt;
 Radial Chess UI
&lt;/span&gt;
&lt;/p&gt;


&lt;h2 id="demo"&gt;
 Demo
&lt;/h2&gt;
&lt;!-- &lt;img width="60%" alt="Demo of a game" src="https://github.com/user-attachments/assets/65dc3ed1-da70-4d31-a273-349de6703df2"&gt; --&gt;
&lt;p&gt;&lt;figure&gt;
 &lt;img
 src="https://jwhogg.github.io/images/radial_chess_game.gif#large"
 alt="Radial Chess Demo"
 loading="lazy"
 
 /&gt;
 &lt;figcaption&gt;Radial Chess Demo&lt;/figcaption&gt;
 &lt;/figure&gt;

&lt;span class="text-gray-500 text-sm"&gt;
 Playing against myself
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;Inspired by the &lt;a href="https://www.youtube.com/watch?v=7VSVfQcaxFY"&gt;heorics&lt;/a&gt; of lichess.org&amp;rsquo;s single developer, I decided to try to create a similar web-based online chess app, with matchmaking. The main goal of this project is to use my knowledge of system design to make a robust and scalable app that could theoretically handle a large number of users. This involves knowlege of infastructure tools, and overcoming dificulties such as scaling a Web-Socket app (hint: you will need sticky sessions for your load-balancer!).&lt;/p&gt;</description></item><item><title>Edge AI: ML inference in the browser</title><link>https://jwhogg.github.io/articles/ml_inference_browser/</link><pubDate>Tue, 18 Jun 2024 00:00:00 +0000</pubDate><guid>https://jwhogg.github.io/articles/ml_inference_browser/</guid><description>&lt;p&gt;Recently, I stumbled across a &lt;a href="https://whisper.ggerganov.com/"&gt;guy who ported&lt;/a&gt; OpenAI&amp;rsquo;s &lt;a href="https://github.com/openai/whisper"&gt;Whisper&lt;/a&gt; model into c++, in various sizes, allowing the model to be run on-device, at impressive speed.&lt;/p&gt;
&lt;!-- &lt;span class="text-gray-500 text-sm"&gt;
 [(source)](https://github.com/ggerganov/whisper.cpp) 
&lt;/span&gt;
 --&gt;
&lt;!-- ![whisper running on iphone](/images/whisper_iphone.gif#smaller) --&gt;
&lt;p&gt;I went down a rabbit-hole, and found a whole family of popular models that had been ported to work on-device, from the browser:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://websd.mlc.ai/#text-to-image-generation-demo"&gt;Stable difusion running in browser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jobergum/browser-ml-inference?tab=readme-ov-file"&gt;Text emotion prediction in browser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ggerganov/llama.cpp"&gt;Llama c++&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webllm.mlc.ai/"&gt;Web LLM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hyuto.github.io/yolov5-onnxruntime-web/"&gt;YOLO in the browser&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;
 &lt;img
 src="https://jwhogg.github.io/images/yolo_browser.webp#smaller"
 alt="yolo in the browser"
 loading="lazy"
 
 /&gt;
 &lt;figcaption&gt;yolo in the browser&lt;/figcaption&gt;
 &lt;/figure&gt;
&lt;/p&gt;</description></item><item><title>Word2Vec Overview</title><link>https://jwhogg.github.io/articles/word2vec_intro/</link><pubDate>Wed, 12 Jun 2024 00:00:00 +0000</pubDate><guid>https://jwhogg.github.io/articles/word2vec_intro/</guid><description>&lt;p&gt;In this article we will introduce the context surrounding word2vec, including the motivation for distributed word embeddings, how the Continious Bag-of-Words and Skip-gram algorithms work, and the advancements since the original paper was released. We will also go into the training of the neural network, so it is assumed you have some knowledge on this.&lt;/p&gt;
&lt;span class="text-gray-500 text-sm"&gt;
 
These 2 papers introduced word2vec to the world back in 2013: 
&lt;/span&gt;

&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;&lt;figure&gt;
 &lt;img
 src="https://jwhogg.github.io/images/word2vec_paper_1.webp#smaller"
 alt="paper1"
 loading="lazy"
 
 /&gt;
 &lt;figcaption&gt;paper1&lt;/figcaption&gt;
 &lt;/figure&gt;
&lt;/th&gt;
					&lt;th&gt;&lt;figure&gt;
 &lt;img
 src="https://jwhogg.github.io/images/word2vec_paper_2.webp#smaller"
 alt="paper2"
 loading="lazy"
 
 /&gt;
 &lt;figcaption&gt;paper2&lt;/figcaption&gt;
 &lt;/figure&gt;
&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;span class="text-gray-500 text-sm"&gt;
 [Word2Vec Paper 1](https://arxiv.org/pdf/1301.3781)- introducing CBOW and Skip-Gram
&lt;/span&gt;
&lt;/td&gt;
					&lt;td&gt;&lt;span class="text-gray-500 text-sm"&gt;
 [Word2Vec Paper 2](https://arxiv.org/pdf/1310.4546)- Performance Improvements
&lt;/span&gt;
&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;


&lt;h3 id="motivation"&gt;
 Motivation
&lt;/h3&gt;
&lt;p&gt;For many NLP tasks, we need to learn on data which can&amp;rsquo;t be easily represented numerically. For example, let&amp;rsquo;s look at the popular &lt;a href="https://huggingface.co/datasets/stanfordnlp/imdb/viewer/plain_text/train"&gt;IMDB dataset&lt;/a&gt;, which gives reviews in one column, and a binary sentiment label in the next:&lt;/p&gt;</description></item><item><title>Budgeting App</title><link>https://jwhogg.github.io/portfolio/portfolio3/</link><pubDate>Tue, 04 Jun 2024 00:00:00 +0000</pubDate><guid>https://jwhogg.github.io/portfolio/portfolio3/</guid><description>&lt;p&gt;&lt;a href="https://github.com/jwhogg/Rails-Burndown-Budgeting-App"&gt;Github 🔗&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On ongoing project of mine, taking inspriation from Monzo&amp;rsquo;s budgeting burndown feature. I&amp;rsquo;m building this web app with Ruby-on-Rails, and using the GoCardless API to handle linking user&amp;rsquo;s bank accounts to the app securely.&lt;/p&gt;
&lt;!-- &lt;img src="https://jwhogg.github.io/images/monzo_burndown.png" alt="The inspiration for the project: monzo's 'targets' tab." width="60%"&gt; --&gt;
&lt;p&gt;&lt;figure&gt;
 &lt;img
 src="https://jwhogg.github.io/images/monzo_burndown.webp#smaller"
 alt="budgeting inspo"
 loading="lazy"
 
 /&gt;
 &lt;figcaption&gt;budgeting inspo&lt;/figcaption&gt;
 &lt;/figure&gt;

&lt;span class="text-gray-500 text-sm"&gt;
 The inspiration for the project: monzo's 'targets' tab.
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;So far, I am building the MVP, and have implemented functionality to link a bank account with the app, and to store the user&amp;rsquo;s key to access their bank account data using server-side sessions, which are much more secure than cookies sesion storage.&lt;/p&gt;</description></item><item><title>Fine-tuning GPT2-2</title><link>https://jwhogg.github.io/portfolio/portfolio4/</link><pubDate>Tue, 04 Jun 2024 00:00:00 +0000</pubDate><guid>https://jwhogg.github.io/portfolio/portfolio4/</guid><description>&lt;p&gt;&lt;a href="https://github.com/jwhogg/GPT-2-Fine-Tuning/tree/main"&gt;Github 🔗&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A brief jupyter notebook I made showing how to fine tune a model using the 🤗 Transformers libary. The example I wrote uses the popular CNN/DailyMail dataset.&lt;/p&gt;</description></item><item><title>Youtube2Summary</title><link>https://jwhogg.github.io/portfolio/portfolio1/</link><pubDate>Mon, 03 Jun 2024 00:00:00 +0000</pubDate><guid>https://jwhogg.github.io/portfolio/portfolio1/</guid><description>&lt;p&gt;&lt;a href="https://github.com/jwhogg/youtube_to_summary"&gt;Github 🔗&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;🤗 Pipeline to generate summaries of youtube videos, using Whisper-Small for transcription, and BART-LARGE-XSUM for summarisation.&lt;/p&gt;
&lt;p&gt;BART has been finetuned on the popular CNN/Daily Mail Dataset, as it lends itself to summarisation tasks. Initially, we attempted to fine-tune GPT-2 for the summarisation task, but found it had poor performance: being a generative transfotmer, it generates words one-by-one, (extractive summarisation) whereas BART can generate at the sentence level (using abstractive summarisation). For more info on choice of summarisation model, see this article. We use the HuggingFace Transformers libary to abstract some of the PyTorch code using the pipeline submodule.&lt;/p&gt;</description></item><item><title>Implementing Word2Vec in python</title><link>https://jwhogg.github.io/articles/word2vec_code_overview/</link><pubDate>Fri, 31 May 2024 17:25:04 +0100</pubDate><guid>https://jwhogg.github.io/articles/word2vec_code_overview/</guid><description>&lt;p&gt;We will be implementing the Neural Network for the Continuous Bag of Words (CBOW) from the word2vec paper. This article assumes you have a good understanding of the high-level of word2vec. This will be covered in coming articles also.&lt;/p&gt;
&lt;p&gt;Our goal is to train with sample pairs $(y,X)$, where $y$ is the target word, and $X$ is one of the context words from within the window.
&lt;figure&gt;
 &lt;img
 src="https://jwhogg.github.io/images/word2vec_nn_diagram.png"
 alt="Neural Network for Word2Vec"
 loading="lazy"
 
 /&gt;
 &lt;figcaption&gt;Neural Network for Word2Vec&lt;/figcaption&gt;
 &lt;/figure&gt;
&lt;/p&gt;</description></item><item><title>Fine-tuning a pre-trained model from HuggingFace</title><link>https://jwhogg.github.io/articles/finetuning_pretrained_model/</link><pubDate>Fri, 24 May 2024 13:29:04 +0100</pubDate><guid>https://jwhogg.github.io/articles/finetuning_pretrained_model/</guid><description>&lt;p&gt;We will be using a 🤗 &lt;a href="https://huggingface.co/"&gt;HuggingFace&lt;/a&gt; model (&lt;a href="https://huggingface.co/openai-community/gpt2-medium"&gt;GPT-2 Medium&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;📙&lt;strong&gt;&lt;a href="https://github.com/jwhogg/GPT-2-Fine-Tuning/blob/main/GPT-2%20Fine-tuning%20CNNDailyMail.ipynb"&gt;Jupyter Notebook Link&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;


&lt;h3 id="create-traintest-split-for-custom-dataset"&gt;
 Create train/test split for custom dataset
&lt;/h3&gt;
&lt;p&gt;(can use sklearn for this)&lt;/p&gt;


&lt;h3 id="get-the-model-tokeniser"&gt;
 Get the model tokeniser
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="font-weight:bold;text-decoration:underline"&gt;from&lt;/span&gt; &lt;span style="color:#666;font-weight:bold;font-style:italic"&gt;transformers&lt;/span&gt; &lt;span style="font-weight:bold;text-decoration:underline"&gt;import&lt;/span&gt; AutoTokenizer
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tokenizer = AutoTokenizer.from_pretrained(&lt;span style="color:#666;font-style:italic"&gt;&amp;#34;your-model-here&amp;#34;&lt;/span&gt;) &lt;span style="color:#888;font-style:italic"&gt;#eg &amp;#34;bert-base-cased&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="create-encodings-for-traintest-using-tokeniser"&gt;
 Create encodings for train/test using tokeniser
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="font-weight:bold;text-decoration:underline"&gt;def&lt;/span&gt; &lt;span style="color:#666;font-weight:bold;font-style:italic"&gt;tokenize_function&lt;/span&gt;(examples):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="font-weight:bold;text-decoration:underline"&gt;return&lt;/span&gt; tokenizer(examples[&lt;span style="color:#666;font-style:italic"&gt;&amp;#34;text&amp;#34;&lt;/span&gt;], padding=&lt;span style="color:#666;font-style:italic"&gt;&amp;#34;max_length&amp;#34;&lt;/span&gt;, truncation=&lt;span style="font-weight:bold;text-decoration:underline"&gt;True&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tokenized_datasets = raw_datasets.map(tokenize_function, batched=&lt;span style="font-weight:bold;text-decoration:underline"&gt;True&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#888;font-style:italic"&gt;# where raw_datasets is a dict with train/dev/test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;we need padding as the inputs must fit the models input even if they are too short&lt;/li&gt;
&lt;/ul&gt;


&lt;h5 id="create-small-datasets-for-development"&gt;
 Create small datasets for development
&lt;/h5&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;small_train_dataset = tokenized_datasets[&lt;span style="color:#666;font-style:italic"&gt;&amp;#34;train&amp;#34;&lt;/span&gt;].shuffle(seed=42).select(&lt;span style="font-weight:bold;font-style:italic"&gt;range&lt;/span&gt;(1000)) 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;small_eval_dataset = tokenized_datasets[&lt;span style="color:#666;font-style:italic"&gt;&amp;#34;test&amp;#34;&lt;/span&gt;].shuffle(seed=42).select(&lt;span style="font-weight:bold;font-style:italic"&gt;range&lt;/span&gt;(1000)) 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;full_train_dataset = tokenized_datasets[&lt;span style="color:#666;font-style:italic"&gt;&amp;#34;train&amp;#34;&lt;/span&gt;]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;full_eval_dataset = tokenized_datasets[&lt;span style="color:#666;font-style:italic"&gt;&amp;#34;test&amp;#34;&lt;/span&gt;]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;use the full ones once you have all params figured out and want to do the final training&lt;/li&gt;
&lt;/ul&gt;


&lt;h3 id="import-model"&gt;
 Import model
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="font-weight:bold;text-decoration:underline"&gt;from&lt;/span&gt; &lt;span style="color:#666;font-weight:bold;font-style:italic"&gt;transformers&lt;/span&gt; &lt;span style="font-weight:bold;text-decoration:underline"&gt;import&lt;/span&gt; GPT2Tokenizer, GPT2Model
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tokenizer = GPT2Tokenizer.from_pretrained(&lt;span style="color:#666;font-style:italic"&gt;&amp;#39;gpt2-medium&amp;#39;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;model = GPT2Model.from_pretrained(&lt;span style="color:#666;font-style:italic"&gt;&amp;#39;gpt2-medium&amp;#39;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="training"&gt;
 Training
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Transformers&lt;/em&gt; has a &lt;code&gt;Trainer&lt;/code&gt; class that can speed up training of models, and does a lot of the work for us&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Trainer&lt;/code&gt; is defined as a dict of arguments and a &lt;code&gt;compute_metrics&lt;/code&gt; function, but first we need to define these:&lt;/li&gt;
&lt;/ul&gt;


&lt;h5 id="training-args"&gt;
 Training args:
&lt;/h5&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="font-weight:bold;text-decoration:underline"&gt;from&lt;/span&gt; &lt;span style="color:#666;font-weight:bold;font-style:italic"&gt;transformers&lt;/span&gt; &lt;span style="font-weight:bold;text-decoration:underline"&gt;import&lt;/span&gt; TrainingArguments
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;training_args = TrainingArguments(&lt;span style="color:#666;font-style:italic"&gt;&amp;#34;test_trainer&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#888;font-style:italic"&gt;#use just default args to start with&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#888;font-style:italic"&gt;#add arg: evaluation_strategy=&amp;#34;epoch&amp;#34; to report metrics every epoch&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h4 id="configure-training-metrics"&gt;
 Configure training metrics
&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Trainer&lt;/em&gt; can take a &lt;code&gt;compute_metrics()&lt;/code&gt; function, which takes predictions and labels (in a tuple), and returns a dict with metric names and values&lt;/li&gt;
&lt;li&gt;we can use the &lt;em&gt;Datasets&lt;/em&gt; library to get access to common metrics
&lt;ul&gt;
&lt;li&gt;&amp;lsquo;accuracy&amp;rsquo; is one of these&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="font-weight:bold;text-decoration:underline"&gt;import&lt;/span&gt; &lt;span style="color:#666;font-weight:bold;font-style:italic"&gt;numpy&lt;/span&gt; &lt;span style="font-weight:bold;text-decoration:underline"&gt;as&lt;/span&gt; &lt;span style="color:#666;font-weight:bold;font-style:italic"&gt;np&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="font-weight:bold;text-decoration:underline"&gt;from&lt;/span&gt; &lt;span style="color:#666;font-weight:bold;font-style:italic"&gt;datasets&lt;/span&gt; &lt;span style="font-weight:bold;text-decoration:underline"&gt;import&lt;/span&gt; load_metric
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;metric = load_metric(&lt;span style="color:#666;font-style:italic"&gt;&amp;#34;accuracy&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="font-weight:bold;text-decoration:underline"&gt;def&lt;/span&gt; &lt;span style="color:#666;font-weight:bold;font-style:italic"&gt;compute_metrics&lt;/span&gt;(eval_pred):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; logits, labels = eval_pred &lt;span style="color:#888;font-style:italic"&gt;#splitting tuple into the output logits and their labels&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; predictions = np.argmax(logits, axis=-1) &lt;span style="color:#888;font-style:italic"&gt;#convert logits into predictions&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="font-weight:bold;text-decoration:underline"&gt;return&lt;/span&gt; metric.compute(predictions=predictions, references=labels) &lt;span style="color:#888;font-style:italic"&gt;#calc predict accuracy&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="define-trainer"&gt;
 Define Trainer
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="font-weight:bold;text-decoration:underline"&gt;from&lt;/span&gt; &lt;span style="color:#666;font-weight:bold;font-style:italic"&gt;Transformers&lt;/span&gt; &lt;span style="font-weight:bold;text-decoration:underline"&gt;import&lt;/span&gt; Trainer
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;trainer = Trainer(
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; model=model,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; args=training_args,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; train_dataset=small_train_dataset,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; eval_dataset=small_eval_dataset,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; compute_metrics=compute_metrics,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="train-and-evaluate"&gt;
 Train and Evaluate:
&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;trainer.train()
trainer.evaluate()
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We are now done! the &lt;a href="https://huggingface.co/docs/transformers/v4.15.0/en/main_classes/trainer#transformers.TrainingArguments"&gt;training args&lt;/a&gt; or dataset can be tweaked to try to improve performance&lt;/p&gt;</description></item><item><title>Notes on: Applying for jobs within tech/ML</title><link>https://jwhogg.github.io/articles/getting_an_ml_jpb/</link><pubDate>Thu, 23 May 2024 13:07:04 +0100</pubDate><guid>https://jwhogg.github.io/articles/getting_an_ml_jpb/</guid><description>&lt;p&gt;A collection of notes about articles I found useful when applying for jobs. Hopefully these can be of some use to others also.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.mrdbourke.com/get-a-machine-learning-job/"&gt;Summary of this article / video&lt;/a&gt;&lt;/p&gt;


&lt;h3 id="intro"&gt;
 Intro
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;can split getting an ML job into 2 steps:
&lt;ol&gt;
&lt;li&gt;Getting ML skills
&lt;ul&gt;
&lt;li&gt;building projects&lt;/li&gt;
&lt;li&gt;contributing to OS&lt;/li&gt;
&lt;li&gt;reading technical info&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Marketing ML skills
&lt;ul&gt;
&lt;li&gt;communication&lt;/li&gt;
&lt;li&gt;&lt;a href="https://huyenchip.com/ml-interviews-book/"&gt;interviewing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;portal creation&lt;/li&gt;
&lt;li&gt;passing application screening&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h3 id="strategies"&gt;
 Strategies:
&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Make ML jobs come to you by &lt;a href="https://www.swyx.io/learn-in-public"&gt;Learning in Public&lt;/a&gt;&lt;/strong&gt; (great article!)
Summary:&lt;/p&gt;</description></item><item><title>Causal Implicit GAN: Data Augmentation for Causal Discovery</title><link>https://jwhogg.github.io/portfolio/portfolio2/</link><pubDate>Tue, 16 May 2023 00:00:00 +0000</pubDate><guid>https://jwhogg.github.io/portfolio/portfolio2/</guid><description>&lt;p&gt;&lt;a href="https://github.com/jwhogg/CIGAN"&gt;Github 🔗&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;My University dissertation research project, where I designed and trained a GAN model for data augmentation (generating new training samples for downstream models). I was very proud to receive a score of 83 on this disseration (high 1st).&lt;/p&gt;
&lt;!-- &lt;img src="https://jwhogg.github.io/images/cigan.png" alt="A high-level overview of the CIGAN project" width="60%"&gt; --&gt;
&lt;p&gt;&lt;figure&gt;
 &lt;img
 src="https://jwhogg.github.io/images/cigan.webp#small"
 alt="cigan"
 loading="lazy"
 
 /&gt;
 &lt;figcaption&gt;cigan&lt;/figcaption&gt;
 &lt;/figure&gt;

&lt;span class="text-gray-500 text-sm"&gt;
 A high-level overview of the CIGAN project
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;The data the GAN generates is intended for use on Causal Discovery models, an area where quality ground-truth datasets are hard to come by- making data augmentation a valuable technique. The novel contribution of my project is that the GAN is designed to implicitly learn causal relations, which we hypothesise leads to more &amp;lsquo;realistic&amp;rsquo; output data.&lt;/p&gt;</description></item><item><title>Homepage</title><link>https://jwhogg.github.io/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://jwhogg.github.io/about/</guid><description>&lt;h1 id="hi-im-joel-"&gt;
 Hi, I&amp;rsquo;m Joel 👋
&lt;/h1&gt;
&lt;!-- &lt;div style="text-align: center;"&gt;
 &lt;img src="https://jwhogg.github.io/images/joelwater.jpg" alt="softmax demo" width="50%"&gt;
 &lt;p style="font-size: small; color: gray;"&gt;Me in Ha Long Bay&lt;/p&gt;
&lt;/div&gt; --&gt;
&lt;p&gt;&lt;strong&gt;Welcome to my digital garden!&lt;/strong&gt;&lt;/p&gt;
&lt;!-- NOTE TO SELF, UPDATE ABOUT FROM HUGO.TOML NOT HERE --&gt;
&lt;div style="display: flex;"&gt;
 &lt;div style="width: 50%; padding: 0px;"&gt;
 &lt;p&gt;This is a space for me to post notes, research, and longer articles on a varitey of subjects- mostly keeping within tech.
 &lt;/p&gt;
 &lt;p&gt;I'm a PhD student at the University of Sheffield, researching applying Causal Inference to Manufacturing. Currently, I'm developing [why-rs](https://github.com/jwhogg/why-rs), a Rust library for Causal Inference and Causal Discovery.
 &lt;/p&gt;</description></item></channel></rss>