0
$\begingroup$

I am trying to build a neural network that has an input of $n$ pairs of integer values (where $n$ is random) and a corresponding output of a binary array with length $n$.

The input will be a set of integer value coordinates $[(x_{1}, y_{1}), (x_{2}, y_{2}), (x_{3}, y_{3}), \dots, (x_{50}, y_{50}), \dots]$, where each instance can be of various lengths, like $[(x_{1}, y_{1}), (x_{2}, y_{2}), (x_{3}, y_{3}), \dots, (x_{52}, y_{52})]$ or $[(x_{1}, y_{1}), (x_{2}, y_{2}), (x_{3}, y_{3}), \dots, (x_{101}, y_{101})]$, etc.

The output is a set of binary arrays with each instance having the same length as the corresponding input.

enter image description here

May I know if anyone has any recommendations on what neural network would fit this use case?

$\endgroup$
1
$\begingroup$

A recurrent neural network (RNN, specifically either an LSTM or GRU) will work well for variable length sequences like you’ve described. Assuming the order of the sequence is meaningful (I.e. you can’t just break up the sequence into individual inputs and associated target value) an RNN model will learn how the sequence of inputs maps to the sequence of outputs.

$\endgroup$
1
  • $\begingroup$ If the sequence is not meaningful, then the OP could take advantage of that symmetry and sort the items using a consistent rule, which may make the learning task easier. $\endgroup$ Jul 11 at 20:11
0
$\begingroup$

Look for padding.

There are even versions of it: pre-padding, post-padding. https://stackoverflow.com/questions/46298793/how-does-choosing-between-pre-and-post-zero-padding-of-sequences-impact-results

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.