How to use the diffprivlib.mechanisms.base.TruncationAndFoldingMixin.check_inputs function in diffprivlib

To help you get started, we’ve selected a few diffprivlib 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 IBM / differential-privacy-library / diffprivlib / mechanisms / laplace.py View on Github external
def check_inputs(self, value):
        super().check_inputs(value)
        TruncationAndFoldingMixin.check_inputs(self, value)

        return True
github IBM / differential-privacy-library / diffprivlib / mechanisms / laplace.py View on Github external
def randomise(self, value):
        TruncationAndFoldingMixin.check_inputs(self, value)

        noisy_value = super().randomise(value)
        return self._truncate(noisy_value)
github IBM / differential-privacy-library / diffprivlib / mechanisms / geometric.py View on Github external
def randomise(self, value):
        TruncationAndFoldingMixin.check_inputs(self, value)

        noisy_value = super().randomise(value)
        return int(np.round(self._fold(noisy_value)))
github IBM / differential-privacy-library / diffprivlib / mechanisms / laplace.py View on Github external
def check_inputs(self, value):
        super().check_inputs(value)
        TruncationAndFoldingMixin.check_inputs(self, value)

        return True
github IBM / differential-privacy-library / diffprivlib / mechanisms / laplace.py View on Github external
def randomise(self, value):
        TruncationAndFoldingMixin.check_inputs(self, value)

        noisy_value = super().randomise(value)
        return self._fold(noisy_value)
github IBM / differential-privacy-library / diffprivlib / mechanisms / geometric.py View on Github external
def randomise(self, value):
        TruncationAndFoldingMixin.check_inputs(self, value)

        noisy_value = super().randomise(value)
        return int(np.round(self._truncate(noisy_value)))