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

Create an mpy.optimizer package with an mpy.optimizer.RandomOptimizer #3

Open
Deathn0t opened this issue May 25, 2022 · 0 comments
Open
Assignees

Comments

@Deathn0t
Copy link
Member

Deathn0t commented May 25, 2022

exp = mpy.Float(0, 10)
opt = mpy.optimizer.RandomOptimizer(exp,sampler=None, rng=42)
for config, frozen_expression in opt.sample(size=10):
  pytorch_model = frozen_expression.evaluate()
  val_acc = train(pytorch_model)
  opt.tell(config, val_acc)
  # it means the optimizer as and ask/tell interface 
  # and the ask is used in sample to iterate
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

No branches or pull requests

2 participants