question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cleanup distributions: `FloatDistribution` and `IntDistribution`

See original GitHub issue

Motivation

There are six classes that represent distributions in Optuna. For categorical parameters, CategoricalDistribution corresponds. For integer parameters, IntUniformDistribution and IntLogUniformDistribution. UniformDistribution, LogUniformDistribution, and DiscreteUniformDistribution for floating-point parameters.

IntLoguniformDistribution can be seen as a special case of IntUniformDistribution. As well, LogUniformDistribution and DiscreteUniformDistribution as of UniformDistribution.

In this issue, we will work on cleaning up distributions to three classes CategoricalDistribution, IntDistribution, and FloatDistribution by renaming and unifying the existing distributions. We think it improves the user experience because suggest APIs (suggest_categorical, suggest_int, suggest_float) would simply correspond to distribution names.

Description

  • Introduce FloatingDistribution and IntDistribution #3063
  • Add IntDistribution and FloatDistribution to the place where conditional branching is done by UniformDistribution etc #3111 #3126
  • Implement migration from current storage #3113
  • Deprecate distributions mentioned in the description #2990
  • Replace UniformDistribution etc to IntDistribution and FloatDistribution where instances of the distributions are created #3166 #3181
  • Update old distributions such that they inherit from IntDistribution and FloatDistribution #3244
  • Automatically convert deprecated distribution if it is provided by user #3420
  • Fix distribution compatibility for linear and logarithmic distribution #3444

Alternatives (optional)

Additional context (optional)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
himktcommented, Nov 16, 2021

@nyanhi @keisuke-umezawa Thank you so much for working on this issue.

In #2939, @xadrianzetx and I will work on a task to allow suggest_float to add a parameter (step and log) during the optimization. I think it needs FloatDistribution, which unifies floating-point distributions therefore I came here to ask if we can collaborate.

As I understand, the current status and further tasks look like following:

After instantiating FloatDistribution instead of the current float distributions, we can add step or log during an optimization (like IntUniformDistribution).

@nyanhi Would you continue this issue after #3063? I think tasks inside a rectangle can be worked on in parallel (by task or by type of distribution). And I’d be happy to collaborate with you to move forward. For example, I’m wondering if we can work on the tasks by the following assignment (just an example):

@nyanhi @xadrianzetx What do you think? I’d like to know whether you’re interested in. (and please ask if you have any questions)

2reactions
himktcommented, Nov 28, 2021

@xadrianzetx I think your first thought is just enough for this time. After introducing new distributions were completed, I want to modify codebase more elegant and readable with you.

elif isinstance(distribution, distributions.FloatDistribution): 
  if distribution.log:
    # LogUniform
  if distribution.step is not None:
    # DiscreteUniform
  else:
    # Uniform

@nyanhi, what do you think about it? It’s nice to have a discussion together because you will work on the similar task.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when training RL policy using big offline dataset - Ray
See Cleanup distributions: `FloatDistribution` and `IntDistribution` · Issue #2941 · optuna/optuna · GitHub.
Read more >
Example CLEANMAIL Mail Clean-Up program for cleaning out ...
This procedure deletes all SNADS distributions on the system for each user. The distribution limit is 9999 and CPD90B1 will be issued if ......
Read more >
Optuna Documentation
We use the terms study and trial as follows: • Study: optimization based on an objective function. • Trial: a single execution of...
Read more >
optuna Changelog - pyup.io
We are actively working on cleaning up distributions for integer and floating-point. In Optuna v3, these distribution are unified to `optuna.distributions.
Read more >
Introduction to Scientific Programming in C++17/Fortran2008
std::uniform_real_distribution<float> distribution(0.,1.); A roll of the dice would result from: std::uniform_int_distribution<int> distribution(1,6);.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found