beignet
beignet.apply_euler_angle
apply_euler_angle(input, rotation, axes, degrees=False, inverse=False)
Rotates vectors in three-dimensional space using Euler angles.
Note
This function interprets the rotation of the original frame to the final frame as either a projection, where it maps the components of vectors from the final frame to the original frame, or as a physical rotation, integrating the vectors into the original frame during the rotation process. Consequently, the vector components are maintained in the original frame’s perspective both before and after the rotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor
|
Vectors in three-dimensional space with the shape \((\ldots \times 3)\). Euler angles and vectors must conform to PyTorch broadcasting rules. |
required |
rotation |
Tensor
|
Euler angles with the shape \((\ldots \times 3)\), specifying the rotation in three-dimensional space. |
required |
axes |
str
|
Specifies the sequence of axes for the rotations, using one to three
characters from the set \({X, Y, Z}\) for intrinsic rotations, or
\({x, y, z}\) for extrinsic rotations. Mixing extrinsic and intrinsic
rotations raises a |
required |
degrees |
bool
|
Indicates whether the Euler angles are provided in degrees. If |
False
|
inverse |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor
|
A tensor of the same shape as |
Source code in src/beignet/_apply_euler_angle.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
beignet.apply_quaternion
apply_quaternion(input, rotation, inverse=False)
Rotates vectors in three-dimensional space using rotation quaternions.
Note
This function interprets the rotation of the original frame to the final frame as either a projection, where it maps the components of vectors from the final frame to the original frame, or as a physical rotation, integrating the vectors into the original frame during the rotation process. Consequently, the vector components are maintained in the original frame’s perspective both before and after the rotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
(Tensor, shape(..., 3))
|
Each vector represents a vector in three-dimensional space. The number of rotation quaternions and number of vectors must follow standard broadcasting rules: either one of them equals unity or they both equal each other. |
required |
rotation |
(Tensor, shape(..., 4))
|
Rotation quaternions. Rotation quaternions are normalized to unit norm. |
required |
inverse |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
(Tensor, shape(..., 3))
|
Rotated vectors. |
Source code in src/beignet/_apply_quaternion.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
beignet.apply_rotation_matrix
apply_rotation_matrix(input, rotation, inverse=False)
Rotates vectors in three-dimensional space using rotation matrices.
Note
This function interprets the rotation of the original frame to the final frame as either a projection, where it maps the components of vectors from the final frame to the original frame, or as a physical rotation, integrating the vectors into the original frame during the rotation process. Consequently, the vector components are maintained in the original frame’s perspective both before and after the rotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
(Tensor, shape(..., 3))
|
Each vector represents a vector in three-dimensional space. The number of rotation matrices and number of vectors must follow standard broadcasting rules: either one of them equals unity or they both equal each other. |
required |
rotation |
(Tensor, shape(..., 3, 3))
|
Rotation matrices. |
required |
inverse |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
rotated_vectors |
(Tensor, shape(..., 3))
|
Rotated vectors. |
Source code in src/beignet/_apply_rotation_matrix.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
beignet.apply_rotation_vector
apply_rotation_vector(input, rotation, degrees=False, inverse=False)
Rotates vectors in three-dimensional space using rotation vectors.
Note
This function interprets the rotation of the original frame to the final frame as either a projection, where it maps the components of vectors from the final frame to the original frame, or as a physical rotation, integrating the vectors into the original frame during the rotation process. Consequently, the vector components are maintained in the original frame’s perspective both before and after the rotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
(Tensor, shape(..., 3))
|
Each vector represents a vector in three-dimensional space. The number of rotation vectors and number of vectors must follow standard broadcasting rules: either one of them equals unity or they both equal each other. |
required |
rotation |
(Tensor, shape(..., 4))
|
Rotation vectors. |
required |
degrees |
bool
|
If |
False
|
inverse |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Rotated vectors. |
Source code in src/beignet/_apply_rotation_vector.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
beignet.compose_euler_angle
compose_euler_angle(input, other, axes, degrees=False)
Compose rotation quaternions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 3)
|
Euler angles. |
required |
other |
Tensor, shape=(..., 3)
|
Euler angles. |
required |
axes |
str
|
Axes. One to three characters belonging to the set :math: |
required |
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Composed Euler angles. |
Source code in src/beignet/_compose_euler_angle.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
beignet.compose_quaternion
compose_quaternion(input, other, canonical=False)
Compose rotation quaternions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 4)
|
Rotation quaternions. Rotation quaternions are normalized to unit norm. |
required |
other |
Tensor, shape=(..., 4)
|
Rotation quaternions. Rotation quaternions are normalized to unit norm. |
required |
canonical |
bool
|
Whether to map the redundant double cover of rotation space to a unique
canonical single cover. If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 4)
|
Composed rotation quaternions. |
Source code in src/beignet/_compose_quaternion.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
beignet.compose_rotation_matrix
compose_rotation_matrix(input, other)
Compose rotation matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 3, 3)
|
Rotation matrices. |
required |
other |
Tensor, shape=(..., 3, 3)
|
Rotation matrices. |
required |
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3, 3)
|
Composed rotation matrices. |
Source code in src/beignet/_compose_rotation_matrix.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
beignet.compose_rotation_vector
compose_rotation_vector(input, other, degrees=False)
Compose rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 4)
|
Rotation vectors. |
required |
other |
Tensor, shape=(..., 4)
|
Rotation vectors. |
required |
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 4)
|
Composed rotation vectors. |
Source code in src/beignet/_compose_rotation_vector.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
beignet.euler_angle_identity
euler_angle_identity(size, axes, degrees=False, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)
Identity Euler angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
Output size. |
required |
axes |
str
|
Axes. 1-3 characters belonging to the set {‘X’, ‘Y’, ‘Z’} for intrinsic rotations, or {‘x’, ‘y’, ‘z’} for extrinsic rotations. Extrinsic and intrinsic rotations cannot be mixed. |
required |
degrees |
bool
|
If |
False
|
out |
Tensor
|
Output tensor. Default, |
None
|
dtype |
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout |
layout
|
Layout of the returned tensor. Default, |
strided
|
device |
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad |
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
Returns:
Name | Type | Description |
---|---|---|
identity_euler_angles |
(Tensor, shape(size, 3))
|
Identity Euler angles. |
Source code in src/beignet/_euler_angle_identity.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
beignet.euler_angle_magnitude
euler_angle_magnitude(input, axes, degrees=False)
Euler angle magnitudes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
(Tensor, shape(..., 3))
|
Euler angles. |
required |
axes |
str
|
Axes. 1-3 characters belonging to the set {‘X’, ‘Y’, ‘Z’} for intrinsic rotations, or {‘x’, ‘y’, ‘z’} for extrinsic rotations. Extrinsic and intrinsic rotations cannot be mixed. |
required |
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
euler_angle_magnitudes |
(Tensor, shape(...))
|
Angles in radians. Magnitudes will be in the range :math: |
Source code in src/beignet/_euler_angle_magnitude.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
beignet.euler_angle_mean
euler_angle_mean(input, weight=None, axes=None, degrees=False)
Euler angle mean.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 3)
|
Euler angles. |
required |
weight |
Tensor, shape=(..., 4)
|
Relative importance of rotation quaternions. |
None
|
axes |
str
|
Axes. One to three characters belonging to the set :math: |
None
|
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Euler angle mean. |
Source code in src/beignet/_euler_angle_mean.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
beignet.euler_angle_to_quaternion
euler_angle_to_quaternion(input, axes, degrees=False, canonical=False)
Convert Euler angles to rotation quaternions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 3)
|
Euler angles. |
required |
axes |
str
|
Axes. One to three characters belonging to the set :math: |
required |
degrees |
bool
|
If |
False
|
canonical |
bool
|
Whether to map the redundant double cover of rotation space to a unique
canonical single cover. If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 4)
|
Rotation quaternions. |
Source code in src/beignet/_euler_angle_to_quaternion.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
beignet.euler_angle_to_rotation_matrix
euler_angle_to_rotation_matrix(input, axes, degrees=False)
Convert Euler angles to rotation matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 3)
|
Euler angles. |
required |
axes |
str
|
Axes. One to three characters belonging to the set :math: |
required |
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3, 3)
|
Rotation matrices. |
Source code in src/beignet/_euler_angle_to_rotation_matrix.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
beignet.euler_angle_to_rotation_vector
euler_angle_to_rotation_vector(input, axes, degrees=False)
Convert Euler angles to rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 3)
|
Euler angles. |
required |
axes |
str
|
Axes. One to three characters belonging to the set :math: |
required |
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Rotation vectors. |
Source code in src/beignet/_euler_angle_to_rotation_vector.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
beignet.invert_euler_angle
invert_euler_angle(input, axes, degrees=False)
Invert Euler angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
(Tensor, shape(..., 3))
|
Euler angles. |
required |
axes |
str
|
Axes. 1-3 characters belonging to the set {‘X’, ‘Y’, ‘Z’} for intrinsic rotations, or {‘x’, ‘y’, ‘z’} for extrinsic rotations. Extrinsic and intrinsic rotations cannot be mixed. |
required |
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
inverted_euler_angles |
(Tensor, shape(..., 3))
|
Inverted Euler angles. |
Source code in src/beignet/_invert_euler_angle.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
beignet.invert_quaternion
invert_quaternion(input, canonical=False)
Invert rotation quaternions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
(Tensor, shape(..., 4))
|
Rotation quaternions. Rotation quaternions are normalized to unit norm. |
required |
canonical |
bool
|
Whether to map the redundant double cover of rotation space to a unique
canonical single cover. If |
False
|
Returns:
Name | Type | Description |
---|---|---|
inverted_quaternions |
(Tensor, shape(..., 4))
|
Inverted rotation quaternions. |
Source code in src/beignet/_invert_quaternion.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
beignet.invert_rotation_matrix
invert_rotation_matrix(input)
Invert rotation matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
(Tensor, shape(..., 3, 3))
|
Rotation matrices. |
required |
Returns:
Name | Type | Description |
---|---|---|
inverted_rotation_matrices |
(Tensor, shape(..., 3, 3))
|
Inverted rotation matrices. |
Source code in src/beignet/_invert_rotation_matrix.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
beignet.invert_rotation_vector
invert_rotation_vector(input)
Invert rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
(Tensor, shape(..., 3))
|
Rotation vectors. |
required |
Returns:
Name | Type | Description |
---|---|---|
inverted_rotation_vectors |
(Tensor, shape(..., 3))
|
Inverted rotation vectors. |
Source code in src/beignet/_invert_rotation_vector.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
beignet.lennard_jones_potential
lennard_jones_potential(input, sigma, epsilon)
Lennard-Jones potential.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(n, m)
|
Pairwise distances between particles. |
required |
sigma |
float | Tensor, shape=(n, m)
|
Distance where the potential energy, :math: |
required |
epsilon |
float | Tensor, shape=(n, m)
|
Depth of the potential well. |
required |
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(n, m)
|
Energies. |
Source code in src/beignet/_lennard_jones_potential.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
beignet.quaternion_identity
quaternion_identity(size, canonical=False, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)
Identity rotation quaternions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
Output size. |
required |
canonical |
bool
|
Whether to map the redundant double cover of rotation space to a unique
canonical single cover. If |
False
|
out |
Tensor
|
Output tensor. Default, |
None
|
dtype |
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout |
layout
|
Layout of the returned tensor. Default, |
strided
|
device |
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad |
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
Returns:
Name | Type | Description |
---|---|---|
identity_quaternions |
(Tensor, shape(size, 4))
|
Identity rotation quaternions. |
Source code in src/beignet/_quaternion_identity.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
beignet.quaternion_magnitude
quaternion_magnitude(input, canonical=False)
Rotation quaternion magnitudes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 4)
|
Rotation quaternions. |
required |
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(...)
|
Angles in radians. Magnitudes will be in the range :math: |
Source code in src/beignet/_quaternion_magnitude.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
beignet.quaternion_mean
quaternion_mean(input, weight=None)
Mean rotation quaternions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 4)
|
Rotation quaternions. Rotation quaternions are normalized to unit norm. |
required |
weight |
Tensor, shape=(..., 4)
|
Relative importance of rotation quaternions. |
None
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 4)
|
Rotation quaternions mean. |
Source code in src/beignet/_quaternion_mean.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
beignet.quaternion_slerp
quaternion_slerp(input, time, rotation)
Interpolate between two or more points on a sphere.
Unlike linear interpolation, which can result in changes in speed when interpolating between orientations or positions on a sphere, spherical linear interpolation ensures that the interpolation occurs at a constant rate and follows the shortest path on the surface of the sphere. The process is useful for rotations and orientation interpolation in three-dimensional spaces, smoothly transitioning between different orientations.
Mathematically, spherical linear interpolation interpolates between two points on a sphere using a parameter \(t\), where \(t = 0\) represents the start point and \(t = n\) represents the end point. For two rotation quaternions \(q_{1}\) and \(q_{2}\) representing the start and end orientations:
where \(\theta\) is the angle between \(q_{1}\) and \(q_{2}\), and is computed using the dot product of \(q_{1}\) and \(q_{2}\). This formula ensures that the interpolation moves along the shortest path on the four-dimensional sphere of rotation quaternions, resulting in a smooth and constant-speed rotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
(Tensor, shape(..., N))
|
Times. |
required |
time |
(Tensor, shape(..., N))
|
Times of the known rotations. At least 2 times must be specified. |
required |
rotation |
(Tensor, shape(..., N, 4))
|
Rotation quaternions. Rotation quaternions are normalized to unit norm. |
required |
Source code in src/beignet/_quaternion_slerp.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
beignet.quaternion_to_euler_angle
quaternion_to_euler_angle(input, axes, degrees=False)
Convert rotation quaternions to Euler angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 4)
|
Rotation quaternions. Rotation quaternions are normalized to unit norm. |
required |
axes |
str
|
Axes. 1-3 characters belonging to the set {‘X’, ‘Y’, ‘Z’} for intrinsic rotations, or {‘x’, ‘y’, ‘z’} for extrinsic rotations. Extrinsic and intrinsic rotations cannot be mixed. |
required |
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Euler angles. The returned Euler angles are in the range:
|
Source code in src/beignet/_quaternion_to_euler_angle.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
beignet.quaternion_to_rotation_matrix
quaternion_to_rotation_matrix(input)
Convert rotation quaternions to rotation matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 4)
|
Rotation quaternions. Rotation quaternions are normalized to unit norm. |
required |
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3, 3)
|
Rotation matrices. |
Source code in src/beignet/_quaternion_to_rotation_matrix.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
beignet.quaternion_to_rotation_vector
quaternion_to_rotation_vector(input, degrees=False)
Convert rotation quaternions to rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 4)
|
Rotation quaternions. Rotation quaternions are normalized to unit norm. |
required |
degrees |
bool
|
|
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Rotation vectors. |
Source code in src/beignet/_quaternion_to_rotation_vector.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
beignet.random_euler_angle
random_euler_angle(size, axes, degrees=False, *, generator=None, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False)
Generate random Euler angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
Output size. |
required |
axes |
str
|
Axes. 1-3 characters belonging to the set {‘X’, ‘Y’, ‘Z’} for intrinsic rotations, or {‘x’, ‘y’, ‘z’} for extrinsic rotations. Extrinsic and intrinsic rotations cannot be mixed. |
required |
degrees |
bool
|
If |
False
|
generator |
Generator
|
Psuedo-random number generator. Default, |
None
|
out |
Tensor
|
Output tensor. Default, |
None
|
dtype |
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout |
layout
|
Layout of the returned tensor. Default, |
strided
|
device |
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad |
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
pin_memory |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
random_euler_angles |
(Tensor, shape(..., 3))
|
Random Euler angles. The returned Euler angles are in the range:
|
Source code in src/beignet/_random_euler_angle.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
beignet.random_quaternion
random_quaternion(size, canonical=False, *, generator=None, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False)
Generate random rotation quaternions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
Output size. |
required |
canonical |
bool
|
Whether to map the redundant double cover of rotation space to a unique
canonical single cover. If |
False
|
generator |
Generator
|
Psuedo-random number generator. Default, |
None
|
out |
Tensor
|
Output tensor. Default, |
None
|
dtype |
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout |
layout
|
Layout of the returned tensor. Default, |
strided
|
device |
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad |
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
pin_memory |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
random_quaternions |
(Tensor, shape(..., 4))
|
Random rotation quaternions. |
Source code in src/beignet/_random_quaternion.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
beignet.random_rotation_matrix
random_rotation_matrix(size, *, generator=None, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False)
Generate random rotation matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
Output size. |
required |
generator |
Generator
|
Psuedo-random number generator. Default, |
None
|
out |
Tensor
|
Output tensor. Default, |
None
|
dtype |
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout |
layout
|
Layout of the returned tensor. Default, |
strided
|
device |
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad |
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
pin_memory |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
random_rotation_matrices |
(Tensor, shape(..., 3, 3))
|
Random rotation matrices. |
Source code in src/beignet/_random_rotation_matrix.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
beignet.random_rotation_vector
random_rotation_vector(size, degrees=False, *, generator=None, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False)
Generate random rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
Output size. |
required |
degrees |
bool
|
|
False
|
generator |
Generator
|
Psuedo-random number generator. Default, |
None
|
out |
Tensor
|
Output tensor. Default, |
None
|
dtype |
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout |
layout
|
Layout of the returned tensor. Default, |
strided
|
device |
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad |
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
pin_memory |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
random_rotation_vectors |
(Tensor, shape(..., 3))
|
Random rotation vectors. |
Source code in src/beignet/_random_rotation_vector.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
beignet.rotation_matrix_identity
rotation_matrix_identity(size, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)
Identity rotation matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
Output size. |
required |
out |
Tensor
|
Output tensor. Default, |
None
|
dtype |
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout |
layout
|
Layout of the returned tensor. Default, |
strided
|
device |
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad |
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
Returns:
Name | Type | Description |
---|---|---|
identity_rotation_matrices |
(Tensor, shape(size, 3, 3))
|
Identity rotation matrices. |
Source code in src/beignet/_rotation_matrix_identity.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
beignet.rotation_matrix_magnitude
rotation_matrix_magnitude(input)
Rotation matrix magnitudes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
(Tensor, shape(..., 3, 3))
|
Rotation matrices. |
required |
Returns:
Name | Type | Description |
---|---|---|
rotation_matrix_magnitudes |
(Tensor, shape(...))
|
Angles in radians. Magnitudes will be in the range :math: |
Source code in src/beignet/_rotation_matrix_magnitude.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
beignet.rotation_matrix_mean
rotation_matrix_mean(input, weight=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 3, 3)
|
Rotation matrices. |
required |
weight |
Tensor, shape=(..., 4)
|
Relative importance of rotation matrices. |
None
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3, 3)
|
|
Source code in src/beignet/_rotation_matrix_mean.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
beignet.rotation_matrix_to_euler_angle
rotation_matrix_to_euler_angle(input, axes, degrees=False)
Convert rotation matrices to Euler angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
(Tensor, shape(..., 3, 3))
|
Rotation matrices. |
required |
axes |
str
|
Axes. 1-3 characters belonging to the set {‘X’, ‘Y’, ‘Z’} for intrinsic rotations, or {‘x’, ‘y’, ‘z’} for extrinsic rotations. Extrinsic and intrinsic rotations cannot be mixed. |
required |
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
euler_angles |
(Tensor, shape(..., 3))
|
Euler angles. The returned Euler angles are in the range:
|
Source code in src/beignet/_rotation_matrix_to_euler_angle.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
beignet.rotation_matrix_to_quaternion
rotation_matrix_to_quaternion(input, canonical=False)
Convert rotation matrices to rotation quaternions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 3, 3)
|
Rotation matrices. |
required |
canonical |
bool
|
Whether to map the redundant double cover of rotation space to a unique
canonical single cover. If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 4)
|
Rotation quaternion. |
Source code in src/beignet/_rotation_matrix_to_quaternion.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
beignet.rotation_matrix_to_rotation_vector
rotation_matrix_to_rotation_vector(input, degrees=False)
Convert rotation matrices to rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 3, 3)
|
Rotation matrices. |
required |
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Rotation vectors. |
Source code in src/beignet/_rotation_matrix_to_rotation_vector.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
beignet.rotation_vector_identity
rotation_vector_identity(size, degrees=False, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)
Identity rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
Output size. |
required |
degrees |
bool
|
If |
False
|
out |
Tensor
|
Output tensor. Default, |
None
|
dtype |
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout |
layout
|
Layout of the returned tensor. Default, |
strided
|
device |
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad |
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
Returns:
Name | Type | Description |
---|---|---|
identity_rotation_vectors |
(Tensor, shape(size, 3))
|
Identity rotation vectors. |
Source code in src/beignet/_rotation_vector_identity.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
beignet.rotation_vector_magnitude
rotation_vector_magnitude(input, degrees=False)
Rotation vector magnitudes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
(Tensor, shape(..., 3))
|
Rotation vectors. |
required |
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
rotation_vector_magnitudes |
(Tensor, shape(...))
|
Angles in radians. Magnitudes will be in the range :math: |
Source code in src/beignet/_rotation_vector_magnitude.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
beignet.rotation_vector_mean
rotation_vector_mean(input, weight=None, degrees=False)
Compose rotation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 4)
|
Rotation vectors. |
required |
weight |
Tensor, shape=(..., 4)
|
Relative importance of rotation matrices. |
None
|
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 4)
|
Rotation vectors mean. |
Source code in src/beignet/_rotation_vector_mean.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
beignet.rotation_vector_to_euler_angle
rotation_vector_to_euler_angle(input, axes, degrees=False)
Convert rotation vectors to Euler angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 3)
|
Rotation vectors. |
required |
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3)
|
Euler angles. The returned Euler angles are in the range:
|
Source code in src/beignet/_rotation_vector_to_euler_angle.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
beignet.rotation_vector_to_quaternion
rotation_vector_to_quaternion(input, degrees=False, canonical=False)
Convert rotation vector to rotation quaternion.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 3)
|
Rotation vector. |
required |
degrees |
bool
|
If |
False
|
canonical |
bool
|
Whether to map the redundant double cover of rotation space to a unique
canonical single cover. If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 4)
|
Rotation quaternion. |
Source code in src/beignet/_rotation_vector_to_quaternion.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
beignet.rotation_vector_to_rotation_matrix
rotation_vector_to_rotation_matrix(input, degrees=False)
Convert rotation vectors to rotation matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor, shape=(..., 3)
|
Rotation vectors. |
required |
degrees |
bool
|
If |
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(..., 3, 3)
|
Rotation matrices. |
Source code in src/beignet/_rotation_vector_to_rotation_matrix.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
beignet.translation_identity
translation_identity(size, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)
Identity translation vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size |
int
|
Output size. |
required |
out |
Tensor
|
Output tensor. Default, |
None
|
dtype |
dtype
|
Type of the returned tensor. Default, global default. |
None
|
layout |
layout
|
Layout of the returned tensor. Default, |
strided
|
device |
device
|
Device of the returned tensor. Default, current device for the default tensor type. |
None
|
requires_grad |
bool
|
Whether autograd records operations on the returned tensor. Default,
|
False
|
Returns:
Name | Type | Description |
---|---|---|
output |
Tensor, shape=(size, 3)
|
Identity rotation quaternions. |
Source code in src/beignet/_translation_identity.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|