one_of
OneOf
¶
Bases: NumpyOp
Perform one of several possible NumpyOps.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*numpy_ops |
NumpyOp
|
Ops to choose between with a specified (or uniform) probability. |
()
|
probs |
Optional[List[float]]
|
List of probabilities, must sum to 1. When None, the probabilities will be equally distributed. |
None
|
Source code in fastestimator/fastestimator/op/numpyop/meta/one_of.py
forward
¶
Execute a randomly selected op from the list of numpy_ops
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Union[ndarray, List[ndarray]]
|
The information to be passed to one of the wrapped operators. |
required |
state |
Dict[str, Any]
|
Information about the current execution context, for example {"mode": "train"}. |
required |
Returns:
Type | Description |
---|---|
Union[ndarray, List[ndarray]]
|
The |
Source code in fastestimator/fastestimator/op/numpyop/meta/one_of.py
set_rua_level
¶
Set the augmentation intensity based on the magnitude_coef.
This method is specifically designed to be invoked by the RUA Op.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
magnitude_coef |
float
|
The desired augmentation intensity (range [0-1]). |
required |
Raises:
Type | Description |
---|---|
AttributeError
|
If ops don't have a 'set_rua_level' method. |