On June 24, 2017, Deng Yun, front-end architect of Meideng Technology, delivered a speech titled “A Front-end Engineer’s Machine Learning Journey” at TFC 2017, Tencent Web Front-end Conference. IT big said as the exclusive video partner, by the organizers and speakers review authorized release.

Read the word count: 1980 | 4 minutes to read

Guest Speech Video Address:


Deng Yun, a front-end engineer of Meideng Technology, shared his journey of machine learning.

The front-end of the future

Multivariate input. Current inputs range from the earliest keyboard and mouse to the current touch screen, and will likely be voice and gestures.

Another aspect is that it varies from person to person. I think years from now, every user will probably see the same product interact differently. In front of artificial intelligence, what we need to do is no longer a product, maybe we will create a new product for each user, and transform his experience in a way that best suits him.

And rich levels of information. Information should be expressed in a hierarchical manner, and some information should be actively displayed following people’s attention and some detailed actions, while other information is more reserved in the background, as a temporarily inaccessible part of the entire application. But when you need it, it will be the first thing to come to you.

Then there is VR and AR. Through repeated iterations in recent years, both technologies have begun to bear fruit. But it remains to be seen when front-end user interactions will be disrupted by these two technologies.

Five minutes to understand machine learning

Artificial intelligence has made great breakthroughs in recent years, mainly reflected in several aspects. The first is the breakthrough of hardware, the second is the breakthrough of algorithm, and the third is the storage of big data. These three things are driving the current explosion in machine learning.

What is machine learning

Machine learning gives computers the ability to “learn on their own without special programming” by training them to solve specific simple problems.

Traditional programming and machine learning

Traditional programming begins with humans discovering requirements, and then translating the requirements into an abstract design. To realize it must have the client side of various programs and huge server side library, on this basis to do the corresponding development, and gradually decompose and solve each sub-problem. Finally, a human or machine is needed to test it. The real step to the machine to do only run, other steps are the need for manual operation.

In the way of machine learning, it is assumed that to solve a particular problem, the first step is to understand the requirements. It can be foreseen that one day machines will be able to find the needs of human beings, and then machines will find the rules of the requirements. The machine automatically finds correlations between these things through a lot of data, experiments, and the process is completely unhuman. We just set up the network structure and the objective function, and the other thought process is done by the machine, which will verify its way after the fact. Because machines need to eat a lot of data, humans need to prepare data. Finally by the machine to complete the execution, human assistance machine to do testing and error correction.

Shallow learning

As shown in the figure above, the area on the right is our problem, the yellow area has a lot of points in it which are the data we collected, and the background color is the solution we found. What this picture shows is that the solution to the problem has been found through shallow learning. However, a huge disadvantage of shallow learning is that features need to be extracted and processed manually in advance.

Deep learning

Deep learning is greatly different from shallow learning in structure. We have introduced many hidden layers. As shown in the figure, after a multiplication, an addition, and an extreme value, the result is finally output. Deep learning is such a formula.

Data matters

The biggest change in hardware is the increasing use of Gpus. The functions and formulas of artificial intelligence deep learning involve a large number of floating point operations. These functions have a lot of floating point operations left to the GPU after the GPU emerged. In fact, deep learning can be 30 to 50 times more efficient on a GPU than on a CPU. The GPU has also given a huge boost to machine learning.

Our attempt

A journey of a thousand miles begins with a single step, and our first goal is to find out what font size users prefer, which is both simple and useful. Users of different ages prefer different font sizes. Older people prefer larger fonts, while younger people or those using computer monitors tend to use smaller fonts. This is the kind of prediction that machine learning is really good at solving.

How to do

The first step is data collection. There’s a lot of data on what font users like. The second step is training, which is to train the previously collected data through machine learning, so that the network has the ability to determine which font users like according to the characteristics of new users. And then there’s the service, which is to eventually use it in the application, open it up to the front end, so that the front end can get access to this user information. And then it’s about actually applying these things to the front end.

Common functions and network structures

Prediction service We usually use Softmax, to determine which category a user belongs to, use Softmax to predict it.

When we don’t know how many categories there are in advance, we can use K-means to let machine learning tell us what the situation is, specify the number of categories, and then machine learning automatically helps us to complete the classification.

T-sne is a good way to reduce dimension. One of the great benefits of dimensionality reduction is data visualization, where we can visually see how the data is distributed. Another function is the command to find the nearest point.

CNN is used for machine vision, while RNN and LTSM are used for streaming processing.

DeepQ Learning is a hot topic of machine Learning in recent years. When a machine has several choices, it tries to make the machine predict which choice is the best, and then see whether the choice is the same as the machine predicted. This means that when we solve these kinds of problems, we don’t need to prepare test data beforehand, and the algorithm can learn by itself.

Some weird optimizations

Pre-training and combined networks. Pre-training is a very important part of machine learning. When you need to solve a complex problem, you can pre-train part of the network combination, which can greatly improve the training speed of the network.

Then there is the regularization and simplification of the network, and the extreme bias and rational arbiter.

The actual business

We’re actually going to explore a few other things next, such as semantic search, feature recommendations, intelligent recommendations, churn prevention and catalytic transformation, and automated compatibility testing.

It’s worth noting that Google released Deeplearn.js, which officially kicked off the industrialization of machine learning on the front end.

That’s all for today’s sharing, thank you!