In part 2, I introduced how to make the serpentine movement. We continue this article by covering the turning mechanism for the snake. Challenges in turning animation Fig 2: Classic snake game design with blocks and grids As we want our snake looks as smooth as possible, the two challenges are: Firstly, the head should slowly change to the target direction rather than a sudden turn. As the head...
Save, restore, visualise Graph with TensorFlow v2.0 & KERAS

TensorFlow 2.0 is coming really soon. Therefore, we quickly show some useful features, i.e., save and load a pre-trained model, with v.2 syntax. To make it more intuitive, we will also visualise the graph of the neural network model. Benefits of saving a model Quick answer: to save time, easy-share, and fast deploy. A SavedModel contains a complete TensorFlow program, including weights and...
Smooth nature snake game – re-dev with Kotlin (part 1)
When my students proposed a snake game for their projects, I thought it is kind of boring. They are all the same old ideas. Nevertheless, how you want it to be do matter as the game mechanics and animations can be much varied. snake game Why I redev the snake game? Did I try to reinvent the wheel – Not quite! What I include in this post addresses several challenges to simulate a fully...
AI in agriculture: fruit grading (Part 1)

During a meet up last month, a friend told me about the current project on a farm in New Zealand. They want to build a system to grade their fruits and AI is the technology they are looking for. It inspired me to write about how machine learning can help in solving such a problem. Fig 1: Apple grading The grading task Given an apple, we need to sort it to correct category in three available...
An example to Graph Convolutional Network

In my research, there are many problems involve networks of different types, e.g. social network, online-trading networks, crowd-sourcing, etc. I was so happy to find a new powerful tool for my research, the graph convolutional network, which applies deep learning on graph structures. Graph convolutional network (GCN) Graph convolutional network (Src: Thomas Kipf) There is currently no official...