boofun.core.spaces
Classes
|
- class boofun.core.spaces.Space(value)[source]
- BOOLEAN_CUBE = 1
- PLUS_MINUS_CUBE = 2
- REAL = 3
- LOG = 4
- GAUSSIAN = 5
- static translate(input: int | float | ndarray, source_space: Space, target_space: Space) int | float | ndarray[source]
Translate a scalar or array from one space to another.
- Parameters:
input – Input value(s) to translate
source_space – Source mathematical space
target_space – Target mathematical space
- Returns:
Translated value(s) in target space
Examples
>>> Space.translate([0, 1], Space.BOOLEAN_CUBE, Space.PLUS_MINUS_CUBE) array([-1, 1]) >>> Space.translate([-1, 1], Space.PLUS_MINUS_CUBE, Space.BOOLEAN_CUBE) array([0, 1])