intprim
|
The MixtureModel class is an extension of BasisModel to multiple basis spaces for multiple degrees of freedom. More...
Public Member Functions | |
def | __init__ (self, basis_models) |
Initialization method for the MixtureModel class. More... | |
def | get_block_diagonal_basis_matrix (self, x, out_array=None, start_row=0, start_col=0) |
Gets the block diagonal basis matrix for the given phase value(s). More... | |
def | get_block_diagonal_basis_matrix_derivative (self, x, out_array=None, start_row=0, start_col=0) |
Gets the block diagonal basis derivative matrix for the given phase value(s). More... | |
def | get_weighted_vector_derivative (self, x, weights, out_array=None, start_row=0, start_col=0) |
Gets the weighted vector derivatives corresponding to this basis model for the given basis state. More... | |
def | fit_basis_functions_linear_closed_form (self, x, y) |
Fits the given trajectory to this basis model via least squares. More... | |
def | apply_coefficients (self, x, coefficients, deriv=False) |
Applies the given weights to this basis model. More... | |
def | observed_to_state_indices (self, observed_indices) |
def | observed_indices_related (self, observed_indices) |
def | __init__ (self, basis_models) |
Initialization method for the MixtureModel class. More... | |
def | get_block_diagonal_basis_matrix (self, x, out_array=None, start_row=0, start_col=0) |
Gets the block diagonal basis matrix for the given phase value(s). More... | |
def | get_block_diagonal_basis_matrix_derivative (self, x, out_array=None, start_row=0, start_col=0) |
Gets the block diagonal basis derivative matrix for the given phase value(s). More... | |
def | get_weighted_vector_derivative (self, x, weights, out_array=None, start_row=0, start_col=0) |
Gets the weighted vector derivatives corresponding to this basis model for the given basis state. More... | |
def | fit_basis_functions_linear_closed_form (self, x, y) |
Fits the given trajectory to this basis model via least squares. More... | |
def | apply_coefficients (self, x, coefficients, deriv=False) |
Applies the given weights to this basis model. More... | |
def | observed_to_state_indices (self, observed_indices) |
def | observed_indices_related (self, observed_indices) |
![]() | |
def | __init__ (self, degree, observed_dof_names) |
Initialization method for the BasisModel class. More... | |
def | get_block_diagonal_basis_matrix (self, x, out_array=None, start_row=0, start_col=0) |
Gets the block diagonal basis matrix for the given phase value(s). More... | |
def | get_block_diagonal_basis_matrix_derivative (self, x, out_array=None, start_row=0, start_col=0) |
Gets the block diagonal basis derivative matrix for the given phase value(s). More... | |
def | get_weighted_vector_derivative (self, x, weights, out_array=None, start_row=0, start_col=0) |
Gets the weighted vector derivatives corresponding to this basis model for the given basis state. More... | |
def | fit_basis_functions_linear_closed_form (self, x, y) |
Fits the given trajectory to this basis model via least squares. More... | |
def | apply_coefficients (self, x, coefficients, deriv=False) |
Applies the given weights to this basis model. More... | |
def | plot (self) |
def | plot_derivative (self) |
def | plot_weighted (self, coefficients, coefficient_names) |
def | observed_to_state_indices (self, observed_indices) |
def | observed_indices_related (self, observed_indices) |
def | __init__ (self, degree, observed_dof_names) |
Initialization method for the BasisModel class. More... | |
def | get_block_diagonal_basis_matrix (self, x, out_array=None, start_row=0, start_col=0) |
Gets the block diagonal basis matrix for the given phase value(s). More... | |
def | get_block_diagonal_basis_matrix_derivative (self, x, out_array=None, start_row=0, start_col=0) |
Gets the block diagonal basis derivative matrix for the given phase value(s). More... | |
def | get_weighted_vector_derivative (self, x, weights, out_array=None, start_row=0, start_col=0) |
Gets the weighted vector derivatives corresponding to this basis model for the given basis state. More... | |
def | fit_basis_functions_linear_closed_form (self, x, y) |
Fits the given trajectory to this basis model via least squares. More... | |
def | apply_coefficients (self, x, coefficients, deriv=False) |
Applies the given weights to this basis model. More... | |
def | plot (self) |
def | plot_derivative (self) |
def | plot_weighted (self, coefficients, coefficient_names) |
def | observed_to_state_indices (self, observed_indices) |
def | observed_indices_related (self, observed_indices) |
Public Attributes | |
observed_dof_names | |
num_observed_dof | |
observed_dof_to_model_map | |
observed_dof_to_degree_map | |
basis_models | |
model_degrees | |
block_prototype | |
![]() | |
observed_dof_names | |
num_observed_dof | |
block_prototype | |
The MixtureModel class is an extension of BasisModel to multiple basis spaces for multiple degrees of freedom.
This allows a user to define separate models for each degree of freedom. For example, in a 3 DoF model the first 2 DoFs might both belong to a GaussianModel while the 3rd belongs to a SigmoidalModel.
def intprim.basis.mixture_model.MixtureModel.__init__ | ( | self, | |
basis_models | |||
) |
Initialization method for the MixtureModel class.
basis_models | array-like, shape(num_basis_models, ). Contains a list of (non-MixtureModel) basis models that are encapsulated in this model. |
def intprim.basis.mixture_model.MixtureModel.__init__ | ( | self, | |
basis_models | |||
) |
Initialization method for the MixtureModel class.
basis_models | array-like, shape(num_basis_models, ). Contains a list of (non-MixtureModel) basis models that are encapsulated in this model. |
def intprim.basis.mixture_model.MixtureModel.apply_coefficients | ( | self, | |
x, | |||
coefficients, | |||
deriv = False |
|||
) |
Applies the given weights to this basis model.
Projects a basis state to the measurement space.
x | Scalar of vector of dimension T containing the phase values to project at. |
coefficients | Vector of dimension degree * num_observed_dof containing the basis weights. |
deriv | True to use basis function derivative, False to use regular basis functions. |
def intprim.basis.mixture_model.MixtureModel.apply_coefficients | ( | self, | |
x, | |||
coefficients, | |||
deriv = False |
|||
) |
Applies the given weights to this basis model.
Projects a basis state to the measurement space.
x | Scalar of vector of dimension T containing the phase values to project at. |
coefficients | Vector of dimension degree * num_observed_dof containing the basis weights. |
deriv | True to use basis function derivative, False to use regular basis functions. |
def intprim.basis.mixture_model.MixtureModel.fit_basis_functions_linear_closed_form | ( | self, | |
x, | |||
y | |||
) |
Fits the given trajectory to this basis model via least squares.
x | Vector of dimension T containing the phase values of the trajectory. |
y | Matrix of dimension num_observed_dof x T containing the observations of the trajectory. |
coefficients | Vector of dimension degree * num_observed_dof containing the fitted basis weights. |
def intprim.basis.mixture_model.MixtureModel.fit_basis_functions_linear_closed_form | ( | self, | |
x, | |||
y | |||
) |
Fits the given trajectory to this basis model via least squares.
x | Vector of dimension T containing the phase values of the trajectory. |
y | Matrix of dimension num_observed_dof x T containing the observations of the trajectory. |
coefficients | Vector of dimension degree * num_observed_dof containing the fitted basis weights. |
def intprim.basis.mixture_model.MixtureModel.get_block_diagonal_basis_matrix | ( | self, | |
x, | |||
out_array = None , |
|||
start_row = 0 , |
|||
start_col = 0 |
|||
) |
Gets the block diagonal basis matrix for the given phase value(s).
Used to transform vectors from the basis space to the measurement space.
x | Scalar of vector of dimension T containing the phase values to use in the creation of the block diagonal matrix. |
out_array | Matrix of dimension greater to or equal than (degree * num_observed_dof * T) x num_observed_dof in which the results are stored. If none, an internal matrix is used. |
start_row | A row offset to apply to results in the block diagonal matrix. |
start_col | A column offset to apply to results in the block diagonal matrix. |
def intprim.basis.mixture_model.MixtureModel.get_block_diagonal_basis_matrix | ( | self, | |
x, | |||
out_array = None , |
|||
start_row = 0 , |
|||
start_col = 0 |
|||
) |
Gets the block diagonal basis matrix for the given phase value(s).
Used to transform vectors from the basis space to the measurement space.
x | Scalar of vector of dimension T containing the phase values to use in the creation of the block diagonal matrix. |
out_array | Matrix of dimension greater to or equal than (degree * num_observed_dof * T) x num_observed_dof in which the results are stored. If none, an internal matrix is used. |
start_row | A row offset to apply to results in the block diagonal matrix. |
start_col | A column offset to apply to results in the block diagonal matrix. |
def intprim.basis.mixture_model.MixtureModel.get_block_diagonal_basis_matrix_derivative | ( | self, | |
x, | |||
out_array = None , |
|||
start_row = 0 , |
|||
start_col = 0 |
|||
) |
Gets the block diagonal basis derivative matrix for the given phase value(s).
Used to transform vectors from the derivative basis space to the measurement space.
x | Scalar containing the phase value to use in the creation of the block diagonal matrix. |
out_array | Matrix of dimension greater to or equal than (degree * num_observed_dof) x num_observed_dof in which the results are stored. If none, an internal matrix is used. |
start_row | A row offset to apply to results in the block diagonal matrix. |
start_col | A column offset to apply to results in the block diagonal matrix. |
def intprim.basis.mixture_model.MixtureModel.get_block_diagonal_basis_matrix_derivative | ( | self, | |
x, | |||
out_array = None , |
|||
start_row = 0 , |
|||
start_col = 0 |
|||
) |
Gets the block diagonal basis derivative matrix for the given phase value(s).
Used to transform vectors from the derivative basis space to the measurement space.
x | Scalar containing the phase value to use in the creation of the block diagonal matrix. |
out_array | Matrix of dimension greater to or equal than (degree * num_observed_dof) x num_observed_dof in which the results are stored. If none, an internal matrix is used. |
start_row | A row offset to apply to results in the block diagonal matrix. |
start_col | A column offset to apply to results in the block diagonal matrix. |
def intprim.basis.mixture_model.MixtureModel.get_weighted_vector_derivative | ( | self, | |
x, | |||
weights, | |||
out_array = None , |
|||
start_row = 0 , |
|||
start_col = 0 |
|||
) |
Gets the weighted vector derivatives corresponding to this basis model for the given basis state.
x | Scalar containing the phase value to use in the creation of the block diagonal matrix. |
weights | Vector of dimension degree * num_observed_dof containing the weights for this basis model. |
out_array | Matrix of dimension greater to or equal than 1 x degree in which the results are stored. If none, an internal matrix is used. |
start_row | A row offset to apply to results in the block diagonal matrix. |
start_col | A column offset to apply to results in the block diagonal matrix. |
def intprim.basis.mixture_model.MixtureModel.get_weighted_vector_derivative | ( | self, | |
x, | |||
weights, | |||
out_array = None , |
|||
start_row = 0 , |
|||
start_col = 0 |
|||
) |
Gets the weighted vector derivatives corresponding to this basis model for the given basis state.
x | Scalar containing the phase value to use in the creation of the block diagonal matrix. |
weights | Vector of dimension degree * num_observed_dof containing the weights for this basis model. |
out_array | Matrix of dimension greater to or equal than 1 x degree in which the results are stored. If none, an internal matrix is used. |
start_row | A row offset to apply to results in the block diagonal matrix. |
start_col | A column offset to apply to results in the block diagonal matrix. |