Open3D (C++ API)
0.18.0+3975044
|
Data Structures | |
struct | InterpolationVec |
Class for computing interpolation weights. More... | |
struct | InterpolationVec< T, VECSIZE, InterpolationMode::NEAREST_NEIGHBOR > |
Implementation for NEAREST_NEIGHBOR. More... | |
struct | InterpolationVec< T, VECSIZE, InterpolationMode::LINEAR > |
Implementation for LINEAR (uses coordinate clamping) More... | |
struct | InterpolationVec< T, VECSIZE, InterpolationMode::LINEAR_BORDER > |
Implementation for LINEAR_BORDER (uses zero border instead of clamping) More... | |
class | MemoryAllocation |
A class for managing memory segments within a memory allocation. More... | |
class | Adaptor |
Adaptor for nanoflann. More... | |
struct | SelectNanoflannAdaptor |
struct | SelectNanoflannAdaptor< L2, T > |
struct | SelectNanoflannAdaptor< L1, T > |
class | Accumulator |
class | AccumulatorBackprop |
Enumerations | |
enum class | InterpolationMode { LINEAR , LINEAR_BORDER , NEAREST_NEIGHBOR } |
enum class | CoordinateMapping { BALL_TO_CUBE_RADIAL , BALL_TO_CUBE_VOLUME_PRESERVING , IDENTITY } |
enum | Metric { L1 , L2 , Linf } |
Supported metrics. More... | |
enum | AccumulationFn { AVERAGE = 0 , NEAREST_NEIGHBOR , NEAREST_NEIGHBOR , MAX , CENTER } |
Functions | |
template<class TFeat , class TOut , class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool POINT_IMPORTANCE> | |
void | _CConvComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_importance, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, bool normalize) |
template<class TFeat , class TOut , class TReal , class TIndex > | |
void | CConvComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_importance, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize) |
template<class TFeat , class TOut , class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool POINT_IMPORTANCE> | |
void | _CConvBackropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_importance, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TFeat *out_features_gradient, bool normalize) |
template<class TFeat , class TOut , class TReal , class TIndex > | |
void | CConvBackpropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_importance, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TFeat *out_features_gradient, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize) |
template<class TFeat , class TReal , class TIndex > | |
void | FillColumn (const cudaStream_t &stream, TFeat *columns, int in_channels, TIndex begin_idx, TIndex end_idx, TIndex num_out, const TReal *const __restrict__ out_positions, TIndex num_inp, const TReal *const __restrict__ inp_positions, const TFeat *const __restrict__ inp_features, const TFeat *const __restrict__ inp_importance, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TFeat *const __restrict__ neighbors_importance, const int64_t *const __restrict__ neighbors_row_splits, const TReal *const __restrict__ extents, const TReal *const __restrict__ offsets, const std::vector< int > &filter_dims, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize) |
template<class TFeat , class TReal , class TIndex > | |
void | FillColumnTranspose (const cudaStream_t &stream, TFeat *columns, int in_channels, TIndex begin_idx, TIndex end_idx, TIndex num_out, const TReal *const __restrict__ out_positions, TIndex num_inp, const TReal *const __restrict__ inp_positions, const TFeat *const __restrict__ inp_features, const TFeat *const __restrict__ inp_neighbors_importance_sum, const int64_t *const __restrict__ inp_neighbors_prefix_sum, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TFeat *const __restrict__ neighbors_importance, const int64_t *const __restrict__ neighbors_row_splits, const TReal *const __restrict__ extents, const TReal *const __restrict__ offsets, const std::vector< int > &filter_dims, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize) |
template<class T > | |
void | MultiplyColumns (const cudaStream_t &stream, size_t rows, size_t cols, T *__restrict__ col_major_matrix, const T *const __restrict__ vector) |
template<class T > | |
void | MultiplyAndCopyColumns (const cudaStream_t &stream, size_t rows, size_t cols, T *__restrict__ out_ptr, const T *const __restrict__ col_major_matrix, const T *const __restrict__ vector) |
template<class TFeat , class TOut , class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool NORMALIZE> | |
void | _CConvTransposeComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, const TReal *out_positions, const TFeat *out_importance, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets) |
template<class TFeat , class TOut , class TReal , class TIndex > | |
void | CConvTransposeComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, const TReal *out_positions, const TFeat *out_importance, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize) |
template<class TFeat , class TOut , class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool NORMALIZE> | |
void | _CConvTransposeBackpropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, const TFeat *out_importance, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TFeat *out_features_gradient) |
template<class TFeat , class TOut , class TReal , class TIndex > | |
void | CConvTransposeBackpropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, const TFeat *out_importance, size_t num_inp, const TReal *inp_positions, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t neighbors_index_size, const TIndex *neighbors_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TFeat *out_features_gradient, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize) |
template<class T , int VECSIZE> | |
void | MapSphereToCylinder (Eigen::Array< T, VECSIZE, 1 > &x, Eigen::Array< T, VECSIZE, 1 > &y, Eigen::Array< T, VECSIZE, 1 > &z) |
template<class T , int VECSIZE> | |
void | MapCylinderToCube (Eigen::Array< T, VECSIZE, 1 > &x, Eigen::Array< T, VECSIZE, 1 > &y, Eigen::Array< T, VECSIZE, 1 > &z) |
template<bool ALIGN_CORNERS, CoordinateMapping MAPPING, class T , int VECSIZE> | |
void | ComputeFilterCoordinates (Eigen::Array< T, VECSIZE, 1 > &x, Eigen::Array< T, VECSIZE, 1 > &y, Eigen::Array< T, VECSIZE, 1 > &z, const Eigen::Array< int, 3, 1 > &filter_size, const Eigen::Array< T, VECSIZE, 3 > &inv_extents, const Eigen::Array< T, 3, 1 > &offset) |
template<class TIndex , class TAttr > | |
void | InvertNeighborsListCPU (const TIndex *const inp_neighbors_index, const TAttr *const inp_neighbors_attributes, const int num_attributes_per_neighbor, const int64_t *const inp_neighbors_row_splits, const size_t inp_num_queries, TIndex *out_neighbors_index, TAttr *out_neighbors_attributes, const size_t index_size, int64_t *out_neighbors_row_splits, const size_t out_num_queries) |
HOST_DEVICE size_t | SpatialHash (int x, int y, int z) |
Spatial hashing function for integer coordinates. More... | |
HOST_DEVICE size_t | SpatialHash (const utility::MiniVec< int, 3 > &xyz) |
template<class TVecf > | |
HOST_DEVICE utility::MiniVec< int, 3 > | ComputeVoxelIndex (const TVecf &pos, const typename TVecf::Scalar_t &inv_voxel_size) |
template<class T > | |
void | RaggedToDenseCPU (const T *const values, const int64_t *const row_splits, const size_t row_splits_size, const size_t out_col_size, const T *const default_value, const size_t default_value_size, T *out_values) |
template<class T > | |
void | ReduceSubarraysSumCPU (const T *const values, const size_t values_size, const int64_t *const row_splits, const size_t num_arrays, T *out_sums) |
template<class T , int NDIM, class OUTPUT_ALLOCATOR > | |
void | VoxelizeCPU (const size_t num_points, const T *const points, const size_t batch_size, const int64_t *const row_splits, const T *const voxel_size, const T *const points_range_min, const T *const points_range_max, const int64_t max_points_per_voxel, const int64_t max_voxels, OUTPUT_ALLOCATOR &output_allocator) |
template<class T > | |
bool | CheckVoxelSize (std::string &err, const size_t num_positions, const T *const positions, const T voxel_size) |
Function for debugging. Checks if the voxel size is too small. More... | |
template<class TDerived > | |
Eigen::Vector3i | ComputeVoxelIndex (const Eigen::ArrayBase< TDerived > &pos, const typename TDerived::Scalar &inv_voxel_size) |
template<class TReal , class TFeat , class ACCUMULATOR , class OUTPUT_ALLOCATOR > | |
void | _VoxelPooling (size_t num_inp, const TReal *const inp_positions, int in_channels, const TFeat *inp_features, TReal voxel_size, OUTPUT_ALLOCATOR &output_allocator) |
template<class TReal , class TFeat , class ACCUMULATOR , AccumulationFn FEAT_FN> | |
void | _VoxelPoolingBackprop (TFeat *features_backprop, size_t num_inp, const TReal *const inp_positions, int in_channels, const TFeat *const inp_features, size_t num_pooled, const TReal *const pooled_positions, const TFeat *const pooled_features_gradient, TReal voxel_size) |
template<class TReal , class TFeat , class OUTPUT_ALLOCATOR > | |
void | VoxelPooling (size_t num_inp, const TReal *const inp_positions, int in_channels, const TFeat *inp_features, TReal voxel_size, OUTPUT_ALLOCATOR &output_allocator, AccumulationFn position_fn, AccumulationFn feature_fn) |
template<class TReal , class TFeat > | |
void | VoxelPoolingBackprop (TFeat *features_backprop, size_t num_inp, const TReal *const inp_positions, int in_channels, const TFeat *const inp_features, size_t num_pooled, const TReal *const pooled_positions, const TFeat *const pooled_features_gradient, TReal voxel_size, AccumulationFn position_fn, AccumulationFn feature_fn) |
template<class TFeat , class TOut , class TIndex , class TKernelIndex , bool POINT_IMPORTANCE> | |
void | _SparseConvComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, size_t num_inp, const TFeat *inp_features, const TFeat *inp_importance, size_t neighbors_index_size, const TIndex *neighbors_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, bool normalize) |
template<class TFeat , class TOut , class TIndex , class TKernelIndex > | |
void | SparseConvComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, size_t num_inp, const TFeat *inp_features, const TFeat *inp_importance, size_t neighbors_index_size, const TIndex *neighbors_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, bool normalize) |
template<class TFeat , class TOut , class TIndex , class TKernelIndex , bool POINT_IMPORTANCE> | |
void | _SparseConvBackropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, size_t num_inp, const TFeat *inp_features, const TFeat *inp_importance, const TIndex *neighbors_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TFeat *out_features_gradient, bool normalize) |
template<class TFeat , class TOut , class TIndex , class TKernelIndex > | |
void | SparseConvBackpropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, size_t num_inp, const TFeat *inp_features, const TFeat *inp_importance, const TIndex *neighbors_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TFeat *out_features_gradient, bool normalize) |
template<class TReal , class TIndex , class TKernelIndex > | |
void | FillColumn (const cudaStream_t &stream, TReal *columns, int in_channels, TIndex begin_idx, TIndex end_idx, TIndex num_out, TIndex num_inp, const TReal *const __restrict__ inp_features, const TReal *const __restrict__ inp_importance, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TKernelIndex *const __restrict__ neighbors_kernel_index, const TReal *const __restrict__ neighbors_importance, const int64_t *const __restrict__ neighbors_row_splits, const int num_kernel_elements, bool normalize) |
template<class TReal , class TIndex , class TKernelIndex > | |
void | FillColumnTranspose (const cudaStream_t &stream, TReal *columns, int in_channels, TIndex begin_idx, TIndex end_idx, TIndex num_out, TIndex num_inp, const TReal *const __restrict__ inp_features, const TReal *const __restrict__ inp_neighbors_importance_sum, const int64_t *const __restrict__ inp_neighbors_prefix_sum, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TKernelIndex *const __restrict__ neighbors_kernel_index, const TReal *const __restrict__ neighbors_importance, const int64_t *const __restrict__ neighbors_row_splits, const int num_kernel_elements, bool normalize) |
template<class TFeat , class TOut , class TIndex , class TKernelIndex , bool NORMALIZE> | |
void | _SparseConvTransposeComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, const TFeat *out_importance, size_t num_inp, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, const TIndex *neighbor_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbor_importance, const int64_t *neighbors_row_splits) |
template<class TFeat , class TOut , class TIndex , class TKernelIndex > | |
void | SparseConvTransposeComputeFeaturesCPU (TOut *out_features, const std::vector< int > &filter_dims, const TFeat *filter, size_t num_out, const TFeat *out_importance, size_t num_inp, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, const TIndex *neighbor_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbor_importance, const int64_t *neighbors_row_splits, bool normalize) |
template<class TFeat , class TOut , class TIndex , class TKernelIndex , bool NORMALIZE> | |
void | _SparseConvTransposeBackpropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TFeat *out_importance, size_t num_inp, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, const TIndex *neighbors_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TFeat *out_features_gradient) |
template<class TFeat , class TOut , class TIndex , class TKernelIndex > | |
void | SparseConvTransposeBackpropFilterCPU (TOut *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TFeat *out_importance, size_t num_inp, const TFeat *inp_features, const TFeat *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, const TIndex *neighbors_index, const TKernelIndex *neighbors_kernel_index, const TFeat *neighbors_importance, const int64_t *neighbors_row_splits, const TFeat *out_features_gradient, bool normalize) |
|
strong |
Coordinate Mapping functions
Enumerator | |
---|---|
BALL_TO_CUBE_RADIAL | |
BALL_TO_CUBE_VOLUME_PRESERVING | |
IDENTITY |
|
strong |
void open3d::ml::impl::_CConvBackropFilterCPU | ( | TOut * | filter_backprop, |
const std::vector< int > & | filter_dims, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_importance, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbors_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
const TFeat * | out_features_gradient, | ||
bool | normalize | ||
) |
void open3d::ml::impl::_CConvComputeFeaturesCPU | ( | TOut * | out_features, |
const std::vector< int > & | filter_dims, | ||
const TFeat * | filter, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_importance, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbors_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
bool | normalize | ||
) |
Implementation of CConvComputeFeatures with template parameters for configuration.
void open3d::ml::impl::_CConvTransposeBackpropFilterCPU | ( | TOut * | filter_backprop, |
const std::vector< int > & | filter_dims, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
const TFeat * | out_importance, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_neighbors_importance_sum, | ||
const int64_t * | inp_neighbors_row_splits, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbors_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
const TFeat * | out_features_gradient | ||
) |
Implementation of CConvTransposeBackpropFilterCPU with template parameters for configuration.
void open3d::ml::impl::_CConvTransposeComputeFeaturesCPU | ( | TOut * | out_features, |
const std::vector< int > & | filter_dims, | ||
const TFeat * | filter, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
const TFeat * | out_importance, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_neighbors_importance_sum, | ||
const int64_t * | inp_neighbors_row_splits, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbors_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets | ||
) |
Implementation of CConvComputeFeatures with template parameters for configuration.
void open3d::ml::impl::_SparseConvBackropFilterCPU | ( | TOut * | filter_backprop, |
const std::vector< int > & | filter_dims, | ||
size_t | num_out, | ||
size_t | num_inp, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_importance, | ||
const TIndex * | neighbors_index, | ||
const TKernelIndex * | neighbors_kernel_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TFeat * | out_features_gradient, | ||
bool | normalize | ||
) |
void open3d::ml::impl::_SparseConvComputeFeaturesCPU | ( | TOut * | out_features, |
const std::vector< int > & | filter_dims, | ||
const TFeat * | filter, | ||
size_t | num_out, | ||
size_t | num_inp, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_importance, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbors_index, | ||
const TKernelIndex * | neighbors_kernel_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
bool | normalize | ||
) |
Implementation of SparseConvComputeFeatures with template parameters for configuration.
void open3d::ml::impl::_SparseConvTransposeBackpropFilterCPU | ( | TOut * | filter_backprop, |
const std::vector< int > & | filter_dims, | ||
size_t | num_out, | ||
const TFeat * | out_importance, | ||
size_t | num_inp, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_neighbors_importance_sum, | ||
const int64_t * | inp_neighbors_row_splits, | ||
const TIndex * | neighbors_index, | ||
const TKernelIndex * | neighbors_kernel_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TFeat * | out_features_gradient | ||
) |
Implementation of SparseConvTransposeBackpropFilterCPU with template parameters for configuration.
void open3d::ml::impl::_SparseConvTransposeComputeFeaturesCPU | ( | TOut * | out_features, |
const std::vector< int > & | filter_dims, | ||
const TFeat * | filter, | ||
size_t | num_out, | ||
const TFeat * | out_importance, | ||
size_t | num_inp, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_neighbors_importance_sum, | ||
const int64_t * | inp_neighbors_row_splits, | ||
const TIndex * | neighbor_index, | ||
const TKernelIndex * | neighbors_kernel_index, | ||
const TFeat * | neighbor_importance, | ||
const int64_t * | neighbors_row_splits | ||
) |
Implementation of SparseConvTransposeComputeFeatures with template parameters for configuration.
void open3d::ml::impl::_VoxelPooling | ( | size_t | num_inp, |
const TReal *const | inp_positions, | ||
int | in_channels, | ||
const TFeat * | inp_features, | ||
TReal | voxel_size, | ||
OUTPUT_ALLOCATOR & | output_allocator | ||
) |
void open3d::ml::impl::_VoxelPoolingBackprop | ( | TFeat * | features_backprop, |
size_t | num_inp, | ||
const TReal *const | inp_positions, | ||
int | in_channels, | ||
const TFeat *const | inp_features, | ||
size_t | num_pooled, | ||
const TReal *const | pooled_positions, | ||
const TFeat *const | pooled_features_gradient, | ||
TReal | voxel_size | ||
) |
void open3d::ml::impl::CConvBackpropFilterCPU | ( | TOut * | filter_backprop, |
const std::vector< int > & | filter_dims, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_importance, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbors_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
const TFeat * | out_features_gradient, | ||
InterpolationMode | interpolation, | ||
CoordinateMapping | coordinate_mapping, | ||
bool | align_corners, | ||
bool | individual_extent, | ||
bool | isotropic_extent, | ||
bool | normalize | ||
) |
Computes the backprop for the filter of a continuous convolution.
TFeat | Type for the features and weights |
TOut | Type for the output features |
TReal | Type for point positions and extents |
TIndex | Type for neighbor indexing |
filter_backprop | Output array for the computed filter gradient with shape [depth,height,width, inp channels, out channels] |
filter_dims | The sizes of the filter dimensions. The size of filter_dims must be 5. The order is [depth, height, width, inp channels, out channels]. |
num_out | The number of output points. |
out_positions | The positions of the output points. The shape is [num_out, 3]. |
num_inp | The number of input points. |
inp_positions | The positions of the input points. The shape is [num_inp, 3]. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_importance | Optional importance for each input point with shape [num_inp]. Set to null to disable. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
extents | The spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent . |
offsets | A single 3D vector used in the filter coordinate computation. The shape is [3]. |
interpolation | The interpolation mode. Either LINEAR or NEAREST_NEIGHBOR. |
coordinate_mapping | The coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING. |
align_corners | If true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape. |
individual_extent | If true each output point has an individual extent. |
isotropic_extent | If true each then the extent is isotropic for each output point. |
normalize | If true then the output features are normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
void open3d::ml::impl::CConvComputeFeaturesCPU | ( | TOut * | out_features, |
const std::vector< int > & | filter_dims, | ||
const TFeat * | filter, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_importance, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbors_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
InterpolationMode | interpolation, | ||
CoordinateMapping | coordinate_mapping, | ||
bool | align_corners, | ||
bool | individual_extent, | ||
bool | isotropic_extent, | ||
bool | normalize | ||
) |
Computes the output features of a continuous convolution.
TFeat | Type for the features and weights |
TOut | Type for the output features |
TReal | Type for point positions and extents |
TIndex | Type for neighbor indexing |
out_features | Output array for the computed features with shape [num_out, out channels] |
filter_dims | The sizes of the filter dimensions. The size of filter_dims must be 5. The order is [depth, height, width, inp channels, out channels]. |
filter | Pointer to the filter values. |
num_out | The number of output points. |
out_positions | The positions of the output points. The shape is [num_out, 3]. |
num_inp | The number of input points. |
inp_positions | The positions of the input points. The shape is [num_inp, 3]. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_importance | Optional importance for each input point with shape [num_inp]. Set to null to disable. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
extents | The spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent . |
offsets | A single 3D vector used in the filter coordinate computation. The shape is [3]. |
interpolation | The interpolation mode. Either LINEAR or NEAREST_NEIGHBOR. |
coordinate_mapping | The coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING. |
align_corners | If true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape. |
individual_extent | If true each output point has an individual extent. |
isotropic_extent | If true each then the extent is isotropic for each output point. |
normalize | If true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
void open3d::ml::impl::CConvTransposeBackpropFilterCPU | ( | TOut * | filter_backprop, |
const std::vector< int > & | filter_dims, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
const TFeat * | out_importance, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_neighbors_importance_sum, | ||
const int64_t * | inp_neighbors_row_splits, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbors_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
const TFeat * | out_features_gradient, | ||
InterpolationMode | interpolation, | ||
CoordinateMapping | coordinate_mapping, | ||
bool | align_corners, | ||
bool | individual_extent, | ||
bool | isotropic_extent, | ||
bool | normalize | ||
) |
Computes the backprop for the filter of a transpose continuous convolution.
TFeat | Type for the features and weights |
TOut | Type for the output features |
TReal | Type for point positions and extents |
TIndex | Type for neighbor indexing |
filter_backprop | Output array for the computed filter gradient with shape [depth,height,width, inp channels, out channels] |
filter_dims | The sizes of the filter dimensions. The size of filter_dims must be 5. The order is [depth, height, width, inp channels, out channels]. |
num_out | The number of output points. |
out_positions | The positions of the output points. The shape is [num_out, 3]. |
out_importance | Optional importance for each output point with shape [num_out]. Set to null to disable. |
num_inp | The number of input points. |
inp_positions | The positions of the input points. The shape is [num_inp, 3]. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_neighbors_importance_sum | The sum of the neighbors_importance values for each input with shape [num_inp]. |
inp_neighbors_row_splits | The prefix sum which defines the start and end of the sublists in inp_neighbors_index . The size of the array is num_inp + 1. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
extents | The spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent . |
offsets | A single 3D vector used in the filter coordinate computation. The shape is [3]. |
out_features_gradient | The gradient from the features with shape [num_out, out_channels] |
interpolation | The interpolation mode. Either LINEAR or NEAREST_NEIGHBOR. |
coordinate_mapping | The coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING. |
align_corners | If true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape. |
individual_extent | If true each output point has an individual extent. |
isotropic_extent | If true each then the extent is isotropic for each output point. |
normalize | If true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
void open3d::ml::impl::CConvTransposeComputeFeaturesCPU | ( | TOut * | out_features, |
const std::vector< int > & | filter_dims, | ||
const TFeat * | filter, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
const TFeat * | out_importance, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_neighbors_importance_sum, | ||
const int64_t * | inp_neighbors_row_splits, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbors_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
InterpolationMode | interpolation, | ||
CoordinateMapping | coordinate_mapping, | ||
bool | align_corners, | ||
bool | individual_extent, | ||
bool | isotropic_extent, | ||
bool | normalize | ||
) |
Computes the output features of a transpose continuous convolution.
TFeat | Type for the features and weights |
TOut | Type for the output features |
TReal | Type for point positions and extents |
TIndex | Type for neighbor indexing |
out_features | Output array for the computed features with shape [num_out, out channels] |
filter_dims | The sizes of the filter dimensions. The size of filter_dims must be 5. The order is [depth, height, width, inp channels, out channels]. |
filter | Pointer to the filter values. |
num_out | The number of output points. |
out_positions | The positions of the output points. The shape is [num_out, 3]. |
out_importance | Optional importance for each output point with shape [num_out]. Set to null to disable. |
num_inp | The number of input points. |
inp_positions | The positions of the input points. The shape is [num_inp, 3]. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_neighbors_importance_sum | The sum of the neighbors_importance values for each input with shape [num_inp]. |
inp_neighbors_row_splits | The prefix sum which defines the start and end of the sublists in inp_neighbors_index . The size of the array is num_inp + 1. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
extents | The spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent . |
offsets | A single 3D vector used in the filter coordinate computation. The shape is [3]. |
interpolation | The interpolation mode. Either LINEAR or NEAREST_NEIGHBOR. |
coordinate_mapping | The coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING. |
align_corners | If true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape. |
individual_extent | If true each output point has an individual extent. |
isotropic_extent | If true each then the extent is isotropic for each output point. |
normalize | If true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
bool open3d::ml::impl::CheckVoxelSize | ( | std::string & | err, |
const size_t | num_positions, | ||
const T *const | positions, | ||
const T | voxel_size | ||
) |
Function for debugging. Checks if the voxel size is too small.
|
inline |
Computes the filter coordinates. The input to this function are coordinates relative to the point where the convolution is evaluated. Coordinates are usually in the range [-extent/2,extent/2] with extent as the edge length of the bounding box of the filter shape. The output is a coordinate within the filter array, i.e. the range is [0, filter_size.xyz], if the point was inside the filter shape.
The simplest filter shape is a cuboid (MAPPING=IDENTITY) and the transformation is simply [-extent/2,extent/2] -> [0, filter_size.xyz]. The other type of shape that is implemented is a sphere with MAPPING=BALL_TO_CUBE_RADIAL or MAPPING=BALL_TO_CUBE_VOLUME_PRESERVING.
ALIGN_CORNERS | If true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape. |
MAPPING | The mapping that is applied to the input coordinates.
|
x | x coordinates. Input and output variable. |
y | y coordinates. Input and output variable. |
z | z coordinates. Input and output variable. |
filter_size | The spatial size of the filter array in voxels. |
inv_extents | The reciproval of the spatial extent of the filter in coordinate units. |
offset | An offset for shifting the center. Can be used to implement discrete filters with even filter size. |
Eigen::Vector3i open3d::ml::impl::ComputeVoxelIndex | ( | const Eigen::ArrayBase< TDerived > & | pos, |
const typename TDerived::Scalar & | inv_voxel_size | ||
) |
Computes an integer voxel index for a 3D position.
pos | A 3D position. |
inv_voxel_size | The reciprocal of the voxel size |
|
inline |
Computes an integer voxel index for a 3D position.
pos | A 3D position. |
inv_voxel_size | The reciprocal of the voxel size |
void open3d::ml::impl::FillColumn | ( | const cudaStream_t & | stream, |
TFeat * | columns, | ||
int | in_channels, | ||
TIndex | begin_idx, | ||
TIndex | end_idx, | ||
TIndex | num_out, | ||
const TReal *const __restrict__ | out_positions, | ||
TIndex | num_inp, | ||
const TReal *const __restrict__ | inp_positions, | ||
const TFeat *const __restrict__ | inp_features, | ||
const TFeat *const __restrict__ | inp_importance, | ||
size_t | neighbors_index_size, | ||
const TIndex *const __restrict__ | neighbors_index, | ||
const TFeat *const __restrict__ | neighbors_importance, | ||
const int64_t *const __restrict__ | neighbors_row_splits, | ||
const TReal *const __restrict__ | extents, | ||
const TReal *const __restrict__ | offsets, | ||
const std::vector< int > & | filter_dims, | ||
InterpolationMode | interpolation, | ||
CoordinateMapping | coordinate_mapping, | ||
bool | align_corners, | ||
bool | individual_extent, | ||
bool | isotropic_extent, | ||
bool | normalize | ||
) |
Copies and transforms the features to a column, which can be multiplied with the filter matrix.
TFeat | Type for the features |
TOut | Type for the output features |
TReal | Type for point positions and extents |
TIndex | Type for neighbor indexing |
columns | Output array with shape [num_out, spatial filter dims, in_channels]. |
in_channels | Number of input channels. |
begin_idx | Index of the first output point to process. |
end_idx | Index after the last output point to process. |
num_out | The number of output points. |
out_positions | The positions of the output points. The shape is [num_out, 3]. |
num_inp | The number of input points. |
inp_positions | The positions of the input points. The shape is [num_inp, 3]. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_importance | Optional importance for each input point with shape [num_inp]. Set to null to disable. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
extents | The spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent . |
offsets | A single 3D vector used in the filter coordinate computation. The shape is [3]. |
filter_dims | The spatial filter size in voxels. (The filter resolution) with shape [3]. |
interpolation | The interpolation mode. Either LINEAR or NEAREST_NEIGHBOR. |
coordinate_mapping | The coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING. |
align_corners | If true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape. |
individual_extent | If true each output point has an individual extent. |
isotropic_extent | If true each then the extent is isotropic for each output point. |
normalize | If true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
void open3d::ml::impl::FillColumn | ( | const cudaStream_t & | stream, |
TReal * | columns, | ||
int | in_channels, | ||
TIndex | begin_idx, | ||
TIndex | end_idx, | ||
TIndex | num_out, | ||
TIndex | num_inp, | ||
const TReal *const __restrict__ | inp_features, | ||
const TReal *const __restrict__ | inp_importance, | ||
size_t | neighbors_index_size, | ||
const TIndex *const __restrict__ | neighbors_index, | ||
const TKernelIndex *const __restrict__ | neighbors_kernel_index, | ||
const TReal *const __restrict__ | neighbors_importance, | ||
const int64_t *const __restrict__ | neighbors_row_splits, | ||
const int | num_kernel_elements, | ||
bool | normalize | ||
) |
Copies and transforms the features to a column, which can be multiplied with the filter matrix.
TReal | Type for positions and features. |
TIndex | Type for addressing neighbors. |
TKernelIndex | Type for addressing the spatial dimension in a kernel. |
columns | Output array with shape [num_out, spatial filter dims, in_channels]. |
in_channels | Number of input channels. |
begin_idx | Index of the first output point to process. |
end_idx | Index after the last output point to process. |
num_out | The number of output points. |
num_inp | The number of input points. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_importance | Optional importance for each input point with shape [num_inp]. Set to null to disable. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_kernel_index | Defines which kernel element to use for each neighbor. This array has the same length as neighbors_index . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
num_kernel_elements | The number of kernel elements. This is the size of the first dimension of the filter, i.e., The filter shape is [num_kernel_elements, in_channels, out_channels] |
normalize | If true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
void open3d::ml::impl::FillColumnTranspose | ( | const cudaStream_t & | stream, |
TFeat * | columns, | ||
int | in_channels, | ||
TIndex | begin_idx, | ||
TIndex | end_idx, | ||
TIndex | num_out, | ||
const TReal *const __restrict__ | out_positions, | ||
TIndex | num_inp, | ||
const TReal *const __restrict__ | inp_positions, | ||
const TFeat *const __restrict__ | inp_features, | ||
const TFeat *const __restrict__ | inp_neighbors_importance_sum, | ||
const int64_t *const __restrict__ | inp_neighbors_prefix_sum, | ||
size_t | neighbors_index_size, | ||
const TIndex *const __restrict__ | neighbors_index, | ||
const TFeat *const __restrict__ | neighbors_importance, | ||
const int64_t *const __restrict__ | neighbors_row_splits, | ||
const TReal *const __restrict__ | extents, | ||
const TReal *const __restrict__ | offsets, | ||
const std::vector< int > & | filter_dims, | ||
InterpolationMode | interpolation, | ||
CoordinateMapping | coordinate_mapping, | ||
bool | align_corners, | ||
bool | individual_extent, | ||
bool | isotropic_extent, | ||
bool | normalize | ||
) |
void open3d::ml::impl::FillColumnTranspose | ( | const cudaStream_t & | stream, |
TReal * | columns, | ||
int | in_channels, | ||
TIndex | begin_idx, | ||
TIndex | end_idx, | ||
TIndex | num_out, | ||
TIndex | num_inp, | ||
const TReal *const __restrict__ | inp_features, | ||
const TReal *const __restrict__ | inp_neighbors_importance_sum, | ||
const int64_t *const __restrict__ | inp_neighbors_prefix_sum, | ||
size_t | neighbors_index_size, | ||
const TIndex *const __restrict__ | neighbors_index, | ||
const TKernelIndex *const __restrict__ | neighbors_kernel_index, | ||
const TReal *const __restrict__ | neighbors_importance, | ||
const int64_t *const __restrict__ | neighbors_row_splits, | ||
const int | num_kernel_elements, | ||
bool | normalize | ||
) |
Similar as FillColumn but used in the transpose convolution to create the patch matrix.
void open3d::ml::impl::InvertNeighborsListCPU | ( | const TIndex *const | inp_neighbors_index, |
const TAttr *const | inp_neighbors_attributes, | ||
const int | num_attributes_per_neighbor, | ||
const int64_t *const | inp_neighbors_row_splits, | ||
const size_t | inp_num_queries, | ||
TIndex * | out_neighbors_index, | ||
TAttr * | out_neighbors_attributes, | ||
const size_t | index_size, | ||
int64_t * | out_neighbors_row_splits, | ||
const size_t | out_num_queries | ||
) |
Inverts a neighbors list, which is a tuple of the form (neighbors_index, neighbors_row_splits, neighbors_attributes). neighbors_index is a nested list of indices to the neighbors. Each entry defines an edge between two indices (points). The neighbors_row_splits defines the start and end of each sublist. neighbors_attributes is an optional array of attributes for each entry in neighbors_index.
Example: The neighbors for point cloud A (3 points) in point cloud B (2 points) is defined by:
The inverted neighbors list is then the neighbors for point cloud B in A
inp_neighbors_index | The nested list of neighbor indices. |
inp_neighbors_attributes | The array of attributes for each entry in inp_neighbors_index . This is optional and can be set to null. |
num_attributes_per_neighbor | The number of scalar attributes for each entry in inp_neighbors_index . |
inp_neighbors_row_splits | Defines the start and end of the sublists in inp_neighbors_index . This is an exclusive prefix sum with 0 as the first element and the length of inp_neighbors_index as last element. The size is inp_num_queries + 1 |
inp_num_queries | The number of queries. |
out_neighbors_index | The inverted neighbors_index list with the same size as inp_neighbors_index . |
out_neighbors_attributes | The inverted array of attributes with the same size as inp_neighbors_attributes . |
index_size | This is the size of inp_neighbors_index and out_neighbors_index , both have the same size. |
out_neighbors_row_splits | The prefix sum which defines the start and end of the sublists in out_neighbors_index . |
out_num_queries | The number of queries with respect to the inverted neighbors list. |
|
inline |
Maps coordinates in a cylinder with radius 1 to a cube. The input and output range of the coordinates is [-1,1]. The cylinder axis is along z.
|
inline |
Maps coordinates in a sphere with radius 1 to a cylinder. The input and output range of the coordinates is [-1,1]. The cylinder axis is along z.
void open3d::ml::impl::MultiplyAndCopyColumns | ( | const cudaStream_t & | stream, |
size_t | rows, | ||
size_t | cols, | ||
T *__restrict__ | out_ptr, | ||
const T *const __restrict__ | col_major_matrix, | ||
const T *const __restrict__ | vector | ||
) |
Multiplies each column with a scalar.
out_ptr | Output pointer |
col_major_matrix | Matrix with shape [rows, cols] in column major storage order. |
vector | A vector with shape [cols]. |
void open3d::ml::impl::MultiplyColumns | ( | const cudaStream_t & | stream, |
size_t | rows, | ||
size_t | cols, | ||
T *__restrict__ | col_major_matrix, | ||
const T *const __restrict__ | vector | ||
) |
Multiplies each column with a scalar in-place.
col_major_matrix | Matrix with shape [rows, cols] in column major storage order. |
vector | A vector with shape [cols]. |
void open3d::ml::impl::RaggedToDenseCPU | ( | const T *const | values, |
const int64_t *const | row_splits, | ||
const size_t | row_splits_size, | ||
const size_t | out_col_size, | ||
const T *const | default_value, | ||
const size_t | default_value_size, | ||
T * | out_values | ||
) |
Creates a dense tensor from a ragged tensor.
Example where each value has size 2: values = [[0,0],[1,1],[2,2],[3,3],[4,4]] row_splits = [0,2,5] out_col_size=3 default_value=[-1,-1] default_value_size = 2
will return
out_values = [[[0,0],[1,1],[-1,-1]], [[2,2],[3,3],[4,4]]]
values | Linear memory with all values. |
row_splits | Defines the start and end of each entry in the ragged tensor. This is an exclusive prefix sum with 0 as the first element and the length of all values as the last element. |
row_splits_size | The length of the row_splits vector. |
out_col_size | The output column size. This is the second dim of the dense output tensor. |
default_value | The default value to use if there are not enough values for filling the row. |
default_value_size | The size of the default value. |
out_values | This is the output array. The size of the array must be [row_splits_size-1, out_col_size, default_value_size]. |
void open3d::ml::impl::ReduceSubarraysSumCPU | ( | const T *const | values, |
const size_t | values_size, | ||
const int64_t *const | row_splits, | ||
const size_t | num_arrays, | ||
T * | out_sums | ||
) |
Reduces subarrays in linear memory with the sum operation. The sum for empty subarrays is 0.
values | The linear array with all values |
values_size | Number of elements of values |
row_splits | Defines the start and end of each subarray. This is an exclusive prefix sum with 0 as the first element and the length of values as last element. The size is num_arrays + 1 |
num_arrays | The number of subarrays |
out_sums | The preallocated output array with size num_arrays |
void open3d::ml::impl::SparseConvBackpropFilterCPU | ( | TOut * | filter_backprop, |
const std::vector< int > & | filter_dims, | ||
size_t | num_out, | ||
size_t | num_inp, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_importance, | ||
const TIndex * | neighbors_index, | ||
const TKernelIndex * | neighbors_kernel_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TFeat * | out_features_gradient, | ||
bool | normalize | ||
) |
Computes the backprop for the filter of a sparse convolution.
temp | Pointer to temporary memory. If nullptr then the required size of temporary memory will be written to temp_size and no work is done. This function can make use of more memory and returns the maximum size that can be used in max_temp_size. |
temp_size | The size of the temporary memory in bytes. This is used as an output if temp is nullptr and returns the minimum temp size required. |
max_temp_size | This is used as an output if temp is nullptr and returns the maximum temp size that can be used. |
texture_alignment | The texture alignment in bytes. This is used for allocating segments within the temporary memory. |
filter_backrop | Output array for the computed filter gradient with shape [depth,height,width, inp channels, out channels] |
filter_dims | The sizes of the filter dimensions. The size of filter_dims must be >=3. The order is [num kernel elements, inp channels, out channels]. |
num_out | The number of output points. |
num_inp | The number of input points. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_importance | Optional importance for each input point with shape [num_inp]. Set to null to disable. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_kernel_index | Defines which kernel element to use for each neighbor. This array has the same length as neighbors_index . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
out_features_gradient | The gradient signal from the features. |
normalize | If true then the output features are normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
void open3d::ml::impl::SparseConvComputeFeaturesCPU | ( | TOut * | out_features, |
const std::vector< int > & | filter_dims, | ||
const TFeat * | filter, | ||
size_t | num_out, | ||
size_t | num_inp, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_importance, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbors_index, | ||
const TKernelIndex * | neighbors_kernel_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
bool | normalize | ||
) |
Computes the output features of a sparse convolution.
out_features | Output array for the computed features with shape [num_out, out channels] |
filter_dims | The sizes of the filter dimensions. The size of filter_dims must be >=3. The order is [num kernel elements, inp channels, out channels]. |
filter | Pointer to the filter values. |
num_out | The number of output points. |
num_inp | The number of input points. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_importance | Optional importance for each input point with shape [num_inp]. Set to null to disable. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_kernel_index | Defines which kernel element to use for each neighbor. This array has the same length as neighbors_index . |
neighbors_importance | Array of the same length as neighbors_importance . Defines which of the kernel elements to use in the matrix multiplication. |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
normalize | If true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
void open3d::ml::impl::SparseConvTransposeBackpropFilterCPU | ( | TOut * | filter_backprop, |
const std::vector< int > & | filter_dims, | ||
size_t | num_out, | ||
const TFeat * | out_importance, | ||
size_t | num_inp, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_neighbors_importance_sum, | ||
const int64_t * | inp_neighbors_row_splits, | ||
const TIndex * | neighbors_index, | ||
const TKernelIndex * | neighbors_kernel_index, | ||
const TFeat * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TFeat * | out_features_gradient, | ||
bool | normalize | ||
) |
Computes the backprop for the filter of a transpose sparse convolution.
filter_backrop | Output array for the computed filter gradient with shape [depth,height,width, inp channels, out channels] |
filter_dims | The sizes of the filter dimensions. The size of filter_dims must be >=3. The order is [num kernel elements, inp channels, out channels]. |
filter | Pointer to the filter values. |
num_out | The number of output points. |
out_importance | Optional importance for each output point with shape [num_out]. Set to null to disable. |
num_inp | The number of input points. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_neighbors_importance_sum | The sum of the neighbors_importance values for each input with shape [num_inp]. |
inp_neighbors_row_splits | The prefix sum which defines the start and end of the sublists in inp_neighbors_index . The size of the array is num_inp + 1. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_kernel_index | Defines which kernel element to use for each neighbor. This array has the same length as neighbors_index . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
out_features_gradient | The gradient from the features with shape [num_out, out_channels] |
normalize | If true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
void open3d::ml::impl::SparseConvTransposeComputeFeaturesCPU | ( | TOut * | out_features, |
const std::vector< int > & | filter_dims, | ||
const TFeat * | filter, | ||
size_t | num_out, | ||
const TFeat * | out_importance, | ||
size_t | num_inp, | ||
const TFeat * | inp_features, | ||
const TFeat * | inp_neighbors_importance_sum, | ||
const int64_t * | inp_neighbors_row_splits, | ||
const TIndex * | neighbor_index, | ||
const TKernelIndex * | neighbors_kernel_index, | ||
const TFeat * | neighbor_importance, | ||
const int64_t * | neighbors_row_splits, | ||
bool | normalize | ||
) |
Computes the output features of a transpose sparse convolution.
out_features | Output array for the computed features with shape [num_out, out channels] |
filter_dims | The sizes of the filter dimensions. The size of filter_dims must be >=3. The order is [num kernel elements, inp channels, out channels]. |
filter | Pointer to the filter values. |
num_out | The number of output points. |
out_importance | Optional importance for each output point with shape [num_out]. Set to null to disable. |
num_inp | The number of input points. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_neighbors_importance_sum | The sum of the neighbors_importance values for each input with shape [num_inp]. |
inp_neighbors_row_splits | The prefix sum which defines the start and end of the sublists in inp_neighbors_index . The size of the array is num_inp + 1. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_kernel_index | Defines which kernel element to use for each neighbor. This array has the same length as neighbors_index . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
normalize | If true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
|
inline |
|
inline |
Spatial hashing function for integer coordinates.
void open3d::ml::impl::VoxelizeCPU | ( | const size_t | num_points, |
const T *const | points, | ||
const size_t | batch_size, | ||
const int64_t *const | row_splits, | ||
const T *const | voxel_size, | ||
const T *const | points_range_min, | ||
const T *const | points_range_max, | ||
const int64_t | max_points_per_voxel, | ||
const int64_t | max_voxels, | ||
OUTPUT_ALLOCATOR & | output_allocator | ||
) |
This function voxelizes a point cloud. The function returns the integer coordinates of the voxels that contain points and a compact list of the indices that associate the voxels to the points.
T | Floating-point data type for the point positions. |
NDIM | The number of dimensions of the points. |
OUTPUT_ALLOCATOR | Type of the output_allocator. See output_allocator for more information. |
num_points | The number of points. |
points | Array with the point positions. The shape is [num_points,NDIM]. |
batch_size | The batch size of points. |
row_splits | row_splits for defining batches. |
voxel_size | The edge lengths of the voxel. The shape is [NDIM]. This pointer points to host memory! |
points_range_min | The lower bound of the domain to be voxelized. The shape is [NDIM]. This pointer points to host memory! |
points_range_max | The upper bound of the domain to be voxelized. The shape is [NDIM]. This pointer points to host memory! |
max_points_per_voxel | This parameter limits the number of points that are recorderd for each voxel. |
max_voxels | This parameter limits the number of voxels that will be generated. |
output_allocator | An object that implements functions for allocating the output arrays. The object must implement functions AllocVoxelCoords(int32_t** ptr, int64_t rows, int64_t cols), AllocVoxelPointIndices(int64_t** ptr, int64_t size), AllocVoxelPointRowSplits(int64_t** ptr, int64_t size) and AllocVoxelBatchSplits(int64_t** ptr, int64_t size). All functions should allocate memory and return a pointer to that memory in ptr. The arguments size, rows, and cols define the size of the array as the number of elements. All functions must accept zero size arguments. In this case ptr does not need to be set. |
void open3d::ml::impl::VoxelPooling | ( | size_t | num_inp, |
const TReal *const | inp_positions, | ||
int | in_channels, | ||
const TFeat * | inp_features, | ||
TReal | voxel_size, | ||
OUTPUT_ALLOCATOR & | output_allocator, | ||
AccumulationFn | position_fn, | ||
AccumulationFn | feature_fn | ||
) |
Pooling operation for point clouds. Aggregates points that are inside the same voxel.
TReal | Scalar type for point positions. |
TFeat | Scalar type for the features. |
OUTPUT_ALLOCATOR | Type of the output_allocator. See output_allocator for more information. |
num_inp | The number of input points. |
inp_positions | Array with 3D point positions. |
in_channels | The number of input feature channels. |
inp_features | The array with the point features. The shape is [num_inp, in_channels]. |
voxel_size | The voxel size (voxel edge length) used for pooling. |
output_allocator | An object that implements functions for allocating the output arrays. The object must implement functions AllocPooledPositions(TReal** ptr, size_t num) and AllocPooledFeatures(TFeat** ptr, size_t num, channels), with 'num' as the number of output points and 'channels' as in_channels . Both functions should allocate memory and return a pointer to that memory in ptr. Both functions must accept the argument num==0. In this case ptr does not need to be set. Note that AllocPooledPositions must allocate memory for num*3*sizeof(TReal) bytes. |
position_fn | Defines how the new point positions will be computed. AVERAGE computes the center of gravity for the points within one voxel. NEAREST_NEIGHBOR selects the point closest to the voxel center. CENTER uses the voxel center for the position of the generated point. |
feature_fn | Defines how the new features will be computed. AVERAGE computes the average feature vector. NEAREST_NEIGHBOR selects the feature vector of the point closest to the voxel center. MAX uses the maximum feature among all points within the voxel. |
void open3d::ml::impl::VoxelPoolingBackprop | ( | TFeat * | features_backprop, |
size_t | num_inp, | ||
const TReal *const | inp_positions, | ||
int | in_channels, | ||
const TFeat *const | inp_features, | ||
size_t | num_pooled, | ||
const TReal *const | pooled_positions, | ||
const TFeat *const | pooled_features_gradient, | ||
TReal | voxel_size, | ||
AccumulationFn | position_fn, | ||
AccumulationFn | feature_fn | ||
) |
Backpropagation to the features for VoxelPooling.
features_backprop | The output array with the gradients for the features. |
num_pooled | The number of points after pooling with VoxelPooling . |
pooled_positions | Array with the 3D positions after pooling. |
pooled_features_gradient | Array with the point features after pooling. |
See VoxelPooling
for the description of the remaining parameters.