tensordict.nn.mappings¶
- tensordict.nn.mappings(key: str) Callable¶
給定一個輸入字串,返回一個滿射函式 f(x): R -> R^+。
- 引數:
key (str) – one of “softplus”, “exp”, “relu”, “expln”, “biased_softplus” or “none” (no mapping)。
注意
If the key begins with “biased_softplus”, then it needs to take the following form:
`"biased_softplus_{bias}"`where`bias`can be converted to a floating point number that will be used to bias the softplus function. Alternatively, the`"biased_softplus_{bias}_{min_val}"`syntax can be used. In that case, the additional`min_val`term is a floating point number that will be used to encode the minimum value of the softplus transform. In practice, the equation used is softplus(x + bias) + min_val, where bias and min_val are values computed such that the conditions above are met.注意
Custom mappings can be added through
tensordict.nn.add_custom_mapping。- 返回:
a Callable