Пример #1
0
 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]),
     )
Пример #2
0
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]),
    )
Пример #3
0
def function() -> Function:
    return Function.from_bounds_params(
        function=sphere,
        shape=(2, ),
        low=tensor([-10, -5]),
        high=tensor([10, 5]),
    )
Пример #4
0
def function() -> Function:
    return Function.from_bounds_params(
        function=sphere,
        shape=(2, ),
        low=numpy.array([-10, -5]),
        high=numpy.array([10, 5]),
    )
Пример #5
0
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]),
    )
Пример #6
0
 def test_from_bounds_params_error(self):
     with pytest.raises(TypeError):
         Function.from_bounds_params(function=sphere)