Triangulation

class safe_learning.Triangulation(discretization, vertex_values, project=False, name='triangulation')

Efficient Delaunay triangulation on regular grid.

This is a tensorflow wrapper around a numpy implementation.

This class is a wrapper around scipy.spatial.Delaunay for regular grids. It splits the space into regular hyperrectangles and then computes a Delaunay triangulation for only one of them. This single triangulation is then generalized to other hyperrectangles, without ever maintaining the full triangulation for all individual hyperrectangles.

Parameters:
discretization : instance of discretization

For example, an instance of GridWorld.

vertex_values : arraylike, optional

A 2D array with the values at the vertices of the grid on each row. Is converted into a tensorflow variable.

project : bool, optional

Whether to project points onto the limits.

name : string

The tensorflow scope for all methods.

Attributes:
discretization

Getter for the discretization.

nindex

Return the number of parameters.

parameters

Return the variables within the current scope.

project

Getter for the project parameter.

scope_name

Methods

__call__(self, \*args, \*\*kwargs) Evaluate the function using the template to ensure variable sharing.
build_evaluation(self, points) Evaluate using tensorflow.
copy_parameters(self, other_instance) Copy over the parameters of another instance.
gradient(self, points) Compute derivatives using tensorflow.
build_evaluation(self, points)

Evaluate using tensorflow.

copy_parameters(self, other_instance)

Copy over the parameters of another instance.

discretization

Getter for the discretization.

gradient(self, points)

Compute derivatives using tensorflow.

nindex

Return the number of parameters.

parameters

Return the variables within the current scope.

project

Getter for the project parameter.