Costs
|
L2 cost |
|
Power cost. |
|
Anisotropic power cost with anisotropy matrix |
|
Spherocylinder cost. |
- iceshot.costs.l2_cost(data, scaling=None, R=1.0, C=1.0, **kwargs)
L2 cost
\[c(x,y) = |y-x|^2\]- Parameters:
data (DataPoints)
scaling (str, optional) –
Defaults to None. If specified, can be one of the following:
"level_set"
: The cost is equal toC
at distanceR
"volume"
: The integral of the cost on a ball of radiusR
is equal to the volume of the ball timesC
"constant:
: Multiply the cost byC
R (float or Tensor, optional) – Defaults to 1.0.
C (float or Tensor, optional) – Defaults to 1.0.
- Returns:
cost matrix and its gradient
- Return type:
((N,M)-LazyTensor, (N,M,d)-LazyTensor)
- iceshot.costs.power_cost(data, p=2.0, scaling=None, R=1.0, C=1.0, **kwargs)
Power cost.
\[c(x,y) = \lambda_p |y-x|^p\]- Parameters:
data (DataPoints)
p (float or Tensor, optional) – Exponent. Defaults to 2.0.
scaling (str, optional) –
Defaults to None. If specified, can be one of the following:
"level_set"
: The cost is equal toC
at distanceR
"volume"
: The integral of the cost on a ball of radiusR
is equal to the volume of the ball timesC
"constant:
: Multiply the cost byC
R (float or Tensor, optional) – Defaults to 1.0.
C (float or Tensor, optional) – Defaults to 1.0.
- Returns:
cost matrix and its gradient
- Return type:
((N,M)-LazyTensor, (N,M,d)-LazyTensor)
- iceshot.costs.anisotropic_power_cost(data, p=2.0, scaling=None, b=1.0, ar=None, C=1.0, **kwargs)
Anisotropic power cost with anisotropy matrix
data.orientation
.\[c(x,y) = \lambda_p (y-x)^T A (y-x)\]- Parameters:
data (DataPoints)
p (float or Tensor, optional) – Exponent. Defaults to 2.0.
scaling (str, optional) –
Defaults to None. If specified, can be one of the following:
"level_set"
: \(c(x,y) = C\) is the equation of an ellipse with aspect ratioar
and short axisb
"volume"
: The integral of the cost on an ellipse of aspect ratioar
and short axisb
is equal to the volume of the ellipse timesC
"constant:
: Multiply the cost byC
b (float or Tensor, optional) – short-axis. Defaults to 1.0.
ar (Tensor, optional) – aspect ratio. Defaults to None.
C (float or Tensor, optional) – Defaults to 1.0.
- Returns:
cost matrix and its gradient
- Return type:
((N,M)-LazyTensor, (N,M,d)-LazyTensor)
- iceshot.costs.spherocylinders_2_cost(data, p=2.0, b=1.0, scaling=None, C=1.0, **kwargs)
Spherocylinder cost.
The level-sets are spherocylinders with aspect ratio
data.ar
.- Parameters:
data (DataPoints)
p (float or Tensor, optional) – Exponent. Defaults to 2.0.
b (float or Tensor, optional) – short_axis. Defaults to 1.0.
scaling (str, optional) –
Defaults to None. If specified, can be one of the following:
"level_set"
: Short-axis level-set"volume"
: The integral of the cost on the spherocylinder with short-axisb
is the volume of this spherocylinder."constant:
: Multiply the cost byC
C (float or Tensor, optional) – Defaults to 1.0.
- Raises:
NotImplementedError – Only in 2D
- Returns:
cost matrix and its gradient
- Return type:
((N,M)-LazyTensor, (N,M,d)-LazyTensor)