Skip to content

Implementing stop early behavior for DiscreteOpt#45

Open
eko-wibowo wants to merge 2 commits intoknakamura13:mainfrom
eko-wibowo:stop_early
Open

Implementing stop early behavior for DiscreteOpt#45
eko-wibowo wants to merge 2 commits intoknakamura13:mainfrom
eko-wibowo:stop_early

Conversation

@eko-wibowo
Copy link

Addressing #38 I use this in A2 so the algorithms will stop after it reaches certain value for the cases that the target optimal value is known

@eko-wibowo
Copy link
Author

@nkapila6 do you think we need something like this for the ContinuousOpt as well? I probably can modify the base class if that's the case. Thoughts?

@nkapila6
Copy link
Collaborator

Hi @eko-wibowo, sorry I have been busy and haven't reviewed this.

At first glance, can you share how your can_stop attribute will be used? Because iirc the opt problems have their own can_stop method which will overwrite your can_stop method here?

Maybe in your implementation, you're using this DiscreteOpt class directly?

--

For your second question: Yes, would you like to implement this for continuous as well? Like NQueens, TSP, etc.

For the future PR:
Ideally, EarlyStopping should be something along the lines of:

  • User fixes number of iterations to look for
  • If score does not increase in those fixed iters
  • Program should terminate
    This is how it's implemented in sklearn, torch, etc.

@nkapila6
Copy link
Collaborator

Ahh nevermind, I see now. It's only FlipFlop that has a separate can_stop, rest all problems are dictated through the Fitness Functions.
Haven't seen the codebase in awhile now 😅

Can you add the same for FlipFlop too? I will merge it in once it's updated there as well.

Feel free to make a second PR for the continuous one!

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.

2 participants