def dummy_env(self) -> Function: return Function.from_bounds_params( function=lambda x: numpy.ones(len(x)), shape=(2,), low=numpy.array([-10, -5]), high=numpy.array([10, 5]), )
def function_env() -> Function: return Function.from_bounds_params( function=lambda x: judo.ones(len(x)), shape=(2, ), low=tensor([-10, -5]), high=tensor([10, 5]), )
def function() -> Function: return Function.from_bounds_params( function=sphere, shape=(2, ), low=tensor([-10, -5]), high=tensor([10, 5]), )
def function() -> Function: return Function.from_bounds_params( function=sphere, shape=(2, ), low=numpy.array([-10, -5]), high=numpy.array([10, 5]), )
def env() -> Function: return Function.from_bounds_params( function=lambda x: np.ones(len(x)), shape=(2, ), low=np.array([-10, -5]), high=np.array([10, 5]), )
def test_from_bounds_params_error(self): with pytest.raises(TypeError): Function.from_bounds_params(function=sphere)