model.deeplearn package

Subpackages

Submodules

model.deeplearn.conv_autoenc_pwise_classif_model module

class model.deeplearn.conv_autoenc_pwise_classif_model.ConvAutoencPwiseClassifModel(**kwargs)

Bases: ClassificationModel

Author:

Alberto M. Esmoris Pena

Convolutional autoencoder model for classification tasks. See ClassificationModel.

Variables:

model (DLModelHandler) – The deep learning model wrapped by the corresponding handler, i.e., the ConvAutoencPwiseClassif model wrapped by a SimpleDLModelHandler handler.

static extract_model_args(spec)

Extract the arguments to initialize/instantiate a ConvAutoencPwiseClassifModel from a key-word specification.

Parameters:

spec – The key-word specification containing the arguments.

Returns:

The arguments to initialize/instantiate a ConvAutoencPwiseClassifModel.

__init__(**kwargs)

Initialize an instance of ConvAutoencPwiseClassifModel.

Parameters:

kwargs – The attributes for the ConvAutoencPwiseClassifModel that will also be passed to the parent.

is_deep_learning_model()

See Model and model.Model.is_deep_learning_model().

prepare_model()

Prepare a convolutional autoencoder point-wise classifier with current model arguments.

Returns:

The prepared model itself. Note it is also assigned as the model attribute of the object/instance.

Return type:

ConvAutoencPwiseClassif

overwrite_pretrained_model(spec)

See model.Model.overwrite_pretrained_model().

update_paths()

Consider the current specification of model args (self.model_args) to update the paths.

predict(pcloud, X=None, F=None)

Use the model to compute predictions on the input point cloud.

The behavior of the base implementation (see model.Model.predict()) is extended to account for X and F matrix as different entities.

Parameters:
  • X (np.ndarray) – The input matrix of coordinates where each row represents a point from the point cloud (OPTIONAL). If not given, it will be retrieved from the point cloud.

  • F (np.ndarray) – The input matrix of features (OPTIONAL). If not given, it will be retrieved from the point cloud if there are feature names (fnames) available.

get_input_from_pcloud(pcloud)

See model.Model.get_input_from_pcloud().

training(X, y, F=None, info=True)

The fundamental training logic to train a convolutional autoencoder point-wise classifier.

See ClassificationModel and Model. Also see model.Model.training().

Parameters:

F (np.ndarray) – An optional (can be None) matrix of input features.

on_training_finished(X, y, yhat=None)

See model.Model.on_training_finished().

compute_pwise_activations(X, reducer=None)

Compute the point-wise activations of the last layer before the output softmax (or sigmoid for binary classification) layer in the convolutional autoencoder point-wise classification model.

Parameters:
  • X (np.ndarray or list) – The matrix of coordinates representing the point cloud. Alternatively, it can be a list such that X[0] is the matrix of coordinates and X[1] the matrix of features.

  • reducer (PredictionReducer or None) – The prediction reducer to reduce the point-wise activations (it should be the same used for typical predictions).

Returns:

The matrix of point-wise activations where points are rows and the columns are the components of the output activation function (activated vector or point-wise features).

Return type:

np.ndarray

model.deeplearn.deep_learning_exception module

exception model.deeplearn.deep_learning_exception.DeepLearningException(message='')

Bases: VL3DException

Author:

Alberto M. Esmoris Pena

Class for exceptions related to deep learning components. See VL3DException.

__init__(message='')

model.deeplearn.point_net_pwise_classif_model module

class model.deeplearn.point_net_pwise_classif_model.PointNetPwiseClassifModel(**kwargs)

Bases: ClassificationModel

Author:

Alberto M. Esmoris Pena

PointNet model for point-wise classification tasks. See ClassificationModel.

Variables:

model (DLModelHandler) – The deep learning model wrapped by the corresponding handler, i.e., the PointNetPwiseClassif model wrapped by a SimpleDLModelHandler handler.

static extract_model_args(spec)

Extract the arguments to initialize/instantiate a PointNetPwiseClassifModel from a key-word specification.

Parameters:

spec – The key-word specification containing the arguments.

Returns:

The arguments to initialize/instantiate a PointNetPwiseClassifModel.

__init__(**kwargs)

Initialize an instance of PointNetPwiseClassifModel.

Parameters:

kwargs – The attributes for the PointNetPwiseClassifModel that will also be passed to the parent.

is_deep_learning_model()

See Model and model.Model.is_deep_learning_model().

prepare_model()

Prepare a PointNet point-wise classifier with current model arguments.

Returns:

The prepared model itself. Note it is also assigned as the model attribute of the object/instance.

Return type:

PointNetPwiseClassif

overwrite_pretrained_model(spec)

See model.Model.overwrite_pretrained_model().

static update_pretrained_model(dlmodel, spec)

See PointNetPwiseClassifModel.overwrite_pretrained_model().

static update_pretrained_model_inner_dict(new_dict_container, target_dict_container, dict_name)

Assist the PointNetPwiseClassifModel.update_pretrained_model() method to update the inner dictionaries of a dlmodel. Typically, the inner dictionaries that are children of dlmodel.model_args.

Parameters:
  • new_dict_container – The object containing the new version of the dictionary.

  • target_dict_container – The object containing the target version of the dictionary, i.e., the one that must be updated.

  • dict_name – The name of the dictionary to be updated.

Returns:

Nothing at all, but the target dictionary is updated inplace.

update_paths()

Consider the current specification of model args (self.model_args) to update the paths.

predict(pcloud, X=None, F=None, plots_and_reports=True)

Use the model to compute predictions on the input point cloud.

The behavior of the base implementation (see model.Model.predict()) is extended to account for X as a coordinates matrix and to ignore F. In other words, this PointNet implementation does not support input features.

Parameters:
  • X (np.ndarray) – The input matrix of coordinates where each row represents a point from the point cloud: If not given, it will be retrieved from the point cloud.

  • F – Ignored.

get_input_from_pcloud(pcloud)

See model.Model.get_input_from_pcloud().

training(X, y, F=None, info=True)

The fundamental training logic to train a PointNet-based point-wise classifier.

See ClassificationModel and Model. Also see model.Model.training().

Parameters:

F – Ignored.

on_training_finished(X, y, yhat=None)

See model.Model.on_training_finished().

static on_training_finished_predict(dlmodel, X, y, yhat)

See PointNetPwiseClassifModel.on_training_finished() and PointNetPwiseClassifModel.on_training_finished_evaluate().

static on_training_finished_evaluate(dlmodel, X, y, zhat, yhat, reducer=None)

See PointNetPwiseClassifModel.on_training_finished() and PointNetPwiseClassifModel.on_training_finished_predict().

compute_pwise_activations(X)

Compute the point wise activations of the last layer before the output softmax layer in the PointNet-based point-wise classification model.

Parameters:

X (np.ndarray) – The matrix of coordinates representing the point cloud.

Returns:

The matrix of point wise activations where points are rows and the columns are the components of the output activation function (activated vector or point-wise features).

Return type:

np.ndarray

static do_pwise_activations(model, remodel, X, reducer=None)

Assist the PointNetPwiseClassifModel.compute_pwise_activations() method.

model.deeplearn.rbf_net_pwise_classif_model module

class model.deeplearn.rbf_net_pwise_classif_model.RBFNetPwiseClassifModel(**kwargs)

Bases: ClassificationModel

Author:

Alberto M. Esmoris Pena

RBFNet model for point-wise classification tasks. See ClassificationModel.

Variables:

model (DLModelHandler) – The deep learning model wrapped by the corresponding handler, i.e., the RBFNetPwiseClassif model wrapped by a SimpleDLModelHandler handler.

static extract_model_args(spec)

Extract the arguments to initialize/instantiate a RBFNetPwiseClassifModel from a key-word specification.

Parameters:

spec – The key-word specification containing the arguments.

Returns:

The arguments to initialize/instantiate a RBFNetPwiseClassifModel.

__init__(**kwargs)

Initialize an instance of RBFNetPwiseClassifModel.

Parameters:

kwargs – The attributes for the RBFNetPwiseClassifModel that will also be passed to the parent.

is_deep_learning_model()

See Model and model.Model.is_deep_learning_model().

prepare_model()

Prepare a RBFNet point-wise classifier with current model arguments.

Returns:

The prepared model itself. Note it is also assigned as the model attribute of the object/instance.

Return type:

RBFNetPwiseClassif

overwrite_pretrained_model(spec)

See model.Model.overwrite_pretrained_model().

update_paths()

Consider the current specification of model args (self.model_args) to update the paths.

predict(pcloud, X=None, F=None, plots_and_reports=True)

