Skip to main content

Learn Machine Learning

Jia-YinAbout 1 min

The purpose of machine learning is to find a function through data that can map inputs to outputs. For example, given an image, this function can map the input image to corresponding descriptive text.

How do we find this function? The process of machine learning first involves setting the form of the model and the parameters to be used. Generally, models mostly use neural networks, and the parameters within are referred to as weights. A large model may have many parameters, some reaching billions. To find good parameters is beyond human capability, so the task is left to machines to compute. This computing process is known as training the model.

Training the model is the process of finding the model parameters. What counts as good parameters? There needs to be a standard for judgment. Generally, a loss function is used, which measures the gap between the model's output and the desired output, and assigns a score based on this gap. Our goal is to try to make the average score of the loss function as small as possible.

Once we get a score from the loss function, there is a set of algorithms that can be used to adjust the model's parameters, allowing the loss score to change slightly in a lower direction.

The entire process of training the model is a continuous cycle of feeding data, calculating output, calculating the loss function score, adjusting model parameters, and with each adjustment trying to make the model a bit better. After thousands and millions of adjustments, the model's performance or accuracy becomes better and better.

Today's machine models can be very powerful; and I wonder, if people could also reflect on themselves like machines every day, comparing the difference between ideal and actual behavior, and then making slight corrections in a good direction based on this difference, accumulating day by day, the spirit would also become better and better! The Chinese I Ching says: "As heaven’s movement is ever vigorous, so must a gentleman ceaselessly strive along." Zengzi said: "I examine myself three times a day." Indeed, weren't the wise and intelligent sages also accumulated bit by bit in this way? Inspired by machine learning, those who strive make progress as such!