How to use the nevergrad.parametrization.core.NotSupportedError function in nevergrad

To help you get started, we’ve selected a few nevergrad examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebookresearch / nevergrad / nevergrad / parametrization / core.py View on Github external
def _internal_get_standardized_data(self: P, instance: P) -> np.ndarray:
        raise NotSupportedError(f"Export to standardized data space is not implemented for {self.name}")
github facebookresearch / nevergrad / nevergrad / parametrization / core.py View on Github external
def _internal_set_std_data(self: BP, data: np.ndarray, instance: BP, deterministic: bool = False) -> BP:
        raise NotSupportedError(f"Import from standardized data space is not implemented for {self.name}")  # type: ignore
github facebookresearch / nevergrad / nevergrad / parametrization / core.py View on Github external
def _internal_get_std_data(self: BP, instance: BP) -> np.ndarray:
        raise NotSupportedError(f"Export to standardized data space is not implemented for {self.name}")  # type: ignore
github facebookresearch / nevergrad / nevergrad / parametrization / core.py View on Github external
def get_value_hash(self) -> t.Hashable:
        """Hashable object representing the current value of the instance
        """
        val = self.value
        if isinstance(val, (str, bytes, float, int)):
            return val
        elif isinstance(val, np.ndarray):
            return val.tobytes()
        else:
            raise NotSupportedError(f"Value hash is not supported for object {self.name}")
github facebookresearch / nevergrad / nevergrad / parametrization / core.py View on Github external
def _internal_set_standardized_data(self: P, data: np.ndarray, instance: P, deterministic: bool = False) -> P:
        raise NotSupportedError(f"Import from standardized data space is not implemented for {self.name}")
github facebookresearch / nevergrad / nevergrad / parametrization / core.py View on Github external
def get_value_hash(self) -> t.Hashable:
        """Hashable object representing the current value of the instance
        """
        val = self.value
        if isinstance(val, (str, bytes, float, int)):
            return val
        elif isinstance(val, np.ndarray):
            return val.tobytes()
        else:
            raise NotSupportedError(f"Value hash is not supported for object {self.name}")
github facebookresearch / nevergrad / nevergrad / parametrization / core.py View on Github external
def dimension(self) -> int:
        """Dimension of the standardized space for this parameter
        i.e size of the vector returned by get_standardized_data()
        """
        if self._dimension is None:
            try:
                self._dimension = self.get_standardized_data().size
            except NotSupportedError:
                self._dimension = 0
        return self._dimension