So while talking about Pokemon Go in the office, we got an idea to generate Pokemon names using a neural network.
The first step for this is gathering all the Pokemon names. Fortunately, I found this site that generates all the names of existing Pokemon in a text file.
Then we’ll be using Torch-RNN to train the neural network and produce new Pokemon names.
After some 5 minutes of training, here are the ouput:
For training, here’s the command used:
th train.lua -input_h5 data/pokemon.h5 -input_json data/pokemon.json -gpu -1 -batch_size 1 -seq_length 3
For generating the Pokemon names:
th sample.lua -checkpoint cv/pokemon.t7 -length 100 -gpu -1 -temperature 0.9
Where are PUVs in Metro Manila coming from?
I found a CSV file from data.gov.ph that contains all the PUV routes in Metro Manila. I then decided to check where are the PUVs coming from.
Here it is:
See the full image here.
Some notes:
Recently, a lot of people including me and my friends are passionately playing the Facebook Messenger’s hidden basketball game. We are competitive with each other.
Inspired by Flappy Bird RL, I decided to create an AI for FB Basketball game.
Here’s a sample screenshot:
Problem: No FB Basketball game in the web version of Messenger.
Without any choice, I recreated it using the HTML5 game framework called Phaser. It was the hardest part for me because I’m not really adept with javascript and game development in general.
After the game engine, I started creating the AI. I decided to use and study genetic algorithm because I’m really facinated with it.
Genetic algorithm (GA) is a search heuristic that mimics the process of natural selection.
via Wikipedia
I used this website as guide and pattern for the GA in this game. Most of the code in ga.py file is similar to it.
Specifics:
In the evolution phase:
Here’s another screenshot:
As seen above, red lines are the prospect angles (population) and the green line is the fittest (best) angle.
The highest score I got with this AI is 1110 (generations: 100) before it misses and I stopped running it again.
Here’s a video of the actual AI in action (generations: 3):
The AI missed in the first part of the video.
BONUS VIDEO: When your AI is now better than Stephen Curry in shooting the basketball (generations: 100)
View the whole code in Github: https://github.com/MojoJolo/fb_basketball
Note: Well, we can make it to never miss by computing the exact angle and trajectory. But it’s not the goal, and where’s the fun in it.
March 31, 2016There was a take home task that was assigned to me after an interview. The simple assignment was for me to show my capabilities in data mining and visualization. The task is to plot the earthquake data of 2014 in the Philippine map. The Philippine Institute of Volcanology and Seismology (PHIVOLCS) have this data, together with the coordinates in their website.
To start with the task, I copy paste the 2014 earthquake data in a text file. I then created a Python script to cleanse the data and produce a csv file out of it.
Here is a screenshot of the data in PHIVOLCS website:
And after running a simple Python script, here’s result:
With the data properly written in the csv file, I can now visualized it in a map. I decided to try and explore D3.js for the first time. Luckily, I found a tutorial in integrating Google maps and D3.js. While the tutorial is for json files, it still helps a lot and only need a minor tweaks for it to read my csv file.
After few modifications, I settled with the final result. Here it is:
Check out the full image here.
Notes:
If you need someone to visualized your data, check out DataTeaser. It’s the company I’m starting. We also offer NLP and machine learning services.
February 22, 2015TextTeaser, an open source automatic summarization algorithm that I started, is now part of DataTeaser.
DataTeaser is a data science and software engineering company that I’m starting. It will offer software services in natural language processing, machine learning, and data mining. With TextTeaser as part of the DataTeaser’s projects, we can also offer custom summarizers based on your company needs.
If your company needs summarizer or other NLP services, just send us an email.
You can also still check out the open source TextTeaser at Github.
February 21, 2015