Mohamed Hamlil
Français GitHub

What I build outside coursework

Five self-contained projects in machine learning, computer algebra and applied mathematics. Nobody assigned any of it, every number is produced by code in the repository, and CI reruns the checks on every push.

The one worth telling

A convolutional network learning Flappy Bird from nothing but rendered frames. The largest gain in the whole project came from the observation rather than from any hyperparameter. Reducing a frame to one channel is standard and the standard way is a luminance greyscale, but the bird is yellow and the sky is light blue, and those are nearly equiluminant: measured off the sprites, the bird stands out from the sky by 22 levels out of 255 in luminance and by 181 in the blue channel.

Greyscale was delivering the obstacles at three times the contrast of the bird itself, which is the one object whose position the policy most needs. With everything else held fixed, same seed and same hyperparameters, taking the blue channel instead moved the agent from 0.4 pipes to 12.65 at 250k steps. The greyscale run never passed 0.8 in 420k.

The six

Site Browse them all Every project on one page, with the animations and charts at full size. Optimisation Integer programming, exactly A two-phase simplex over exact rationals, then branch and bound. 200 random programmes agree with an enumeration of every whole point. RL Flappy Bird from pixels DQN reaching 12.21 pipes mean over 100 episodes, and a REINFORCE run that never cleared one, explained. Algebra 3-SAT over GF(2) Clauses as polynomials in the Boolean ring. 500 instances checked against exhaustive search with zero wrong verdicts. Maths Matrix algorithms from scratch FFT, Schur-complement determinant and an exact integer inverse, checked against NumPy to 1e-13. Graphics Sorting, rendered Bubble and merge sort keyframed through Blender's Python API so the access pattern is watchable. Applied French income tax The effective rate fitted per bracket, with Lambert W locating the inflection at 59 800 EUR.

How the animations are checked

The sorting animations and the branch and bound share one thing: the algorithm and the picture of it are separate programs. Each runs under plain Python and emits a trace — a line per thing it did, in the vocabulary of the problem, never of geometry. That is what lets CI check the algorithm actually did what the picture claims, which a video cannot show you, and it means two renderers can tell the same run differently. The sorts are keyframed in Blender; the tree below is drawn in SVG in your browser, from the same five verbs.

The branch and bound solving a four-item knapsack, replayed from its own trace. Drag the scrubber, or press play. A node is opened, bounded by its relaxation, and then pruned (grey), or found whole (gold), or split in two. The relaxation gives 44⁄5 at the root and the answer is 44, settled in nine nodes. Every bound is an exact rational: nothing here is ever a float, so a pruned branch provably cannot hold the answer.

What the SAT solver actually shows

Its own measurement is that the algebraic step is nearly inert: across the unsatisfiable instances tested, the elimination on its own caught almost none, and the branching does the work. The repository says so rather than burying it. It is also benchmarked below the phase transition, where most instances are satisfiable, which the write-up names as its own open item.