Created
December 13, 2019 16:50
-
-
Save alexrutherford/5dc4e6cb9b6911e314c72dd71efe9a18 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rescale(p,rho = 0.001): | |
rhoAbs = abs(rho) | |
if abs(rho) > 10.001: | |
print('Error in rho ') | |
sys.exit(1) | |
out = np.zeros_like(p) | |
out = p**(1. + rhoAbs) | |
out = out/out.sum() | |
if rho < 0.0: | |
out = p - (out - p) | |
# out = p + (p-out) | |
# If rho is -ve then flip super linear scaling | |
# out = p - (out - p) | |
return out |
Author
alexrutherford
commented
Dec 13, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment