Advertisement

Neural Network with varying amount of input data?

Started by March 11, 2018 12:47 AM
6 comments, last by sbischoff-ai 6 years, 6 months ago

I'm trying to figure out the best way to implement a neural network with a varying number of inputs. Because of an NDA, I can't post my specific issue or include my data, but I've come up with a scenario that is pretty close to my dilemma, though it is over simplified quite a bit. I'm just looking for a high-level suggestion of a possible way forward so hopefully it will be enough.

Say I'm tasked with writing a neural network to automate evaluating employees in a manufacturing job. There's a set number of inputs for each employee such as: days called out, times late, hours of OT worked and so on. In additional to this data there's also the information about the items produced which will be the same for each item: time taken to complete the item, amount of extra materials used to make item, quality of the item, number of tweaks needed before the item can be shipped and stuff like that. The number of data inputs for each item is always the same. The issue is that each employee produces a different number of items and I'm not sure how to account for that in the neural network.

So what I'm looking at for input data:
- employee data with an equal number of inputs
- item data with an equal number of inputs
- varying amounts of items which need to be associated with each employee

The output I need is a score that takes into account all the employee data and all the item data for the items that employee produced.

I was looking at averaging the item 'scores' for all the items an employee makes, but this didn't work since each item has to be part of the employee's data. This is because each item could have certain criteria that needs to weigh heavier in the evaluation (say an item is made with all criteria being excellent or all criteria being exceptionally poor) so each item needs to be considered individually along side the employee's other numbers.
Next I was thinking of was to create a static number of items for all employees and set all the inputs without an associated item to zero. This didn't work since the higher numbered item input weights got rated down since they weren't used on most employees and even items that were should have swayed the output wound up barely registering for the employee.

I'm new to neural networking but my neural network does seem to be working, it's just not giving me the relevant output I was hoping for without being able to include the item data. I started looking into recurrent neural networks, but the more I read about them the less they seem to be something that would help in my situation. Is this something that wouldn't be a good application for a neural network because of the different amounts of item data? Is there some other method of implementing neural networks that would be better suited to my data?

Edit: my current implementation is actually 2 neural networks. 1 for the data items to produce an item score and 1 for the employee data using output from the first as an input. To back propagate I'm just passing the MSE from the Employee neural network to the output of the Item neural network and then back propagating from there. 

Edited to make title clearer.

Found an answer to my question confirming that the number of input values needs to be constant and there are no viable ways around this for what I'm trying to do. Looks like I will need some other way of sorting the variable number of associated input data elements before feeding it to my neural network.

Advertisement

Your description matched something I read about a few months ago, although I never read the details carefully: https://arxiv.org/abs/1706.01427

Is that the kind of thing you were looking for?

 

Thank you very much! That paper does seem to address the issue I've been struggling with. Formal papers make my head spin so I'm going to have to read it a few more times to make sure I'm understanding the concepts correctly. :)

I also may have come up with an alternative approach to my issue. I can create a larger list of attributes for the Employees and use the total number of each type of item factor being looked for. The actual Items have 35 data inputs and I figure this will require about 250 additional inputs I would need to add to the Employee data to cover the possible combinations being looked for. So I would just need to add up the number of exceptional quality items produced, number of times additional resources were needed and so on. It's not so elegant and requires some work on my part but it seems viable in my initial testing.

Anyway, thanks again for that paper. I am going to go through it a bit more when I have a bit more time. Even if I don't implement that in this program, it looks like an excellent resource to be aware of for future projects.

Just because it is almost expected of me at this point, I'll just swing by and ask... why a neural network?

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

On 2018-03-10 at 9:20 PM, JimboC said:

Found an answer to my question confirming that the number of input values needs to be constant and there are no viable ways around this for what I'm trying to do. Looks like I will need some other way of sorting the variable number of associated input data elements before feeding it to my neural network.

Just use the maximum number of inputs for the input neuron count, and when there are less than the maximum number of inputs, you just pad the input with the necessary number of 0s.

Advertisement

You don't need the data for all the produced items as features (meaning input) for the neural network. When your data consists of collections with variable amounts of identically structured data items, you should use statistical information about this collection to design a feature that represents it in your neural nets input layer. 

In your example scenario this means that you would use information such as the number of produced items or the average, the variance and the skewness of the distributions of the items' criteria and maybe also the results of an association rule model run on the list of produced items, and so on.

Another tip: You should not just feed all data you have into the neural net as it is, but carefully design optimal features from the data, after analyzing correlations and the fitting quality of various models. Drop all attributes from your data set that are highly correlated with some other attributes for example, so that your features are all independent variables. Try to transform your data to get as near to a linear dependency of your models' output on the input, as you can get. Neural nets can regress nonlinearly, but linear fits better. 

Also: Your evaluation example does not really pose a proper machine learning use case. It's not supervised, as the score you want as output is not part of any training data, and it's also not the result of clustering or any other kind of unsupervised pattern extraction. So, why use a neural net and what exactly is the cost function here? 

Cheers, Silas

This topic is closed to new replies.

Advertisement