Coder Social home page Coder Social logo

nfgen's People

Contributors

fannxy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nfgen's Issues

Using NFGen for default MP-SPDZ

Hi,

I recently cloned this repo and had a few small issues and questions while trying it out for MP-SPDZ.

  1. To get the example.py code working, I had to make a few small changes:
    1. Lines 35 and 36 of the MP-SPDZ fixed-point template at https://github.com/Fannxy/NFGen/blob/main/src/NFGen/CodeTemplet/templet.py use n - I believe they should be m.
    2. I also had to add from Compiler import types to support the @types.vectorize annotation.

With these two changes, MP-SPDZ can compile the generated sigmoid. Is this a correct fix?

  1. When I run the code with example.py's default settings, it produces an approximation with a final (k, m) of (6, 8), or 8 pieces of degree-6 polynomials. However, I would like to use it for MP-SPDZ's default fixed-point representation, which is a 31-bit value providing 16 bits of resolution.
    If I adjust the example.py code to use f = 16 and n = 31, leaving other components unchanged, the resulting approximation has many coeffA values that equal 16384.0, but only values on [-16384, 16384) can be converted to fixed-point (not inclusive at the upper bound).
    If I use f = 16, n = 30 instead, the approximation has many -8192.0 and 8192.0 coefficients and uses ~8500 pieces, though it can be compiled under default MP-SPDZ parameters.
    So, I had a few questions:
    1. What would be causing so many maximum coefficients?
    2. Is there a configuration that you would suggest to generate piecewise approximations under the smaller default MP-SPDZ precision?
    3. Or is NFGen designed in such a way that the finer precision is necessary for correct execution and good performance?

Thanks.

How do I generate the .pkl file under /PerformanceModel/?

Hi, I was wondering if it would be possible to replace the addition, multiplication and comparison protocols designed separately instead of the publicly available library to generate piece-wise polynomial functions for complex functions? If so, how can I do it.

pip install NFGen command does not seem to be working on Python3.6

Note on Python 3.8 it works.

Here is the error trace:

ERROR: Could not find a version that satisfies the requirement NFGen (from versions: none)
ERROR: No matching distribution found for NFGen
WARNING: You are using pip version 21.3; however, version 22.3.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.