Skip to content

Commit

Permalink
Merge pull request #21 from NillionNetwork/feature/nada-numpy-0.1.2
Browse files Browse the repository at this point in the history
Compatibility with nada numpy 0.1.2
  • Loading branch information
mathias-nillion authored Jun 21, 2024
2 parents 2b1500d + 81d694a commit 4edc47f
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ jobs:
run: poetry build
- name: Publish package
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry config pypi-token.pypi ${{ secrets.NILLION_PYPI_TOKEN }}
poetry publish
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Nada AI

![GitHub License](https://img.shields.io/github/license/NillionNetwork/nada-ai?style=for-the-badge)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/NillionNetwork/nada-ai/test?style=for-the-badge)

Nada AI is a Python library designed for performing ML/AI on top of Nada DSL and the Nillion Network.

It provides an intuitive ML interface and frictionless integration with existing ML frameworks such as PyTorch and Sci-kit learn.
Expand Down
2 changes: 1 addition & 1 deletion examples/linear_regression/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ async def main():
nillion.Secrets({}),
)
# Rescale the obtained result by the quantization scale
outputs = [na_client.float_from_rational(result["my_output_0"])]
outputs = [na_client.float_from_rational(result["my_output"])]
print(f"🖥️ The result is {outputs}")

expected = fit_model.predict(np.ones((NUM_FEATS,)).reshape(1, -1))
Expand Down
1 change: 0 additions & 1 deletion examples/linear_regression/src/linear_regression.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import nada_numpy as na
from nada_dsl import Output

from nada_ai.linear_model import LinearRegression

Expand Down
2 changes: 1 addition & 1 deletion examples/linear_regression/tests/linear_regression.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ inputs:
expected_outputs:
# If you go in and crunch the numbers of this one, the result should be 16.877471923828125
# 16.877471923828125 * 2**16 = 1106085
my_output_0:
my_output:
SecretInteger: "1106085"
18 changes: 9 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nada-ai"
version = "0.1.1"
version = "0.1.2"
description = "Nada-AI is a Python library designed for AI/ML on top of Nada DSL and Nillion Network."
authors = ["Mathias Leys <[email protected]>"]
readme = "README.md"
Expand All @@ -13,7 +13,7 @@ scikit-learn = "^1.4.2"
prophet = "^1.1.5"
nada-dsl = "^0.2.1"
py-nillion-client = "^0.2.1"
nada-numpy = "^0.1.1"
nada-numpy = "^0.1.2"
nillion-python-helpers = "^0.1.2"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion tests/nada-tests/src/linear_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ def nada_main():

result = model(x)

return [Output(result, "output", party)]
return na.output(result, party, "my_output")
2 changes: 2 additions & 0 deletions tests/test_all_nada.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
EXAMPLES = [
"complex_model",
"linear_regression",
"multi_layer_perceptron",
"neural_net",
"spam_detection",
# "time_series",
]

Expand Down

0 comments on commit 4edc47f

Please sign in to comment.