frlearn.array_functions.soft_min¶
- frlearn.array_functions.soft_min(a, weights, k: int, axis=- 1, type: str = 'arithmetic')[source]¶
Calculates the soft minimum of an array.
- Parameters
- andarray
Input array of values.
- weights(k -> np.array) or None
Weights to apply to the k selected values. If None, the kth value is returned.
- k: int or None
Number of least values from which the soft minimum is calculated. Should be either a positive integer not larger than a along axis, or None, which is interpreted as the size of a along axis.
- axisint, default=-1
The axis along which the soft minimum is calculated.
- typestr {‘arithmetic’, ‘geometric’, ‘harmonic’, }, default=’arithmetic’
Determines the type of weighted average.
- Returns
- soft_min_along_axisndarray
An array with the same shape as a, with the specified axis removed. If a is a 0-d array, a scalar is returned.