M
M
mib2021-09-20 00:21:21
Neural networks
mib, 2021-09-20 00:21:21

Is it possible to teach a neural network to determine if there are 3 consecutive decreasing numbers in a sequence of 10 numbers?

Hello
, I want to make a 1d network, which will have sequences of 10 numbers at the input, and true / false at the output, depending on whether there is a sequence of exactly three decreasing numbers in this set of numbers?

I can generate a huge number of such sequences, where it is guaranteed that there is or is not such a feature.
The input layer is basically something like this

import torch.nn as nn
nn.Conv1d(in_channels=1, out_channels=5, kernel_size=(5,), stride=(1,))


(kernel_size 5 because it takes 5 numbers to make sure only 3 of them decrease)
And that's where the thought stops.

can the network generalize such features at all?

Thanks in advance for the tips
Thanks!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2021-09-20
@rPman

In theory it can.
To understand this, try using a simplified example, manually, to create a neural network from the minimum number of neurons that would compare two numbers. Each neuron takes the sum ax + by from its inputs, and the coefficients can be negative (i.e. there can be a difference), which means that the result, if one number is greater than the other, becomes either negative or positive at the output - this is already a clear clear signal for the next .
A single-layer perceptron is unambiguously not capable of this, one layer can only compare two numbers (in this case, any, neighboring or not, for this, the number of neurons in the first layer must be the square of the number of inputs, if three neighboring neurons are needed, then there should be 3n), then you need at least one more layer (but rather more) to bring the results into one output

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question