tesseract-runtime command line application

This is the command line interface of the Tesseract runtime that is bundled with each Tesseract container.

tesseract-runtime

Invoke the Tesseract runtime.

tesseract-runtime [OPTIONS] COMMAND [ARGS]...

Options

--name <name>

Overwrite the name config option.

--description <description>

Overwrite the description config option.

--version <version>

Overwrite the version config option.

--debug

Overwrite the debug config option.

--input-path <input_path>

Overwrite the input_path config option.

--output-path <output_path>

Overwrite the output_path config option.

--output-format <output_format>

Overwrite the output_format config option.

Options:

json | json+base64 | json+binref

--output-file <output_file>

Overwrite the output_file config option.

--mlflow-tracking-uri <mlflow_tracking_uri>

Overwrite the mlflow_tracking_uri config option.

--install-completion

Install completion for the current shell.

--show-completion

Show completion for the current shell, to copy it or customize the installation.

abstract-eval

Perform abstract evaluation of the Tesseract on the input data.

Calculate output shape of apply from the shape of its inputs.

First argument is the payload, which should be a JSON object with the following structure.

Input schema:
inputs: The abstract input data to evaluate the Tesseract on. Has the same structure as InputSchema, but with array fields replaced by ShapeDType.
a: An arbitrary vector normalized according to […]
shape: None
dtype: None
b: An arbitrary vector. Needs to have the same dimensions as a.
shape: None
dtype: None
s: A scalar. [default: 3]
normalize: True if the output should be normalized, False otherwise. [default: False]
Returns:
Abstract outputs with the same structure as OutputSchema, but with array fields replaced by ShapeDType.
result: Vector s·a + b
shape: None
dtype: None
tesseract-runtime abstract-eval [OPTIONS] PAYLOAD

Arguments

PAYLOAD

Required argument

apply

Apply the Tesseract to the input data.

Multiplies a vector a by s, and sums the result to b.

First argument is the payload, which should be a JSON object with the following structure.

Input schema:
inputs: The input data to apply the Tesseract to.
a: An arbitrary vector normalized according to […]
b: An arbitrary vector. Needs to have the same dimensions as a.
s: A scalar. [default: 3]
normalize: True if the output should be normalized, False otherwise. [default: False]
Returns:
The output data from applying the Tesseract.
result: Vector s·a + b
tesseract-runtime apply [OPTIONS] PAYLOAD

Arguments

PAYLOAD

Required argument

check

Check whether the Tesseract API is valid.

tesseract-runtime check [OPTIONS]

check-gradients

Check gradients of endpoints against a finite difference approximation.

This is an automated way to check the correctness of the gradients of the different AD endpoints
(jacobian, jacobian_vector_product, vector_jacobian_product) of a tesseract_api.py module.
It will sample random indices and compare the gradients computed by the AD endpoints with the
finite difference approximation.
Warning:
Finite differences are not exact and the comparison is done with a tolerance. This means
that the check may fail even if the gradients are correct, and vice versa.
Finite difference approximations are sensitive to numerical precision. When finite differences
are reported incorrectly as 0.0, it is likely that the chosen eps is too small, especially for
inputs that do not use float64 precision.
tesseract-runtime check-gradients [OPTIONS] JSON_PAYLOAD

Options

--input-paths <input_paths>

Paths to differentiable inputs to check gradients for.

Default:

'check all'

--output-paths <output_paths>

Paths to differentiable outputs to check gradients for.

Default:

'check all'

--endpoints <endpoints>

Endpoints to check gradients for.

Default:

'check all'

--eps <eps>

Step size for finite differences.

Default:

0.0001

--rtol <rtol>

Relative tolerance when comparing finite differences to gradients.

Default:

0.1

--max-evals <max_evals>

Maximum number of evaluations per input.

Default:

1000

--max-failures <max_failures>

Maximum number of failures to report per endpoint.

Default:

10

--seed <seed>

Seed for random number generator. If not set, a random seed is used.

--show-progress

Show progress bar.

Default:

True

Arguments

JSON_PAYLOAD

Required argument

JSON payload to pass to the Tesseract API. If prefixed with ‘@’, it is treated as a file path.

health

Get health status of the Tesseract instance.

tesseract-runtime health [OPTIONS]

jacobian

Computes the Jacobian of the Tesseract.

Differentiates jac_outputs with respect to jac_inputs, at the point inputs.

First argument is the payload, which should be a JSON object with the following structure.
Input schema:
inputs: The input data to compute the Jacobian at.
a: An arbitrary vector normalized according to […]
b: An arbitrary vector. Needs to have the same dimensions as a.
s: A scalar. [default: 3]
normalize: True if the output should be normalized, False otherwise. [default: False]
jac_inputs: The set of differentiable inputs to compute the Jacobian with respect to.
jac_outputs: The set of differentiable outputs to compute the Jacobian of.
Returns:
Container for the results of Jacobian computations. The result represents a nested structure of the Jacobian matrix as a mapping with structure {jac_outputs: {jac_inputs: array}}. The shape of each array is the concatenation of the shapes of the output and input arrays, i.e. (*output_array.shape, *input_array.shape).
tesseract-runtime jacobian [OPTIONS] PAYLOAD

Arguments

PAYLOAD

Required argument

jacobian-vector-product

Compute the Jacobian vector product of the Tesseract at the input data.

Evaluates the Jacobian vector product between the Jacobian given by jvp_outputs with respect to jvp_inputs at the point inputs and the given tangent vector.

First argument is the payload, which should be a JSON object with the following structure.
Input schema:
inputs: The input data to compute the JVP at.
a: An arbitrary vector normalized according to […]
b: An arbitrary vector. Needs to have the same dimensions as a.
s: A scalar. [default: 3]
normalize: True if the output should be normalized, False otherwise. [default: False]
jvp_inputs: The set of differentiable inputs to compute the JVP with respect to.
jvp_outputs: The set of differentiable outputs to compute the JVP of.
tangent_vector: Tangent vector to multiply the Jacobian with. Expected to be a mapping with structure {jvp_inputs: array}. The shape of each array is the same as the shape of the corresponding input array.
Returns:
Container for the results of Jacobian-vector products. The result is a mapping with structure {jvp_outputs: array}. The shape of each array is the same as the shape of the corresponding output array.
tesseract-runtime jacobian-vector-product [OPTIONS] PAYLOAD

Arguments

PAYLOAD

Required argument

openapi-schema

Get the openapi.json schema.

tesseract-runtime openapi-schema [OPTIONS]

serve

Start running this Tesseract’s web server.

tesseract-runtime serve [OPTIONS]

Options

--host <host>

Host IP address

Default:

'127.0.0.1'

--port <port>

Port number

Default:

8000

--num-workers <num_workers>

Number of worker processes

Default:

1

vector-jacobian-product

Compute the Jacobian vector product of the Tesseract at the input data.

Computes the vector Jacobian product between the Jacobian given by vjp_outputs with respect to vjp_inputs at the point inputs and the given cotangent vector.

First argument is the payload, which should be a JSON object with the following structure.
Input schema:
inputs: The input data to compute the VJP at.
a: An arbitrary vector normalized according to […]
b: An arbitrary vector. Needs to have the same dimensions as a.
s: A scalar. [default: 3]
normalize: True if the output should be normalized, False otherwise. [default: False]
vjp_inputs: The set of differentiable inputs to compute the VJP with respect to.
vjp_outputs: The set of differentiable outputs to compute the VJP of.
cotangent_vector: Cotangent vector to multiply the Jacobian with. Expected to be a mapping with structure {vjp_outputs: array}. The shape of each array is the same as the shape of the corresponding output array.
Returns:
Container for the results of vector-Jacobian products. The result is a mapping with structure {vjp_inputs: array}. The shape of each array is the same as the shape of the corresponding input array.
tesseract-runtime vector-jacobian-product [OPTIONS] PAYLOAD

Arguments

PAYLOAD

Required argument