Skip to content

Instantly share code, notes, and snippets.

@jcbozonier
Created January 13, 2017 14:30
Show Gist options
  • Save jcbozonier/371aafa0411335075ea78009a3562b21 to your computer and use it in GitHub Desktop.
Save jcbozonier/371aafa0411335075ea78009a3562b21 to your computer and use it in GitHub Desktop.
Log Normalization
def normalize(log_p):
shifted_p = np.exp(log_p - np.max(log_p))
normalized_log_p = shifted_p/shifted_p.sum()
return normalized_log_p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment