News for hackers. Stuff that matters.
Re:Tensorflow.js: Machine Learning in JavaScript by ml_basics on Monday June 08, 2020 @03:31AM (#23454402)
I recently wanted to learn how to use tf.js, so had a couple of mini-projects. The first is a minimal working example showing how to train a model in python and then load it in javascript.

https://github.com/paruby/mnist

The second is the classic game of snake, controlled by pointing your head in the direction you want to steer the snake.

https://github.com/paruby/snake-face/

This uses the MediaPipe Facemesh model with the device camera to work out which direction your head is pointing in.

Re:Tensorflow.js: Machine Learning in JavaScript by songzme on Monday June 08, 2020 @12:57PM (#23458312)
I have a hard time sorting through the ml logic vs the game logic, it would really help my learning (and others too) if the game logic was decoupled from the ml logic into 2 separate files.