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

Correct CGP behaviour regarding verbosity and Restorable API #275

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

nhuet
Copy link
Contributor

@nhuet nhuet commented Oct 9, 2023

This PR fixes #177.

  • We remove all prints when verbose=False
  • We remove inheritance from Restorable since CGPWrapper did not implement _save() nor _load().

To see how verbosity is fixed you can compare how the following snippets behave before and after the PR:

import gym
from skdecide.hub.domain.gym import (
    GymDomain,

)
from skdecide.hub.solver.cgp import CGP


ENV_NAME = "MountainCarContinuous-v0"
domain_factory = lambda: GymDomain(gym.make(ENV_NAME))

print("*** With verbosity")
solver = CGP("TEMP_CGP", n_it=2, verbose=True)
GymDomain.solve_with(solver, domain_factory)

print("***Without verbosity")
solver = CGP("TEMP_CGP", n_it=2, verbose=False)
GymDomain.solve_with(solver, domain_factory)

Copy link
Collaborator

@neo-alex neo-alex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for me, thanks

@neo-alex neo-alex merged commit 574fe52 into airbus:master Nov 14, 2023
@nhuet nhuet deleted the cgp branch December 12, 2023 08:36
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.

CGP violates interface & options
2 participants