11.17. GTModel for Java

New in version 6.1.


11.17.1. Package net.datadvance.gtmodel

class GTApproxModel

GTModel interface.

GTApproxModel(final byte[] stored)

Constructor.

  • stored — GTApprox model.

double[] calc(double[] x)

Evaluate model output at the specified point.

  • x - single input vector
  • Returns: calculated response vector

double[] calcAE(double[] x)

Calculate accuracy evaluation (AE) estimate at the specified point.

  • x - single input vector
  • Returns: calculated AE vector

double[][] calcGrad(double[] x, int order)

Evaluate model gradient at the specified point.

  • x - single input vector
  • order - gradient matrix order: GRADIENT_F_MAJOR or GRADIENT_X_MAJOR
  • Returns: calculated gradients

Elements of the output matrix are ordered according to the order parameter:

  • If order is GRADIENT_F_MAJOR then the \(\frac{dF_i}{dx_j}\) gradient component is the [i][j]-th element of the output matrix.
  • If order is GRADIENT_X_MAJOR then the \(\frac{dF_i}{dx_j}\) gradient component is the [j][i]-th element of the output matrix.

See hasAE().

double[][] calcGradAE(double[] x, int order)

Calculate gradient of the accuracy evaluation estimate.

  • x - single input vector
  • order - gradient matrix order: GRADIENT_F_MAJOR or GRADIENT_X_MAJOR
  • Returns: calculated gradients

Elements of the output matrix are ordered according to the order parameter:

  • If order is GRADIENT_F_MAJOR then the \(\frac{dF_i}{dx_j}\) gradient component is the [i][j]-th element of the output matrix.
  • If order is GRADIENT_X_MAJOR then the \(\frac{dF_i}{dx_j}\) gradient component is the [j][i]-th element of the output matrix.

See hasAE().

String description()

Get model description in JSON format. This info contains all technical information that can be gathered from the model including build-time error prediction.

boolean hasAE()

Check if the model supports accuracy evaluation (AE).

int inputSize()

Get input dimension (the length of the model input vector).

int outputSize()

Get output dimension (the length of the model response vector).

void dispose()

Releases native resources.

void finalize()

Releases native resources.

static final int GRADIENT_F_MAJOR = 0

Function-major gradient matrix order: for n-dimensional input and m-dimensional output, \(\frac{dF_i}{dx_j}\) is the [i][j]-th element of the double[m][n] output matrix.

See calcGrad() and calcGradAE().

static final int GRADIENT_X_MAJOR = 1

Variable-major gradient matrix order: for n-dimensional input and m-dimensional output, \(\frac{dF_i}{dx_j}\) is the [j][i]-th element of the double[n][m] output matrix.

See calcGrad() and calcGradAE().