Problem

class nrv.optim.Problem(cost_function: cost_function = None, optimizer: Optimizer = None, save_problem_results: bool = False, problem_fname: str = 'optim.json', n_proc: int = None)[source]

Problem Class

A class to describe problems that should be optimized with the NRV Framework. The problem should be described with a simulation and a cost, using the object cost_function, and various optimization algorithms can be used to find optimal solution.

This class is abstract and is not supposed to be used directly by the end user. NRV can handle two types of problems: - problems where a geometric parameter can be optimized: please refer to … - problems where the waveform can be optimized: please refer to …

Attributes

Problem.costfunction

Cost function of a Problem, the cost function should be a CosFunction object, it should return a scalar.

Problem.optimizer

Optimizer of the problem, the Optimizer should be an Optimizer object.

Problem.optmizer

Optimizer of the problem, the Optimizer should be an Optimizer object.

Methods

Problem.__init__([cost_function, optimizer, ...])

Initialize an optimization problem coupling a cost function and an optimizer.

Problem.autoset_optimizer()

Placeholder for automatic optimizer selection.

Problem.compute_cost(X)

Evaluate the scalar cost at one position vector.

Problem.context_and_cost(context_func, ...)

Convenience helper to build and assign a cost_function.

Problem.get_parameters()

Generic method returning all the atributes of an NRV_class instance

Problem.load(data[, blacklist])

Generic loading method for NRV_class instance

Problem.save([save, fname, blacklist])

Generic saving method for NRV_class instance.

Problem.set_multiprocess_type([...])

Set if multiprocessing should be applied to the optimizaiton or the CostFunction simulation

Problem.set_parameters(**kawrgs)

Generic method to set any attribute of NRV_class instance