How to make machine learning when inputs are of different sizes?

In standard cookbook training, we work on a rectangular matrix; that is, all of our data points have the same number of functions. How do we deal with situations where all our data have a different number of functions? For example, if we want to make a visual classification, but all our photos have different sizes or if we want to analyze the moods, but all our sentences have different numbers of words, or if we want to classify stellar, but all stars were observed a different number of times, etc. .

I think the usual way would be to extract regular size functions from this data with the wrong size. But recently, I attended a conversation about deep learning, when the speaker emphasized that instead of using the functions of processing data from data, deep students can themselves learn the corresponding functions. But how do we use, for example, a neural network if the input level does not have a fixed size?

+6
source share
2 answers

Since you are asking about deep learning, I assume that you are more interested in end-to-end systems, rather than object design. Neural networks that can process variable data inputs:

1) Convolutional neural networks with pools. They are commonly used in the context of pattern recognition, but recently they have also been applied to modeling offers. (I think they should also be good at classifying stars).

2) Recursive neural networks. (Good for sequential data, such as time series, sequence marking tasks are also good for machine translation).

3) Tree-based auto-encoders (also called recursive auto-encoders) for data located in tree structures (can be applied to sentence parsing trees)

Many articles describing sample applications can be easily found with googling.

For unusual tasks, you can choose one of them based on the structure of your data or you can develop some options and combinations of these systems.

+3
source

Usually you can easily make the number of functions the same for all instances:

if we want to do a visual classification, but all of our images have different sizes.

Change them all to a specific size / number of pixels.

if we want to conduct a sentiment analysis, but all our sentences have different numbers of words

Keep a dictionary of words k in all of your text data. Each instance will consist of a logical vector of size k , where the i -th entry is true if in this case the word i from the dictionary appears (this is not the best representation, but many are based on it). See the Word Model.

if we want to make a star classification, but all the stars were observed a different number of times

Take the features that were observed for all stars.

But recently, I attended a conversation about deep learning, when the speaker emphasized that instead of using the manual functions from the data, deep students can learn the corresponding functions themselves.

I think the speaker probably referred to higher level functions. For example, you do not have to manually extract the “contains nose” function if you want to detect faces in the image. You have to feed it with unprocessed pixels, and the deep student will study the "keep nose" function somewhere in the deeper layers.

+1
source

Source: https://habr.com/ru/post/983237/


All Articles