Skip to content

API changes for v2 #32

Open
Open
@SimonBlanke

Description

@SimonBlanke

In this issue the progress for the API-changes for v2 is shown.

The objective-function parameter might make more sense in the optimizer-class instead of the search-method. Parameters in the method should be data you would want to change from one search to the next. It does not make sense to me to change the objective-function but not the search-space. So the new API-design would look like this:

import numpy as np
from gradient_free_optimizers import RandomSearchOptimizer

def parabola_function(para):
    loss = para["x"] * para["x"]
    return -loss

search_space = {"x": np.arange(-10, 10, 0.1)}

opt = RandomSearchOptimizer(parabola_function, search_space)
opt.search(n_iter=100000)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions