Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable study.best_trials and Compute2dHypervolumeRatio to be toggled enabled or disabled #152

Closed
hrntsm opened this issue Mar 8, 2023 Discussed in #151 · 3 comments · Fixed by #153
Closed

Enable study.best_trials and Compute2dHypervolumeRatio to be toggled enabled or disabled #152

hrntsm opened this issue Mar 8, 2023 Discussed in #151 · 3 comments · Fixed by #153
Assignees
Labels
enhancement New feature or request

Comments

@hrntsm
Copy link
Owner

hrntsm commented Mar 8, 2023

Discussed in #151

Originally posted by Knuttatutta March 7, 2023
Hi @hrntsm ,

Do you also have issues with the optimisation slowing down quite quickly until it becomes extremely and prohibitively slow? In the beginning a trial can take 0.05 seconds, and at 500 trials it can take 0.5 second..

This happens with all types of storage method (.db, .log, and in memory). In memory is of course faster at first, but it also really slows down.

I haven't looked into yet what might be causing it, but I was wondering if you were maybe aware of it and the cause?

Edit:
I'm not 100% sure, but with or without geometry attributes doesn't seem to affect the slowing down behaviour. I do think it's maybe a tiny bit slower in general with geometry, but I don't think it affects how it's slowing down. But again, not completely sure

@hrntsm hrntsm added the enhancement New feature or request label Mar 8, 2023
@hrntsm hrntsm self-assigned this Mar 8, 2023
@hrntsm hrntsm changed the title Optimisation slows down exponentially over time Enable study.best_trials and Compute2dHypervolumeRatio to be toggled enabled or disabled Mar 8, 2023
@Knuttatutta
Copy link

@hrntsm indeed when I disable those two operations, it goes a lot faster and I don't think there's any notable slowdown

@hrntsm hrntsm linked a pull request Mar 11, 2023 that will close this issue
@hrntsm
Copy link
Owner Author

hrntsm commented Mar 11, 2023

Hi @Knuttatutta

I added a Checkbox to the UI to see if it should be used or not.
If not checked, best_trials, etc. will not be computed as shown in the code below, which solves this issue.

image

https://github.com/hrntsm/Tunny/blob/feature/toggle-realtime-opt-result-ui/Tunny/Solver/Algorithm.cs#L289

  private void ComputeBestValues(dynamic study, int trialNum, out double[][] bestValues, out double hypervolumeRatio)
  {
      if (Settings.Optimize.ShowRealtimeResult)
      {
          dynamic[] bestTrials = study.best_trials;
          bestValues = bestTrials.Select(t => (double[])t.values).ToArray();
          hypervolumeRatio = trialNum == 0 ? 0 : trialNum == 1 || ObjNickName.Length == 1 ? 1 : Hypervolume.Compute2dHypervolumeRatio(study);
      }
      else
      {
          bestValues = null;
          hypervolumeRatio = 0;
      }
  }

The build with CI is as follows
https://github.com/hrntsm/Tunny/actions/runs/4391716591

@hrntsm
Copy link
Owner Author

hrntsm commented Mar 25, 2023

The issue is closed as it appears to be working.

@hrntsm hrntsm closed this as completed Mar 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants