Skip to content

Usage of polynomial evaluation with different degrees #535

Discussion options

You must be logged in to vote

The input values should be between [-K, K]. Here your values in numbers are too large. I guess you clamp the values in sigmoidTest but not in sigmoid.
Also, the approximation polynomial is given in the Chebyshev basis, thus you need to perform some kind of rescaling (or change of basis) on your input before evaluating the polynomial.
To do it in an encrypted form you can do:

	if err = evaluator.Mul(ciphertext, scalarmul, ciphertext); err != nil {
		panic(err)
	}

	if err = evaluator.Add(ciphertext, scalaradd, ciphertext); err != nil {
		panic(err)
	}

	if err = evaluator.Rescale(ciphertext, ciphertext); err != nil {
		panic(err)
	}

before the polynomial evaluation. This seems to give corr…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ProgrammingFlorian
Comment options

@lehugueni
Comment options

Answer selected by ProgrammingFlorian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants