This is our project on the 8th semester which belongs to the subject “Mechatronic system desgin”.

Honestly, it was the first time the mobile robot achieved the line, so it is kind of slow (take about 40 seconds to accomplish).

However, the final result was nearly 15 seconds which is only after the top of my class (approximately 14 seconds).

From an old story,

Curious Chick



Related Topics


Hi everybody,

In the last post, I depicted how to implement linear regression based on inverse matrix approach or normal equation using both Scikit-learn and TensorFlow libs. Continue reading “[TOPIC 2] LINEAR REGRESSION (2) – NEURAL NETWORK APPROACH”


Last week, I and my friend made a trip to Singapore – one of the most beautiful country in the world.

Honestly, we made a team including four people and expected to travel to the North of Vietnam at first. However, twos in our team got busy. On the other hand, there was a storm which was striking our country in the North (Winter was coming!!!!!), so I and my friend decided to go to a country outside of Vietnam. Before the trip, we agreed that the country that we travel should be in South-East Asia because this is a short trip which was made in hurry, we didn’t have enough time to apply for visa. After a thorough review, we chose Singapore as the first foreign country that we visited.

We planed for four-day trip in Singapore and booked airline tickets, hostel, and some amusement parks online in advance. Because, as you know, Singapore is the country that welcome thousand tourists everyday, so, if you don’t wanna struggle to find a room or stay in line with hundreds of people to buy a ticket you should buy tickets online. Besides, if you have a plan trip and some tickets booked in advance, it will be easier for you to get entry to Singapore from the immigration airport.


We began early at 6.00am to go to Tan Son Nhat international airport and check-in boarding pass. After that we waited for a while, got into the plane and it took off at 9.50am. Usually, it takes about 1 hour and 40 minutes to fly from Vietnam to Singapore and our plane landed in Changi international airport at nearly 12.00pm. What a beautiful airport! I can’t even imagine any other airports can be as splendid as it. Lots of massage chairs are put around to serve passengers, there are many flowers are planted on the wall, many art sculptures are placed along the way, etc. Actually, I thought it’s like a park rather than an airport.


Changi airport

We chose MRT as a main transport to travel around Singapore, the cost is not expensive and we can buy EZ or NETs FlatPay card at any stores in the airport to use it. Normally, we paid about 8 SGD a day for this.


NETs FlatPay card

From Terminal 3 of the airport, we got into the city using MRT to check-in the hostel. The hostel we booked online located on Chinatown, it costed 20 SGD per day. It’s very cheap as it’s kind of Dorm services in Singapore. For most travelers, Dorm is the best option to adopt because it can save their budget for other purposes and why we should hire a luxury hotel just to sleep?

After check-in at the hostel, we went to Raffle Place to go to Marina Bay by walking. It’s so so beautiful, and I got an indescribable feeling when I was there. Actually, it’s very hot in Singapore on July, but when we was going to the bay, the atmosphere there was different, till now, when I’m writing these lines, I have still felt the wind on my skin. The charm of the bay is one of reason make us came back to it every night.

Photo 16 29 35, 17-07-2017

Merlion at Marina Bay

Photo 16 36 47, 17-07-2017 (1)

Merlion at Marina Bay 2

About 6.00pm, we took the MRT to Ang Mo Kio and took the bus 138 there to visit Night Safari.

Our first day ended at 10.30pm when we came back to the hostel.


On the second day in Singapore, as planed before, we spent all days to visit Sentosa Island. Actually, we used most time to play around Universal Studios Singapore.

Photo 07 43 18, 18-07-2017 (1)

Universal Studios Singapore

There was a painful experience that DON’T HESITATE TO PAY MORE MONEY FOR EXPRESS TICKETS unless you want to stay in line with hundreds of people for hours just to play a small game.

Another thing is, if you have plan to go to USS, don’t forget to visit Steven Spielberg movie room (in New York road) and Water World (near Jurassic Park).


Scifi area at USS


Mystery Egypt


Water World

At the afternoon, we went to SEA Aquarium.


SEA Aquarium


SEA Aquarium 2


SEA Aquarium 3

And sat in Marina Bay at night to listen to water music on the side of Marina Sand Bay.

Photo 18 45 17, 18-07-2017

Night at Marina Bay

Photo 19 01 27, 18-07-2017 (1)

Night at Marina Bay 2


On the third day, we decided to visit Garden by the Bay.

Photo 07 48 18, 19-07-2017 (1)

Dragonfly garden

Photo 08 12 20, 19-07-2017 (1)

The sky forest

Photo 08 45 08, 19-07-2017

The flower dome

At the afternoon, we went to Art Science Museum.


A copyright of “Principia” at Art Science Museum


Art Science Museum

And visit Marina Sand Bay.


At DC commic store


At DC commic store 2

About 6.30pm, we came back to Garden by the Bay to enjoy Super Tree Rhapsody. The Rhapsody often begins at 7.00pm and end up after 15 minutes. So, if you go to Singapore, don’t forget the time of Rhapsody. It will be a memorable experience for you.


SuperTree Rhasody


SuperTree Rhasody 2


On the final day, we went to Kinokuniya which is the largest bookstore in Singapore, bought some good books and came back to the hostel to check-out at 12.00pm.


On the way to the book store

Then, we went to the airport to come back to Vietnam.

It is really a fantastic trip that left lots of memories on me and my friend. Good bye Singapore and see you again!

From an unforgettable experience,

Curious Chick


When I was in the third year at university, our team was assigned to a small project that required to design a Kinect scanner in order to implement 3D model of things. To simplify the task, we used the software Kinect SDK beta to construct the 3D model. At rest, we built electrical and electronic system, desgin mechanical system, built a prototype and control it.

To control the prototype, we decided to use open loop control as you can see in Fig. 1.


Fig. 1 Open loop control system

The prototype is showed in Fig. 2.


Fig. 2 The prototype of Kinect scanner

Honestly, the purpose of design was just for things whose weight lie in the range from 1 to 2.5kg. We used a box to test and the results are showed in Fig.3 and Fig. 4.


Fig. 3 3D model of the box

Exporting STL file for 3D printer.


Fig. 4 STL file of the box

If you enjoy the project, feel comfortable to contact me for more detail.


From an old story,

Curious Chick


Hi everybody,

Today, I would like to talk about the linear model for regression task in this post. While you have seperate labels (which may be (0 and 1) or (-1 and 1)) in classification tasks, the outputs in regression are continuous (i.e. they are arbitrary numbers lie in particular ranges). Continue reading “[TOPIC 1] LINEAR REGRESSION (1) – MATRIX INVERSE APPROACH”


Hi everyone,

Once I mention the concept of Machine Learning (ML) to my friends, who doesn’t work in the discipline of technology or data science, at least one of them think that it may be related to some characters on sci-fi like The Terminator, Wall-E, or recently, Ultron. In fact, it is partly true, that ultimately, the final purpose of ML is to make a robot that can be able to think and do like human beings, but now, it seem to be used mainly for analyzing data and getting information from it.

Nowadays, lots of technical companies have been bringing researches to the life (Natural Language Processing (NLP), Pattern Recognition, etc.), many businesses also used ML to analyze their customer and stock stock, and it can be said that ML become one of the sexist field in the world. Basically, there is two types of ML: supervised and unsupervised learning (see Fig. 1). For supervised learning, you need a datasets including input and output to train your algorithms, it is used for regression or classification tasks. By contrast, unsupervised learning don’t need output to train and it is used for dimensionality reduction or cluster tasks. For more details about ML, you can refer to these references [1], [2].


Fig.1 Two types of Machine Learning

Actually, learning ML is not as tough as you can think and if you just stay at using it, it is no more than a tool. The hardest works is that how to collect and preprocess the data before you feed it into ML algorithms. Each discipline have their own way to do that. For example, speaking from personal experience in building Brain – Computer interface systems (BCIs), the data in this case is EEG signal which is acquired from the scalp. Firstly, for data collection stage, what you need to do before collecting signal is to ask yourself some question to consider the purpose of collecting data, kind of what is the sampling rate you want to design the suitable hardware? Which position is chose to collect signal on your scalp to select the number of electrodes? etc. Secondly, for the preprocessing stage, of course, the raw data often have a lot of noise, so you need to use filters to denoise your datasets after that, then extract features into a feature input vector and feed it to ML algorithms. I can say that feature extraction is one of the most creative work when you try to analyze the data, and it require several knowledge about the field you work in. For example, come back to the field of BCIs, you may use some common descriptive statistics such as mean, median, standard deviation, etc. as features of data, but if you know a little bit about how your brain works, like the magnitude of alpha will increase and that of beta decrease when you are relax or in meditation, blah blah, and instead of statistical features, you now use the energy of alpha and beta from every electrode to make feature vector, it will be more efficient (not only decrease the size of feature vector but also increase the classification results). OK, you see that a lot of things to do before using ML. However, these works are beyond of this topic, so I will not discuss more.

In this series, I just focus on some popular algorithms in both supervised and unsupervised learning to help us solve some basic problems. And as I mentioned before, even your work is out of the field of technology, but if you are interested in ML, you can also learn and discuss it.

On the other hand, all codes in this series will be implemented using Scikit-learn and TensorFlow. A little bit about TensorFlow, it is low-level library which is more complicated than Scikit-learn to be used to implement ML algorithm. However, I would like to use it in some of my real projects because it is more efficient. The reasons of this is that TensorFlow sources was built by using C. Moreover, a computational graph is needed to drawn before running the ML algorithms. These help TensorFlow run much faster than Scikit-learn. Actually, there is other libs like Theano using the same ideas as TensorFlow but I would rather using it. It depends the taste.

Another thing is how to install TensorFlow? If you use Ubuntu or MAC OS, it wouldn’t be problem, prefer to [3] and [4] to get how to install it. However, there is a problem when you try to install TensorFlow in your Windows computer. The problem is that, TensorFlow is only support for Python 3.5.* on Windows. I tried it and it seemed not to work as expectation. For example, I wrote a simple code that print ‘Hello World’ to the screen using TensorFlow, but the line that is printed on the screen respond for byte instead of string type.


Fig. 2 TensorFlow on Python 3.5

On the other hand, as I mentioned in the first tutorial in the series of Basic Python Tutorial, there are some important libraries that cannot be used on Python 3.5.* such as Scipy. Thus, to solve this problem, I use Ubuntu on Virtual Machine. The instruction to install Virtual Machine is described on [5].

How to install Ubuntu on VirtualBox in Windows [5]

OK, so have you set up all need of software on your computer for ML? In the next tutorial, we will familiar to the simplest ML algorithms called Linear Regression.

Hope you enjoy it,

Curious Chick


[1] https://www.toptal.com/machine-learning/machine-learning-theory-an-introductory-primer

[2] https://monkeylearn.com/blog/gentle-guide-to-machine-learning/

[3] https://www.tensorflow.org/install/install_mac

[4] https://www.tensorflow.org/install/install_linux

[5] https://www.youtube.com/watch?v=GGorVpzZQwA


Hi everyone, in this tutorial, I want to introduce another type of data in Python – array.

Related topics

Before beginning this tutorial, I recommend you should read the following topics:




If you have already read these, let’s start to know what is array and what is it used for?


Some of you may know that array is an useful type of data that permits programmers to store sets of information in one variable and to do the same thing with each element of it. This helps you to avoid making a lot of duplicated code. For example, assume that you want to store test scores of 5 students and then calculate the average test score of them. So, how could you do that? Here is 2 ways, let’s open IDLE and follow me.

Code 1

>>> student1 = 7.5
>>> student2 = 9.0
>>> student3 = 8.5
>>> student4 = 8.5
>>> student5 = 10.0
>>> average_score = (student1 + student2 + student3 + student4 + student5)/5
>>> print average_score

Well, everything seem to be more effective when using array.

Code 2

>>> student_scores = [7.5, 9.0, 8.5, 8.5, 10.0]
>>> average_score = sum(student_scores)/len(student_scores)
>>> print average_score

OK, in the example above, you saw how useful is it when using array instead of declaring a lot of variables. And it will be more effective to use array when the number of students (in the example) increase to n, with n is extremely large.

Now, let’s continue to know how to create an array in Python.

If you used to program in C/C++ or other compiled programming languages such as Java and C# before, you could know the popular structure below to create an array:

type variable_name = {value 1, value 2, value 3, ... , value n}

The compiled programming languages use braces {} to declare array of values, and you have to put the ‘type of variable’ before ‘variable’s name’. And of course, because the array have its type, the values in which must respect to the type of the array. It means if you declare the type of array string, all values in array must be string data type. Similarly, you must put integer (or float) values into your array, if you declare its type integer (or float). It sounds a bit complicated.

In Python, you don’t have to declare array data type. Instead of that, Python will consider the array data type by looking at the type of the value in array. Moreover, you can put any type of value in an array (like the code below). What a powerful weapon!

>>> iron_man = ['Tony Stark', 38, 1.82, 83, 'billionaire', 'play-boy']

However, there are some discrepancies between Python arrays depending on which kind of arrays you use. Let’s take a look through typical types of array in Python.


  • Creating a list

In Python, we use square bracket [] to make a list and commas to separate individual elements. For example:

>>> student_name = ['harry potter', 'ron westly', 'hermione granger']
>>> student_weight = [54, 60, 43]
  • List index

Index is an essential part of array. It is used to access elements in an array. For example, accessing the score of the third student in ‘student_scores’ array from previous example.

>>> print student_scores[2]
>>> 8.5

Remember that, index is counted from 0, so you use index 0 for the first element, 1 for the second one, 2 for the third one, and so forth.

On the other hand, you can use a negative number to be an index of a list. In this case, the index will be counted from the right, begin from -1.

>>> print student_scores[-1] 
>>> 10.0
>>> print student_scores[-2] 
>>> 8.5

In addition, you can access more than one elements from the index m to (n-1) by using the structure below:

>>> print array_name[m, n]

For example:

>>> print student_scores[1:3]
>>> [9.0, 8.5]
  • Updating an element in a list

To update an element in a list, you just simply call its index in the list and change its value. Look at the example below to see how is the score of the third student changed.

>>> print 'The score of the third student is: %.1f' %student_scores[2]
>>> The score of the third student is: 8.5
>>> student_score[2] = 9.5
>>> print 'The new score of the third student is: %.1f' %student_scores[2]
>>> The new score of the third student is: 9.5
  • Deleting an element in a list

There are many ways to delete an element in a list. You can delete an element by using ‘del’ command as the example below:

>>> print student_scores
>>> [7.5, 9.0, 9.5, 8.5, 10.0]
>>> del student_scores[2]
>>> print student_scores
>>> [7.5, 9.0, 8.5, 10.0]

Or you can use the built-in methods ‘remove’ to delete an element if you want to delete the exact value that you knew in the list. In the example below, I want to delete the value 7.5 in the list ‘student_scores’.

>>> print student_scores
>>> [7.5, 9.0, 8.5, 10.0]
>>> student_scores.remove(7.5)
>>> print student_scores
>>> [9.0, 8.5, 10.0]
  • Adding an element into a list

To add an element into a list, we use append() which is a built-in methods of list to add the element into the end of the list.

>>> print student_scores 
>>> [9.0, 8.5, 10.0]
>>> student_scores.append(9.5)
>>> print student_scores 
>>> [9.0, 8.5, 10.0, 9.5]

On the other hand, you can use insert() which is also a built-in methods of list to add the element into any position you want in the list.

>>> print 'The score of the third student is: %.1f' %student_scores[2]
>>> 10.0
>>> student_scores.insert(8.0, 2)
>>> print 'The score of the new third student is: %.1f' %student_scores[2]
>>> 8.0
  • Basic List Operations

Similar to strings, we can use addition operator + and multiplication operator * to concatenate and repeat lists, respectively.

>>> a = [1, 2, 3]
>>> b = [4, 5, 6]
>>> c = a + b
>>> print c
>>> [1, 2, 3, 4, 5, 6]
>>> d = a*3
>>> print d
>>> [1, 2, 3, 1, 2, 3, 1, 2, 3]
  • Useful Built-in methods for number list

Now, you are able to do a lot of things with lists. However, I want to show you a little further with some useful built-in methods which are often used to treat a list of number. I will illustrate these methods with the ‘student_scores’ example above.

>>> print 'The number of student:'
>>> The number of student:
>>> print len(student_scores)
>>> 5
>>> print 'The highest score:'
>>> The highest score:
>>> print max(student_scores)
>>> 10.0
>>> print 'The student who have the highest score: '
>>> The student who have the highest score:
>>> print 'Student number %d' %(student_scores.index(max(student_scores))+1)
>>> Student number 4
>>> print 'The lowest score:'
>>> The lowest score
>>> print min(student_scores)
>>> 8.0
>>> print 'The student who have the lowest score:'
>>> The student who have the lowest score:
>>> print 'Student number %d' %(student_scores.index(min(student_scores))+1)
>>> Student number 3
>>> print 'The number of student who get 9.0 in the examination: '
>>> The number of student who get 9.0 in the examination:
>>> print student_scores.count(9.0)
>>> 1
>>> print 'The order of the scores from low to high'
>>> The order of the scores from low to high
>>> print student_scores.sort()
>>> [8.0, 8.5, 9.0, 9.5, 10.0]
  • Dimension of a list

In the previous examples, we created 1D dimension list, now try to create a higher dimension list by adding a list into another lists.

>>> 1d_list = [1, 2, 3] # 1D list with shape [3]
>>> 2d_list = [[1, 2, 3], [4, 5, 6]] # 2D list with shape [2, 3]
>>> 3d_list = [[[1], [2], [3]], [[4], [5], [6]]] # 3D list with shape [2, 3, 1]
>>> print 3d_list[0][1][0]
>>> 2

High dimension lists seem to be unfamiliar now, but you will probably work a lot with it in the future if you expect to work in the field of image processing.


Tuple is known as immutable list. It means you cannot change, append or delete the value of elements in tuple.

To declare a tuple, we use parentheses () instead of square brackets [].

>>> countries = ('Vietnam', 'America', 'Germany', 'France', 'Canada')
>>> first_eleven_fibonacci_number = (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89)

Most built-in methods or operations which are used in list can also be used in tuple.

>>> print max(first_eleven_fibonacci_number)
>>> 89
>>> print sum(first_eleven_fibonacci_number)
>>> 232
>>> k = countries + first_eleven_fibonacci_number
>>> print k
>>> ('Vietnam', 'America', 'Germany', 'France', 'Canada', 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89)

However, as I mentioned before, you cannot change, append or delete in tuple. If you try to do it, you will get errors.

>>> first_eleven_fibonacci_number[4] = 99

Traceback (most recent call last):
 File "<pyshell#39>", line 1, in <module>
 first_eleven_fibonacci_number[4] = 99
TypeError: 'tuple' object does not support item assignment
>>> del first_eleven_fibonacci_number[7]

Traceback (most recent call last):
 File "<pyshell#40>", line 1, in <module>
 del first_eleven_fibonacci_number[7]
TypeError: 'tuple' object doesn't support item deletion


In the final section, I would like to introduce another type of arrays in Python – dictionary.


Fig. 1 Structure of a dictionary

A dictionary which is declared by using braces {} include keys and values as Fig. 1. The keys are used to connect to and access values. The values can be numbers, strings, lists, or even dictionaries.

>>> satre = {'name': 'Jean-Paul Satre', 'aged': 74, 'country': 'France', \
             'works': ['Le mur', 'Les mouches', 'Le sursis']}
>>> print '%s died in Paris, France, aged %d' %(satre['name'], satre['aged'])
>>> Jean-Paul Satre died in Paris, France, aged 74
>>> print 'Three of his famous books are:'
>>> Three of his famous books are:
>>> print satre['works'][0]
>>> Le mur
>>> print print satre['works'][1]
>>> Le mouches
>>> print print satre['works'][2]
>>> Le sursis

Most things you can do with lists and tuples, you can also do with dictionaries but you need to use key instead of index.

>>> print 'Deleting Satre's age'
>>> Deleting Satre's age
>>> del satre['age']
>>> print 'The amount of information about Satre: %d' %len(satre)
>>> The amount of information about Satre: 3

However, you cannot use operator such as + or * for dictionaries as lists and tuples. On the other hand, to add a new key-value into the dictionary, you cannot use append() method. Instead, you can do this.

>>> satre['philosophy'] = 'Existentialism'

So, with all basic things I introduced, you are now able to do a lot of things with arrays in Python. In the next tutorial, I will introduce control structures and we will try writing the first script in Python.


Hope you enjoy it,

Curious Chick