Questions tagged [nevergrad]

7 questions
2
votes
0 answers

Optimize Function That Takes Numpy Array Using Nevergrad

Given an arbitrary function I'd like to find input to the function that minimizes it using nevergrad. The input is a (32,32) numpy array (or image) with values in the range (0,1). Let's say our function is the contrast of the image. The contrast is…
r0f1
  • 2,717
  • 3
  • 26
  • 39
2
votes
0 answers

How to use nevergrad to find the minimum of a cost function over the field of integers?

As part of our Poolkeh paper, we thought to use nevergrad. However, sadly it doesn't always return the same result, nor the most optimal one. We tried DiscreteOnePlusOne as an optimizer, but it didn't find the optimal results. OnePlusOne worked ok,…
0x90
  • 39,472
  • 36
  • 165
  • 245
1
vote
1 answer

Suggesting Values in Nevergrad Package

Steps to reproduce import nevergrad as ng import numpy as np loc = ng.p.Scalar(lower=-5,upper=5) scale = ng.p.Scalar(lower=0, upper=5) s = ng.p.Scalar(lower=0, upper=10) k = ng.p.Choice(list(range(2,6))) w =…
kjans_tbme
  • 87
  • 6
0
votes
1 answer

python square function in nevergrad documentation

I am trying to learn the nevergrad library because it's used in our codebase and am following these docs. import nevergrad as ng def square(x, y=12): return sum((x - 0.5) ** 2) + abs(y) # optimization on x as an array of shape (2,) optimizer =…
0
votes
0 answers

What is the difference between SHGO and Nevergrad optimization technique?

I am currently trying to find some use cases to differentiate between the two optimization techniques i.e. Nevergrad (PSO) and SHGO. or which is more useful. Please help me with this..
0
votes
0 answers

How should I manage a parallel optimization of an instance method using ThreadPoolExecutor?

Useless intro Hi everyone, I'm having trouble with parallel use of nevergrad library. However, my question is about my implementation. It seems my OOP skills are not good. As the code is too long to reproduce here I will hypothesize while being…
0
votes
0 answers

object loaded by pickle is different than the intended

I am trying to optimize a function with nevergrad and save the resulting recommendation in a pickle. But when I assert saved_obj == loaded_obj it raises an error. To reproduce the issue I uploaded per_recommendation.pkl…