Skip to content

Commit

Permalink
chore: keep experimenting
Browse files Browse the repository at this point in the history
  • Loading branch information
fd0r committed Jun 11, 2024
1 parent 9a89c9c commit 974ad75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import numpy as np
import torch
from concrete.fhe import Exactness
from concrete.fhe import Exactness, round_bit_pattern, truncate_bit_pattern
from concrete.fhe.compilation.configuration import Configuration
from models import cnv_2w2a
from torch.utils.data import DataLoader
Expand Down Expand Up @@ -85,12 +85,15 @@ def wrapper(*args, **kwargs):
# Multi-parameter strategy is used in order to speed-up the FHE executions
base_configuration = Configuration()

exactness = fhe.Exactness.APPROXIMATE
exactness = Exactness.APPROXIMATE
msbs_to_keep = 4
rounding_function = truncate_bit_pattern

tlu_optimizer = TLU1bitDecomposition(
n_jumps_limit=2,
exactness=exactness,
msbs_to_keep=4,
msbs_to_keep=msbs_to_keep,
rounding_function=rounding_function,
)
rounding = InsertRounding(6, exactness=exactness)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ def main(args):
rounding_function = round_bit_pattern
msbs = 1

# truncate - exact - msbs=4: work
exactness = fhe.Exactness.EXACT
# truncate - exact - msbs=4: works fine

exactness = fhe.Exactness.APPROXIMATE
rounding_function = truncate_bit_pattern
msbs = 4

Expand Down

0 comments on commit 974ad75

Please sign in to comment.