(self, discretization, lyapunov_function, dynamics,
                 lipschitz_dynamics, lipschitz_lyapunov,
                 tau, policy, initial_set=None, adaptive=False)
Initialization, see `Lyapunov` for details.
Initialization, see `Lyapunov` for details.
Initialization see Lyapunov for details .
def __init__(self, discretization, lyapunov_function, dynamics,
                 lipschitz_dynamics, lipschitz_lyapunov,
                 tau, policy, initial_set=None, adaptive=False):
        """Initialization, see `Lyapunov` for details."""
        super(Lyapunov, self).__init__()

        self.discretization = discretization
        self.policy = policy

        # Keep track of the safe sets
        self.safe_set = np.zeros(np.prod(discretization.num_points),
                                 dtype=bool)

        self.initial_safe_set = initial_set
        if initial_set is not None:
            self.safe_set[initial_set] = True

        # Discretization constant
        self.tau = tau

        # Make sure dynamics are of standard framework
        self.dynamics = dynamics

        # Make sure Lyapunov fits into standard framework
        self.lyapunov_function = lyapunov_function

        # Storage for graph
        self._storage = dict()
        self.feed_dict = get_feed_dict(tf.get_default_graph())

        # Lyapunov values
        self.values = None

        self.c_max = tf.placeholder(config.dtype, shape=())
        self.feed_dict[self.c_max] = 0.

        self._lipschitz_dynamics = lipschitz_dynamics
        self._lipschitz_lyapunov = lipschitz_lyapunov

        self.update_values()

        self.adaptive = adaptive

        # Keep track of the refinement `N(x)` used around each state `x` in
        # the adaptive discretization; `N(x) = 0` by convention if `x` is
        # unsafe
        self._refinement = np.zeros(discretization.nindex, dtype=int)
        if initial_set is not None:
            self._refinement[initial_set] = 1
def __init__ ( self , discretization , lyapunov_function , dynamics , lipschitz_dynamics , lipschitz_lyapunov , tau , policy , initial_set = None , adaptive = False ) : super ( Lyapunov , self ) . __init__ ( ) self . discretization = discretization self . policy = policy # Keep track of the safe sets self . safe_set = np . zeros ( np . prod ( discretization . num_points ) , dtype = bool ) self . initial_safe_set = initial_set if initial_set is not None : self . safe_set [ initial_set ] = True # Discretization constant self . tau = tau # Make sure dynamics are of standard framework self . dynamics = dynamics # Make sure Lyapunov fits into standard framework self . lyapunov_function = lyapunov_function # Storage for graph self . _storage = dict ( ) self . feed_dict = get_feed_dict ( tf . get_default_graph ( ) ) # Lyapunov values self . values = None self . c_max = tf . placeholder ( config . dtype , shape = ( ) ) self . feed_dict [ self . c_max ] = 0. self . _lipschitz_dynamics = lipschitz_dynamics self . _lipschitz_lyapunov = lipschitz_lyapunov self . update_values ( ) self . adaptive = adaptive # Keep track of the refinement `N(x)` used around each state `x` in # the adaptive discretization; `N(x) = 0` by convention if `x` is # unsafe self . _refinement = np . zeros ( discretization . nindex , dtype = int ) if initial_set is not None : self . _refinement [ initial_set ] = 1