Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Peiyuan Liao committed Aug 25, 2021
1 parent 29b6074 commit d39fef1
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 103 deletions.
49 changes: 24 additions & 25 deletions eth/demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "a5691c85",
"id": "d67e4546",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -18,7 +18,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "f7a41f4f",
"id": "c50ceb61",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -44,7 +44,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "2138ebc4",
"id": "b19d3ed1",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -85,7 +85,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "827a379e",
"id": "c753219e",
"metadata": {},
"outputs": [
{
Expand All @@ -105,7 +105,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "3b9d3002",
"id": "93515c3a",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -118,7 +118,7 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "97c69fba",
"id": "94b24907",
"metadata": {},
"outputs": [
{
Expand All @@ -139,7 +139,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "4bbca5b0",
"id": "ffac2ddb",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -151,7 +151,7 @@
{
"cell_type": "code",
"execution_count": 8,
"id": "add9e6ca",
"id": "cc826e58",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -183,26 +183,33 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "10e128e2",
"id": "863ac375",
"metadata": {},
"outputs": [],
"source": [
"from scripts import q_model, q_dataset\n",
"\n",
"alpha_X = 0\n",
"beta_X = 8\n",
"\n",
"alpha_W = -1\n",
"beta_W = 1\n",
"alpha_Y = 2\n",
"beta_W = 8\n",
"\n",
"alpha_Y = 0\n",
"beta_Y = 8\n",
"alpha_Yt = 2\n",
"\n",
"alpha_Yt = 0\n",
"beta_Yt = 8\n",
"\n",
"alpha_b = 0\n",
"beta_b = 8\n",
"\n",
"alpha_R = -1\n",
"beta_R = 1\n",
"\n",
"alpha_S = 0\n",
"beta_S = 0.4\n",
"\n",
"m = 20\n",
"p = 4\n",
"n = 1"
Expand All @@ -211,7 +218,7 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "8e0375e9",
"id": "dc953a1b",
"metadata": {},
"outputs": [
{
Expand All @@ -224,16 +231,8 @@
"mse assertion passed\n",
"Mean Squared Error actual: 0.1123029571353145\n",
"quantized 18403\n",
"Mean Squared Error simulated: 0.11229933467618874454\n",
"quantized 18402\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/liaopeiyuan/Documents/GitHub/zkml-core/eth/scripts/quantize_model.py:19: UserWarning: Results are negative, circom may not be happy\n",
" warnings.warn(\"Results are negative, circom may not be happy\")\n"
"Mean Squared Error simulated: 0.11232375022889581895\n",
"quantized 18406\n"
]
}
],
Expand All @@ -252,7 +251,7 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "f5f109a0",
"id": "c82fd740",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -270,7 +269,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "0c402cfd",
"id": "ca9063d9",
"metadata": {},
"outputs": [],
"source": []
Expand Down
77 changes: 29 additions & 48 deletions eth/quantized_dataset.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
{
"out": 18402,
"out": 18844,
"sR2sSq_numerator": 5,
"sR2sSq_denominator": 32766,
"z_R": 32770,
"z_Sq": 4,
"Yt_q": [
[
38231
45057
],
[
37139
44238
],
[
32770
40962
],
[
56798
58983
],
[
54614
57344
],
[
46969
51610
],
[
45876
50791
],
[
38231
45057
],
[
46969
51610
],
[
31678
40142
],
[
49153
53249
],
[
34954
42600
],
[
37139
44238
],
[
62259
63079
],
[
44784
49972
],
[
48061
52430
],
[
39323
45876
],
[
40415
46696
],
[
26217
36047
],
[
44784
49972
]
],
"sYsR_numerator": 3,
"sYsR_numerator": 4,
"sYsR_denominator": 1,
"sYtsR_numerator": 3,
"sYtsR_numerator": 4,
"sYtsR_denominator": 1,
"constant": 32770,
"X_q": [
Expand Down Expand Up @@ -193,31 +193,12 @@
16387
]
],
"W_q": [
[
54097
],
[
57560
],
[
16638
],
[
27056
]
],
"b_q": [
[
14438
]
],
"z_X": 4,
"z_W": 32770,
"z_W": 7285,
"z_b": 4,
"z_Y": 21888242871839275222246405745257275088548364400416034343698204186575808517457,
"sbsY_numerator": 4,
"sbsY_denominator": 3,
"sXsWsY_numerator": 2,
"sXsWsY_denominator": 49149
"z_Y": 4,
"sbsY_numerator": 1,
"sbsY_denominator": 1,
"sXsWsY_numerator": 3,
"sXsWsY_denominator": 21844
}
Loading

0 comments on commit d39fef1

Please sign in to comment.