Use the model to compute predictions on the input point cloud.

The behavior of the base implementation (see model.Model.predict()) is extended to account for X as a coordinates matrix and to ignore F. In other words, this RBFNet implementation does not support input features.

Parameters:
  • pcloud (PointCloud) – The input point cloud

  • X (np.ndarray) – The input matrix of coordinates where each row represents a point from the point cloud: If not given, it will be retrieved from the point cloud.

  • F – Ignored.

get_input_from_pcloud(pcloud)

See model.Model.get_input_from_pcloud().

training(X, y, F=None, info=True)

The fundamental training logic to train a RBFNet-based point-wise classifier.

See ClassificationModel and Model. Also see model.Model.training().

Parameters:

F – Ignored.

on_training_finished(X, y, yhat=None)

See model.Model.on_training_finished().

compute_pwise_activations(X)

Compute the point wise activations of the last layer before the output softmax layer in the RBFNet-based point-wise classification model.

Parameters:

X (np.ndarray) – The matrix of coordinates representing the point cloud.

Returns:

The matrix of point wise activations where points are rows and the columns are the components of the output activation function (activated vector or point-wise features).

Return type:

np.ndarray

model.deeplearn.spconv3d_pwise_classif_model module

class model.deeplearn.spconv3d_pwise_classif_model.SpConv3DPwiseClassifModel(**kwargs)

Bases: ClassificationModel

Author:

Alberto M. Esmoris Pena

Sparse 3D convolutional model for classification tasks. See ClassificationModel.

Variables:

model (DLModelHandler) – The deep learning model wrapped by the corresponding handler, i.e., the SpConv3DPwiseClassif model wrapped by a SimpleDLModelHandler handler.

static extract_model_args(spec)

Extract the arguments to initialize/instantiate a SpConv3DPwiseClassifModel from a key-word specification.

Parameters:

spec – The key-word specification containing the arguments.

Returns:

The arguments to initialize/instantiate a SpConv3DPwiseClassifModel.

__init__(**kwargs)

Initialize an instance of SpConv3DPwiseClassifModel.

Parameters:

kwargs – The attributes for the SpConv3DPwiseClassifModel that will also be passed to the parent.

is_deep_learning_model()

See Model and model.Model.is_deep_learning_model().

prepare_model()

Prepare a sparse 3D convolutional point-wise classifier with current model arguments.

Returns:

The prepared model itself. Note it is also assigned as the model attribute of the object/instance.

Return type:

SpConv3DPwiseClassifModel

overwrite_pretrained_model(spec)

See model.Model.overwrite_pretrained_model().

update_paths()

Consider the current specification of model args (self.model_args) to update the paths.

predict(pcloud, X=None, F=None)

Use the model to compute predictions on the input point cloud.

The behavior of the base implementation (see model.Model.predict()) is extended to account for X and F matrix as different entities.

Parameters:
  • X (np.ndarray) – The input matrix of coordinates where each row represents a point from the point cloud (OPTIONAL). If not given, it will be retrieved from the point cloud.

  • F (np.ndarray) – The input matrix of features (OPTIONAL). If not given, it will be retrieved from the point cloud if there are feature names (fnames) available.

get_input_from_pcloud(pcloud)

See model.Model.get_input_from_pcloud().

training(X, y, F=None, info=True)

The fundamental training logic to train a sparse 3D convolutional point-wise classifier.

See ClassificationModel and Model. Also see model.Model.training().

Parameters:

F (np.ndarray) – An optional (can be None) matrix of input features.

on_training_finished(X, y, yhat=None)

See model.Model.on_training_finished().

compute_pwise_activations(X, reducer=None)

Compute the point-wise activations of the last layer before the output softmax (or sigmoid for binary classification) layer in the 3D sparse convolutional point-wise classification model.

Parameters:
  • X (np.ndarray or list) – The matrix of coordinates representing the point cloud. Alternatively, it can be a list such that X[0] is the matrix of coordinates and X[1] the matrix of features.

  • reducer (PredictionReducer or None) – The prediction reducer to reduce the point-wise activations (it should be the same used for typical predictions).

Returns:

The matrix of point-wise activations where points are rows and the columns are the components of the output activation function (activated vector or point-wise features).

Return type:

np.ndarray

Module contents

author:

Alberto M. Esmoris Pena

The deeplearn package contains the logic to handle deep learning-based models for classification and regression problems on point clouds.