Code Monkey home page Code Monkey logo

Comments (4)

pvcastro avatar pvcastro commented on May 23, 2024 1

@himkt don't you think this is a bug? I don't understand why the optuna team didn't handle this as a bug. It doesn't make sense to run the same trial more than one time. In my scenarios here, I'm getting quite a waste of computational efforts...for one study I got the same set of parameters 45 times out of 137, and for the other I got 33 out of 95.

How do you feel about adding the suggestion from stackoverflow to allennlp-optuna? And enabling it according to a parameter. I like the raise optuna.structs.TrialPruned('Duplicate parameter set') suggestion better, how about you?

I can help with a PR, if you agree.

from allennlp-optuna.

himkt avatar himkt commented on May 23, 2024

A sampler could return the same parameter over trials. As a workaround, you can skip a trial and use a past trial for the reporting value.

https://stackoverflow.com/questions/58820574/how-to-sample-parameters-without-duplicates-in-optuna
optuna/optuna#717

from allennlp-optuna.

himkt avatar himkt commented on May 23, 2024

Yes, I think it is not a bug. An objective function has a noise in nature, and an algorithm could sample a point near the specific point to get more information around it. However, I understand your situation that too many trials searched the same point is not desirable.

TPE places significance on exploitation under the trade-off between exploitation and exploration. And TPE behaves like a majority voting on a histogram for a categorical variable (@HideakiImamura, Optuna core team member told me). He also told me that the optimization could be improved by converting your categorical variable into a discrete variable and using TPE with multivariate=True(For example, lr could be a discrete variable of floating points on [1e-5, 5e-5] with step 1. weight_decay is a little bit difficult but it could be a variable on floating points on [0.0, 0.3] in the log domain...).

How do you feel about adding the suggestion from stackoverflow to allennlp-optuna?

I don't think it's good to introduce a duplicate parameter set logic to allennlp-optuna since this library is a thin wrapper of Optuna. If we introduce the trick, implementing it in Optuna would be better.

@HideakiImamura Please correct me if I wrote something wrong or could be modified. And do you think if we can support skipping evaluation of an objective function for a duplicated parameter set in Optuna?

from allennlp-optuna.

himkt avatar himkt commented on May 23, 2024

Closed because it is not bug but Optuna specification.

from allennlp-optuna.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.