Answer the question
In order to leave comments, you need to log in
How expedient is it to use a neural network to select an object from a collection of the same objects according to N parameters?
Goodnight!
I decided to play a little in test projects and try to solve the problem using a neural network.
I will say right away that yes, I understand that this problem can be solved simply algorithmically - by writing a script that will generally give the same result. But it's not so interesting + I want to learn some new technology :)
I want to teach the network to choose the optimal user for the task.
Since I usually work with JS, I will also implement it on it. Brain.js seemed to be the simplest and most accessible solution, which I used. If there are alternatives, I will gladly consider links to them.
I set myself a task like this:The network must choose from the collection of users the one that will best fit the task in 8 parameters.
The actual user looks like this:
const user = {
// Данные юзера
id: 1,
name: 'Вася Пупкин',
// Тип пользователя
type: 'Content',
// Категория его работы
category: 'Games',
// Основные направления по тегам
tags: ['tag1', 'tag2'],
// Количество всех заявок
allApplications: 31,
// Количество закрытых заявок
doneApplications: 28,
// В каких заявках уже участвует
alreadyChoosen: [1,2,3],
// Сообщил о конфликтах
conflicts: [1,2],
// Был снят с таких заявок
fierd: [3],
}
const application = {
// Данные заявки
id: 1,
name: 'И как ты до такого докатился?!',
data: '...',
// Собственно поля которые есть у каждого пользователя
type: 'Content',
category: 'Games',
tags: ['tag1', 'tag2', 'tag3']
}
const users = [...];
const applications = [...]
const trainingData = applications.map( application => {
return {
input: {
users: users.map( user => ({
// Каждый метод возвращает совпадение юзера по данному условию от 0 до 1
type: getTypeCoefficient( user, application),
category: getCategoryCoefficient( user, application ),
tags: getTagsCoefficient( user, application ),
allApplications: getAppAppsCoefficient( user ),
doneApplications: getDoneAppsCoefficient( user ),
alreadyChoosen: isAlreadyChoosen( user, application),
conflicts: isHaveConflicts( user, application),
// Насколько вообще возможно объяснить сети, что если например пользователь сам себя удалил с заявки
// что дальше все остальные пункты не особо имеют значения? Просто передавать только одно условие в
// инпут этого юзера?
fired: isFired( user, application )
}))
},
output: {
// Допустим, что для обучения есть массив данных в которых уже выбран релевантный юзер
[getValidUserForApplication( application )]: 1
}
}
});
net.train( trainingData );
// Пока не работает :)
net.run({
users: [...users]
});
Answer the question
In order to leave comments, you need to log in
I want to
Solving problems with the help of a neural network is like flying to a neighboring bakery for bread through a neighboring country and it only makes sense if the bread you want to buy is not produced in your country.
Yes, a ready-made neural network is able to solve the most complex problems very efficiently and quickly, but the problem is in the network training process itself - it requires an incredibly large amount of computing resources. It is not advisable to use a processor (and even more so a virtual machine of the same javascript, which is many times slower) for this, you will look for a solution for too long. Therefore, when choosing a toolkit (programming language and library), check in advance for compatibility with your hardware.
The fact that the implementation of neural networks exists for processors and interpreted languages only says that it can be justified to calculate the value of the finished network for solving the problem and it is possible to retrain the already finished network if it requires changing conditions. ps Google, for example, concocted a tensor processor
for himself, which for the tasks of learning neural networks, or rather for use in the tensorflow library, works an order of magnitude faster (more energy efficient) than a video card, .. i.e. it is logical to learn in advance on those libraries in order to minimize your costs in the future. True, Google is not going to sell its mega-hardware to the side, but it allows you to use them in the cloud (still very expensive when compared to the cost, but still cheaper than using a GPU, I haven’t personally tested it, but I heard it)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question