GPT News Poet: silly AI poems based on today's news

Marton Trencseni - Sun 07 May 2023 • Tagged with gpt, python, gnews, ai

I show how I used GNews and the OpenAI API to build GPT News Poet, a fun toy site showing silly AI poems based on today's news.

ROC curve

Continue reading

Finding similar API functions between Pytorch and Tensorflow with Doc2Vec

Marton Trencseni - Wed 21 December 2022 • Tagged with similarity, python, word2vec, doc2vec, pytorch, tensorflow

I use Doc2Vec to try to find pairs of similar API functions between Pytorch and Tensorflow.

Tensorflow Pytorch

Continue reading

Similar posts recommendation with Doc2Vec - Part III

Marton Trencseni - Sat 10 December 2022 • Tagged with similarity, python, gensim, word2vec, doc2vec, pyml

In the previous posts, I used the Doc2Vec neural network architecture to compute the similarities between my blog posts, and explored the quality of the scores. In this final post, I show how I added the final Articles You May Like recommendation sections to the blog — it's live!

.

Continue reading

Similar posts recommendation with Doc2Vec - Part II

Marton Trencseni - Sun 04 December 2022 • Tagged with similarity, python, gensim, word2vec, doc2vec, pyml

In the previous post, I used the Doc2Vec neural network architecture to compute the similarities between my blog posts. In this second post I investigate the results further by examining clusters in graphs.

.

Continue reading

Similar posts recommendation with Doc2Vec - Part I

Marton Trencseni - Sat 03 December 2022 • Tagged with similarity, python, gensim, word2vec, doc2vec, pyml

One of the things I learned at Facebook is the power of recommendations. Examples are People You May Know (PYMK), Groups You May Like (GYML) and Pages You May Like (PYML). Inspired by these, I am planning to add an Articles You May Like widget to Bytepawn, based on the semantic similarity of blog posts. I use the Doc2Vec neural network architecture to compute the similarity between my blog posts, and return the top 3 recommendations for each page.

.

Continue reading

Optimal coverage for Wordle with Monte Carlo methods - Part III

Marton Trencseni - Sat 22 January 2022 • Tagged with wordle, monte-carlo

I present a simple Monte Carlo solution which finds a 25-letter-unique Worlde wordlist in about 10 minutes.

Wordle

Continue reading

Optimal coverage for Wordle with Monte Carlo methods - Part II

Marton Trencseni - Fri 21 January 2022 • Tagged with wordle, monte-carlo

I improve on the previous brute-force Monte Carlo approach for attacking the Wordle coverage problem.

Wordle

Continue reading

Optimal coverage for Wordle with Monte Carlo methods - Part I

Marton Trencseni - Wed 19 January 2022 • Tagged with wordle, monte-carlo

I show a simple brute-force Monte Carlo approach for attacking the Wordle coverage problem.

Wordle

Continue reading

Sometimes brute forcing just works

Marton Trencseni - Thu 06 May 2021 • Tagged with python

I describe a real world use-case where a simple, brute force search based solution worked really well, making more sophisticated Machine Learning unnecessary.

Sample receipt

Continue reading

Classification accuracy of quantized Autoencoders with Pytorch and MNIST

Marton Trencseni - Fri 09 April 2021 • Tagged with python, pytorch, cnn, torchvision, mnist, autoencoder

I measure how the classification accuracy of quantized Autoencoder neural network varies with encoding bits on MNIST digits.

Classifier accuracy on quantized Autoencoder output after quantization

Continue reading

Investigating information storage in quantized Autoencoders with Pytorch and MNIST

Marton Trencseni - Sun 04 April 2021 • Tagged with python, pytorch, cnn, torchvision, mnist, autoencoder

I investigate how much information an Autoencoder neural network encodes for MNIST digits.

Pytorch Autoencoder loss with encoding dimension and quantization bits

Continue reading

Training a Pytorch Classic MNIST GAN on Google Colab

Marton Trencseni - Tue 02 March 2021 • Tagged with python, pytorch, torchvision, mnist, gan

I train a Pytorch Classic MNIST GAN on Google Colab to generate MNIST digits.

Classic GAN Generated MNIST digits

Continue reading

Pytorch in 2019

Marton Trencseni - Thu 12 December 2019 • Tagged with pytorch

2019 was another big year for Pytorch, one of the most popular Deep Learning libraries out there. Pytorch has become the de facto deep learning library used for research thanks to it’s dynamic graph model which allows fast model experimentation. It’s also become production ready, with support for mobile and infrastructure tooling such as Tensorboard.

Pytorch Google Trends 2019

Continue reading

Calibration curves for delivery prediction with Scikit-Learn

Marton Trencseni - Thu 21 November 2019 • Tagged with machine, learning, fetchr, skl, calibration

I show calibration curves for four different binary classification Scikit-Learn models we built for delivery prediction at Fetchr, trained using real-world data: LogisticRegression, DecisionTree, RandomForest and GradientBoosting.

Logistic regression calibration curve

Continue reading

Using simulated self-play to solve all OpenAI Gym classic control problems with Pytorch

Marton Trencseni - Thu 14 November 2019 • Tagged with python, pytorch, reinforcement, learning, openai, gym

I use simulated self-play by ranking episodes by summed reward. Game outcomes are divided in two by cutting at the median, winners are assigned +1 rewards, losers are assigned -1 rewards, like in games like Go and Chess. Unlike naive policy gradient descent used in previous posts, this version solves all OpenAI classic control problems, albeit slowly.

OpenAI mountaincar

Continue reading

Applying policy gradient to OpenAI Gym classic control problems with Pytorch

Marton Trencseni - Tue 12 November 2019 • Tagged with python, pytorch, reinforcement, learning, openai, gym

I try to generalize the policy gradient algorithm as introduced earlier to solve all the OpenAI classic control problems. It works for CartPole and Acrobot, but not for Pendulum and MountainCar environments.

OpenAI classic control environments

Continue reading

Machine Learning at Fetchr

Marton Trencseni - Tue 29 October 2019 • Tagged with machine, learning, fetchr, skl

Opportunities for automating, optimizing and enabling processes with ML at a delivery company such as Fetchr are plentiful. We put three families of ML models into production. These 3 areas are: Scheduling, Notifications and Operational choice.

Operational choice

Continue reading

Solving the CartPole Reinforcement Learning problem with Pytorch

Marton Trencseni - Tue 22 October 2019 • Tagged with python, pytorch, reinforcement, learning, openai, gym, cartpole

The CartPole problem is the Hello World of Reinforcement Learning, originally described in 1985 by Sutton et al. The environment is a pole balanced on a cart. CartPole is one of the environments in OpenAI Gym, so we don't have to code up the physics. Here I walk through a simple solution using Pytorch.

Cartpole animation

Continue reading

Playing Go with supervised learning in Pytorch

Marton Trencseni - Sun 25 August 2019 • Tagged with python, pytorch, cnn, go

Using historic gameplay between strong Go players as training data, a CNN model is built to predict good Go moves on a standard 19x19 Go board.

Go prediction sample

Continue reading

Arabic name classification with Scikit-Learn and Pytorch

Marton Trencseni - Fri 02 August 2019 • Tagged with pytorch, skl, arabic, fetchr

While working on arabic-vs-rest classification, I was curious how good out-of-the-box models perform with publicly available data, and then compare that with what we can achieve with internal data / features derived from millions of deliveries. We train Scikit-learn and Pytorch models for this classification task and achieve 90% prediction accuracy on publicly available data and out-of-the-box models, while internally 99% is achievable.

ROC curve

Continue reading