Python Forum
why do most algorithm only take number between -1 and 1 as input or output?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
why do most algorithm only take number between -1 and 1 as input or output?
#1
Why do algorithm like Perlin noise and neural network and many more algorithm must have the input and output to be between -1 and 1,is there a reason for that?
In other words,why do value have to be normalized in algorithm like neural network?
Can I use actual number ,instead of number between -1 and 1?

Second question:
Is gradient interpolation/lerp a must in Perlin noise and simplex noise?
What does it mean?

Third question(not very important):
How do I do infinite terrain using chunk?
Reply
#2
This probably would have been better posted in the 'Bar' sub-forum, since at this point, none of the three questions have anything to do with Python coding.  As to the questions themselves, a little time with your favorite search engine will probably supply with with many answers, from simple to complex.

As to your first question, my guess  would be that it just makes computing and graphing easier with a more manageable size.  Since there are an infinite number of numbers between 0 and 1 and 0 and -1, what ever number you choose will fall within that range, just prefixed by a decimal point.  Just a guess though  Dodgy
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#3
Well, numbers from -1 to 1 have certain properties that can be useful. For example, if you take any two numbers in the range -1 to 1 and multiply them by each other, the result will be between -1 and 1. That is not true for the range -2 to 2. If you're doing an iterative process this can be useful.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#4
Learned something new, thanks.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#5
numbers in the range from -1 to 1 or 0 to 1 are often used for scaling things. having studied a lot of maths it is common to see numbers like this.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#6
Thanks everyone.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020