O
O
ork8212020-05-10 14:25:52
Machine learning
ork821, 2020-05-10 14:25:52

Can artificial intelligence predict a number?

Hello. It became interesting to write the algorithm for "guessing" numbers.
For example: I give arrays of the equation y=2*x. x= [1,2,3] y = [2,4,6]
Wrote a backpropagation algorithm. But at the output I can only get from 0 to 1 (sigmoid).

What can be done to get numbers greater/less than 0/1 as output?
Or is such an algorithm done by translating the number into 0 and 1, and then using the usual algorithm?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danil, 2020-05-11
@DanilBaibak

As far as I understand, you are trying to solve the regression problem. To do this, you need to make the output of the last layer equal to 1 and set the activation function to a linear one. Example (using Keras):

model.add(Dense(1, activation='linear'))

compile(loss='mean_absolute_error', optimizer='adam', metrics=['mean_absolute_error'])

A
Alexander Skusnov, 2020-05-10
@AlexSku

1) neural networks
a) as you wrote - normalization of inputs and outputs. Those. and bring the maximum spread of both inputs and outputs to the range 0..1
b) (can be combined with item a)) The first layer (several neurons) with sigmoids, the output layer is one neuron with a linear function. Thus, it is possible to make an approximator of any function. Only for a neural network, more examples for training (several thousand points) would be needed.
2) Any approximator (without neural networks). But only the interpolator will work normally, and the extrapolator can produce terrible errors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question