Skip to content

Do not add the lower bound to sigma when scaling it to vector space - #432

Open
angrinord wants to merge 1 commit into
mainfrom
fix/log-sigma-vectorize-size
Open

angrinord wants to merge 1 commit into
mainfrom
fix/log-sigma-vectorize-size

Conversation

@angrinord

Copy link
Copy Markdown

Log scaled hyperparameters' sigmas are dependent on lower bound. I think this is erroneous, so I removed it and added a test for independence. Fixes issue #431

On a log scale a size is a factor rather than an offset, so sigma is a
geometric standard deviation: sigma=2 asks for a two-fold spread.
UnitScaler.vectorize_size added the lower bound to sigma before taking the
logarithm, which made the achieved spread depend on where the range starts.
A requested factor of 2 came out as 2.5 on [0.5, 5000] and as 12 on
[10, 100000], and the distribution collapsed to a point mass at
sigma = 1 - lower, where the numerator is zero and truncnorm divides by it.

Dropping the offset makes sigma exactly the geometric standard deviation on
any range. The linear branch is unchanged.

Four existing expectations in test_hyperparameters.py encoded the old
values. Each compares a log-scaled hyperparameter built as the exponential
of a linear one -- lower=exp(0), upper=exp(10), mu=exp(3), sigma=exp(2)
against 0, 10, 3, 2 -- so the two should agree, and with this change they do
to fifteen significant figures. The stored numbers were up to a factor of
two out.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant