All Post
What AI taught me
So i was browsing the web and came across this paper A high-order recombination algorithm for weak approximation of stochastic differential equations a way above my intelligence level, but I always wondered how people use these crazy alien looking equations.
So i copy and pasted it to ChatGPT and the first explanation was again way over my intelligence level so I had it explain to me as if i was a teenager
Sure — here’s a simple way to think about it:
Imagine you’re trying to learn the best way to do something, like win a game or solve a puzzle. You don’t know the perfect strategy yet, so at each step, you mix different ideas (strategies) and try them out to see what works best.
Now, think of each idea or strategy as a "player" in your team. At each round (call it step i), you have some confidence in each player — that's what the weights αj\alpha_j represent. The more confident you are, the bigger the weight.
The equation is basically saying:
"Hey, after I apply this smart learning rule (called Alg and Q), I take my current team mix and recalculate my new team (for the next step, i+1) by seeing how well each idea transfers over using a table of scores (that’s the weight matrix w(i))."
So you're updating your mix of strategies based on how much each old idea contributes to new ideas in the next round.
It’s like upgrading your strategy team over time, keeping track of who’s helping the most and adjusting your trust in them.
So stoked! Who wouldn't want to know an algorithm to help them find the best way to do something? I love when I randomly come across such useful information on the web its like "Internet Gold".
Now how can I apply this in real life? I ask chatGPT to show me in a language I can understand.
Here’s an interactive version of the strategy learning loop in PHP CLI — it asks you (the user) to give feedback manually for each strategy in each round (e.g., "Did the user like the content? Yes or No?").
This simulates you being the decision-maker or tester of each strategy.
<?php
$strategies = ['popular_videos', 'similar_likes', 'geo_trending'];
$alpha = [0.4, 0.4, 0.2];$w = [
[0.6, 0.3, 0.1],
[0.2, 0.6, 0.2],
[0.1, 0.3, 0.6]
];function normalize($vector) {
$sum = array_sum($vector);
return array_map(fn($v) => round($v / $sum, 3), $vector);
}function ask($prompt) {
echo $prompt . " (y/n): ";
$handle = fopen ("php://stdin","r");
$line = fgets($handle);
return strtolower(trim($line)) === 'y' ? 1 : 0;
}function showBar($label, $value, $width = 30) {
$barLength = round($value * $width);
$bar = str_repeat("█", $barLength);
printf("%-18s [%-30s] %.2f\n", $label, $bar, $value);
}for ($round = 1; $round <= 10; $round++) {
echo "\n=== Round $round ===\n";// Collect feedback
$feedback = [];
foreach ($alpha as $i => $weight) {
$strategy = $strategies[$i];
$reward = ask("Did the user like content from '{$strategy}'?");
$feedback[$i] = $weight * $reward;
}// Update using transition matrix
$newAlpha = array_fill(0, count($strategies), 0);
foreach ($feedback as $k => $scaled_weight) {
foreach ($strategies as $j => $_) {
$newAlpha[$j] += $scaled_weight * $w[$k][$j];
}
}// Normalize
$alpha = normalize($newAlpha);// Display new weights visually
echo "\nUpdated Strategy Weights:\n";
foreach ($strategies as $i => $s) {
showBar($s, $alpha[$i]);
}
}
Output example:
=== Round 3 ===
Did the user like content from 'popular_videos'? (y/n): y
Did the user like content from 'similar_likes'? (y/n): n
Did the user like content from 'geo_trending'? (y/n): yUpdated Strategy Weights:
popular_videos [███████████████████████ ] 0.65
similar_likes [██ ] 0.07
geo_trending [█████████ ] 0.28
Its pretty awesome how ChatGPT was able to take a random alien looking equations I found and break it down in a way that I can understand and even apply in my own projects.
I dive much deeper, but dont want to bore you, if your interested here is the conversation here
Training AI what I like, and then have it swipe for me.
Had some time, so I figured Id train my first AI model—to see if I could teach a computer what I’m into and let it swipe for me on dating apps.
How I Taught My AI to Swipe Right for Me
So I got tired of dating apps sucking up my time. Endless swiping? Nope. I decided to outsource my type... to AI.
Step 1: Borrowed Some Faces
First, I grabbed about 2,200 images from a dating site. Don’t worry, it's for science. These were going to be my model’s brain food.
Step 2: Labeled for Love
Next, I split the photos into two folders:
🔥 Hot and 🚫 Not.
This part was personal—and brutally honest. But hey, the model’s gotta know what I like.
Step 3: Cleaned It Up
Before feeding the images to the machine, I used TensorFlow to clean them. I detected the face, cropped out the noise, and converted everything to grayscale.
Less distraction. More learning.
Step 4: Made It Smart
Time to train the model. Python + TensorFlow = magic.
After a few training cycles, it could tell what I find attractive with scary accuracy. Like, better-than-my-friends accuracy.
Step 5: Let It Swipe
Now the fun part: action.
I connected it to a stream of dating profiles, and it started rating them on my behalf.
High score? Like.
Low score? Pass.
Easy. Efficient. Kind of weird? Sure. But it works.
This isn’t just a tech flex. It’s a reminder of what’s possible when you mix passion, Python, and a pinch of narcissism. 😎
Want to build your own personalized AI or automate something smarter?
Get in touch with InternetTechnologyServices.com or hit up Nick Nguyen—yes, that’s me. Let’s build something that thinks like you do.
And yes, my AI still swipes on the weekends. 💘
Longest Ride 184 Miles
My 89 Mile Solo Cycling Journey during COVID lockdown
Tracking OC COVID-19 progression per city
The pandemic has ended thank god! Unfortunately the data is no longer avaliable so i can longer provide a live example but here is a screen shot of what the program looked like.
Thanks to the current pandemic lock down, I have even more extra time on my hands. So i wrote a program that collects the OC gov's COVID data per city, so i can play with the data and maybe see which cities to avoid...Originally when i started Irvine and Newport Beach had the most cases, but then Anaheim quickly jumped to the the top in a few days alongside Irvine (as of april 7th). Southern cities have had minimal cases.
KOM’ed on Strava, Holding #1 on FITIV, and Update on Progression
Aliso Creek Trail loop
See my beautiful regular cycling route
For anyone following the COVID-19 aka coronavirus
My 2 best rides for 2019
So i started cycling in december and managed to put in 300 miles in my first month. something i never even thought was possible. What helped keep me engage was the strava app as it appeals to my competitive spirit, and using the latest technology to monitor and measure my biofeedback, learning about all the health variables and watching there progression over time also helped keep me motivated, most fasinating was learning about the heart rate variable and all that it entails. so in 2019 i completed lofty rides that i never thought was even possible for myself.
laguna niguel to oceanside
riding for 9 miles on the freeway was interesting to say the least.
laguna niguel to newport beach
great network of bike trails from irvine all the way to newport, i plan to do a “there and back” trip this month some time.
i plan to cycle the entire southern california coast from the north end of LA to San diego in the month of january. i also entered the january strava challenge 1250 km in one month. i am currently on track to get the trophy on it.
My latest hobby
Thanks to one my best friends for hooking me up with this mechanical masterpiece.
This trek domane is made of carbon fiber so its light as a feather, and like riding a bullet.
My goal is to ride from Laguna Niguel to Oceanside, and then take a train back, its just about a 40 mile ride, which is a lot for my out of shape ass. but do-able. So in preparation I’ve been training a couple times a week doing a beautiful 12 mile ride from my house in Laguna Niguel to the house my family is building in San Clemente, meanwhile learning about all the technology on the bike and how it applies to my own physical stats.
Syncing a lot of data from a directory to Amazon S3 Cloud
In an attempt to upload a directory 40+ Gigabytes worth of files on t0 Amazons S3.
Typically I use the AWS Console, but I ran into issues, I believe my browser was timing out. I tried a couple downloading and installing third party applications, the only success I got from that was possibly inheriting additional malware.
I did manage to find a solution, I tend to pass on the command line tools, but I was desperate, turns out in this instance command line is actually sooo much easier and stable, This is basically all I had to do.
Download AWS CLI and Install it
Open your terminal and run
aws configure
youll need to provide it your AWS ID, AWS KEY, Region, and a format (I choose JSON). Then all i had to do was run the following command to start syncing
aws s3 sync C://Your_Local_Directory_To_SYNC s3://your_S3_bucket
if you want to see more options simply run. You can sync bi-directionally or from s3 bucket to bucket by interchanging the last two parameters accordingly
aws s3 help
You are now free to do whatever it is you do.
Note: If you step away from your computer for too long or your computer goes inactive, this will discontinue your transfer. If that happens rerun the command to continue.