diff --git a/sdk/Readme.md b/sdk/Readme.md index a655cb1..bdfe134 100644 --- a/sdk/Readme.md +++ b/sdk/Readme.md @@ -5,7 +5,7 @@ programming capabilities via the usage of Aleo's zkSnarks. Currently this SDK is in alpha preview stage. It can be installed by using the following command: ```bash - pip3 install zkml + pip3 install aleo ``` Alternatively, you can clone it from [GitHub](https://github.com/AleoHQ/python-sdk/tree/master/sdk) and run: diff --git a/sdk/target/wheels/aleo-0.0.3-cp311-cp311-macosx_11_0_arm64.whl b/sdk/target/wheels/aleo-0.0.3-cp311-cp311-macosx_11_0_arm64.whl deleted file mode 100644 index 11a0f0f..0000000 Binary files a/sdk/target/wheels/aleo-0.0.3-cp311-cp311-macosx_11_0_arm64.whl and /dev/null differ diff --git a/zkml-research/zkml-web-app/mnist_train.ipynb b/zkml-research/zkml-web-app/mnist_train.ipynb index c735e4a..8370b77 100644 --- a/zkml-research/zkml-web-app/mnist_train.ipynb +++ b/zkml-research/zkml-web-app/mnist_train.ipynb @@ -1427,7 +1427,7 @@ "text": [ "\n", "Constraints: 147972\n", - "Runtime for one instance: 3.5431532859802246 seconds\n", + "Runtime for one instance: 3.6300060749053955 seconds\n", "Leo accuracy: 80.0 %\n", "Python accuracy: 80.0 %\n" ] @@ -1441,7 +1441,7 @@ "lt = LeoTranspiler(\n", " model=converted_model, validation_data=train_features_normalized[0:600].numpy()\n", ")\n", - "leo_project_path = os.path.join(os.getcwd(), \"/tmp/mnist\")\n", + "leo_project_path = os.path.join(os.getcwd(), \"tmp\", \"mnist\")\n", "leo_project_name = \"sklearn_mlp_mnist_1\"\n", "lt.to_leo(\n", " path=leo_project_path, project_name=leo_project_name, fixed_point_scaling_factor=16\n", @@ -1493,13 +1493,13 @@ "output_type": "stream", "text": [ "Constraints: 147972\n", - "Runtime for one instance: 13.05722689628601 seconds\n", + "Runtime for one instance: 28.183155059814453 seconds\n", "\n", "Leo prediction: [-1457.217041015625, -5426.77490234375, 3321.30517578125, 2152.006103515625, -6994.791015625, -6128.408203125, -11780.537841796875, 5969.34619140625, 1985.5869140625, 3234.726806640625]\n", "Python prediction: 7\n", "True label: 7\n", "\n", - "Proof: proof1qyqsqqqqqqqqqqqpqqqqqqqqqqqykyl8lz80kmvqqrv55rt7nl89phch90ey8tuycgc2ry6fv0ue8qr33950ms2llradgcugv624gl5pqxyjk5hns2ye90tx5yk8703pq08t6y3gc2ejje05x5rjuglhttj762tmwtpv3wxnrvg0en9yxt2jkq0k9tprcvsepaw4f8hp0v8vregddyf8vvshvn3azvd5nlxvw39qzrxeelvl64gclxl4q8zs8ysxtvqr7c9rn6rj48hahynkjwr9aa4c96m5m6d4rt6mdda2uufhrjldfyf3jz5xffc4k20zv867jevr4eqqy4wqtrs8w43lq3j0palj6e9yetqa8a0h2fvqwtv2c27e084fj5mrpsgjuvv20xvksn9t9d6hcawcpw8wx3uszjazmzkzm3uj7tnuj2gzwapjr56jg9kqqazz6cx09yvlt58ukerqansr0r6netqnafa9sznjzdgh79xnt9a33zse77dfwfnhw5em47h2tra8dj4rppl0hlcjg2pllng9rhhqz0p2a2wzzxwz6qyusxgzxddx34t9p5mp8puz6lcwwzfpqdktu3hpckxmjkg4z5q5emf0v2qe9vdwq0x6x3l9hdgfjkqa8x4qqckkw8gvz0s29d6dp0sl04qxwxuzyupk5sdh2kraqq2akl5yeeunxwymf99wfuacralwzecql7gxtckrjne994jjsn7ey4kdqsffhqu48fyj5nr7cvqxkfrzgyx5yfmmjj6n3svuu0vxvzqad6rk4tld925aqz8wxe8z4ll8lmkczytzpqagnx4rlfk6gnh297pwzj8m8wnwnrlmuavc03xfcnn9zqn2zpf852ehtc2lfu7l9wpfjjvrxn7jzgg4ezyf6yt6xh2vxwp3vyksp545hgtu605ecc7zgtr2hgyejvcrq9ahe0rxg2pwketleerp75cvwxj6gy4s53pnc4ln7qe6l8ygd34w2707zgqdnd8qhw8y8ll2gyregkdrz5fr42v6yqymlq7gqqlaqydu9ztmpsagg9r0hppjm30g5pz03tvpzss9py8ua78hd4vezlhlr4cvmzwl2y58qpsfcgc3kespq4a3k6n7lkkzu4sfh6382fa3x62y4uqce05nyhced8na04r825lsxy009ddhk48c55x7ssr0ae0l778d9xkfjquej4va0sgkh2zn3fqyqvqqqqqqqqqqptt0e77wzzn6kvscgfql2gu7an9jf4n0ra9kwljqftqtnxcg2mrzh75wz7w6pldeq9t3uat5ezq7sqqwtxn9xgsg93zux6wv447le5nnr5xqgufz4lq4gyxry3kwukn6xkpv7hwep9uhlzljvl67gkn87ncqqxgh5rcj3q4eeaw6qvc62zztg55mf7zvu547sv0drhjnefnt3l7q0rndrfs642y8uj3222spjjfvly6qrlkj8guhsur575h3ys5w9t4enfmv0tawxkn3gh9phx9h8fnksqqq9g6l9n\n" + "Proof: proof1qyqsqqqqqqqqqqqpqqqqqqqqqqqrwhjmms8lv52u43ff6a22mn3yfwwqv3jzg00fp0sy7tkv699f42gl50lwycl764ejy2p2vudj5tsqqy27szvhax3lwm6gs3t8lpf2dhxxx4jy2eywny9zafrxk46f2hjng7gmhy3pu07tewl6m49jjtkssqr6r27y52qxwf2wf9ft0r97c6e5xywggthwmla44e63fc8wldqd37aas4qsr50rxejrk0qwr2px2gqwhp76l8lrnsadsdca6a5jtxjgwsy0vf9tpdfmtj2s48rpdg4ax7l46wachcu236v22au0s8tp6rgqsnvzlgp9wuqulg2akcwendm4n5kq7has8pq5p9rcluqavzcvcxt4wytx5nxlfatl6j8vlxgneuccpeuhelgt78tlur6xgvh4fre7aecpadruycfw4se77hm5vttz3gpywwvm5f68p7wetvremk2a8048sxg6949t62ftwh5t34fk2qs56l0ecs2deevmlswk66xfpytlc52g4vlc7cgmc9mewt7jta4y5qax3qqyvpa3v3t7rm9wduqjkjdh0gsz4gvgxltugwwjvz6292xy8upxjfsddtfu2kzj3dxm8jk0u2qgy5q2jy7xx509r5xycups0czvk4gy8p0y3qjjzzc25rg8xptkl2nywem2dy5kesqc85cqxxr69pkh4h5q8a2vvedsfc4wwjydhe3g3h8repegn4548h4lwdkl0jvgdgm4gyrphmfc2tulz890w3yqzcvuql9cn942jln7qjyvqka7amv67xq6yqw6kgxgk9dg4q4gt0sc3aulh84kjcnaht6y89pywx5gs5t46yclpnecxjzlnz36f9ezz5pm8j8xcjt69gkyq9nemgnesh8pwrtrprspp09smvmq4py00znu3uy6wsw0xjdd7csk0uqam75uuqywmp74hhgr53tcas9nxn8ezuv9w5au80fjfat3rwkaa73r33da8t0cjdfwjyguqeezywcrf8nztqzhde020sq72mtntm8gnwvy6vk7j6lwyava2q9hp7upk0a8g9jv7c2k2ccyp5sv053a9frhp55l82dsea67f738pc42hgss8m8wt4wpz9kuzdmc7v8scg893xce0m7c7jlzkfh06thprdmggwtf5h598ug55x4t3y5epg5z0x4243cdyqpcvw7xs44wl7csqvqqqqqqqqqqp3lkjcljdsy7vqgw86u8kkwenxf9uytkpk2k5x3ntd62eulgqpq6ztpzg3dgwrm9x7xupmtvel0dsqq04h0n97qlxs6y760c94rd3h53gp0uuhzw689acy3fy89des3st8ahrsnphtuye3v3gua80h4ctruqqyc5gwkjru3sparw5x2zg3whtnnqekxgxu0fwp4m49r46lm9nmlsuawa3z7vdp0nk7p6dunh8mm07d5z24q20yf9cta3qppmeapskg8p56d4hgg7cpcy0gnsyey0gwk2sqqqqpmrqw\n" ] } ], @@ -1790,7 +1790,7 @@ "output_type": "stream", "text": [ "Circuit constraints: 32305\n", - "Runtime: 6.387216091156006 seconds\n", + "Runtime: 12.573861122131348 seconds\n", "Active input count: 20\n", "Leo prediction in fixed-point notation: 112\n", "Leo prediction in decimal notation: 7.0\n", @@ -1888,7 +1888,7 @@ "output_type": "stream", "text": [ "Circuit constraints: 32305\n", - "Runtime: 6.395868301391602 seconds\n", + "Runtime: 6.674022197723389 seconds\n", "Active input count: 20\n", "Leo prediction in fixed-point notation: 112\n", "Leo prediction in decimal notation: 7.0\n", @@ -2149,7 +2149,7 @@ "output_type": "stream", "text": [ "Constraints: 84630\n", - "Runtime for one instance: 2.4105868339538574 seconds\n", + "Runtime for one instance: 3.0045650005340576 seconds\n", "Leo accuracy: 85.0 %\n", "Python accuracy: 85.0 %\n" ] @@ -2161,7 +2161,7 @@ "lt = LeoTranspiler(\n", " model=converted_model_even_odd, validation_data=train_features_normalized[0:600].numpy()\n", ")\n", - "leo_project_path = os.path.join(os.getcwd(), \"/tmp/mnist\")\n", + "leo_project_path = os.path.join(os.getcwd(), \"tmp\", \"mnist\")\n", "leo_project_name = \"sklearn_mlp_mnist_2\"\n", "lt.to_leo(\n", " path=leo_project_path, project_name=leo_project_name, fixed_point_scaling_factor=16\n", @@ -2295,7 +2295,7 @@ "output_type": "stream", "text": [ "Circuit constraints: 24508\n", - "Runtime: 11.283885955810547 seconds\n", + "Runtime: 22.241719007492065 seconds\n", "Active input count: 20\n", "Leo prediction in fixed-point notation: 16\n", "Leo prediction in decimal notation: 1.0\n", diff --git a/zkml/examples/MLP_neural_networks/mnist_dataset.ipynb b/zkml/examples/MLP_neural_networks/mnist_dataset.ipynb index fc5e3c2..68513b8 100644 --- a/zkml/examples/MLP_neural_networks/mnist_dataset.ipynb +++ b/zkml/examples/MLP_neural_networks/mnist_dataset.ipynb @@ -1218,8 +1218,8 @@ "output_type": "stream", "text": [ "\n", - "Constraints: 201491\n", - "Runtime for one instance: 1.7962210178375244 seconds\n", + "Constraints: 158227\n", + "Runtime for one instance: 3.595292091369629 seconds\n", "Leo accuracy: 74.0 %\n", "Python accuracy: 74.0 %\n" ] @@ -1233,7 +1233,7 @@ "lt = LeoTranspiler(\n", " model=converted_model, validation_data=train_features_normalized[0:600].numpy()\n", ")\n", - "leo_project_path = os.path.join(os.getcwd(), \"/tmp/mnist\")\n", + "leo_project_path = os.path.join(os.getcwd(), \"tmp/mnist\")\n", "leo_project_name = \"sklearn_mlp_mnist_1\"\n", "lt.to_leo(\n", " path=leo_project_path, project_name=leo_project_name, fixed_point_scaling_factor=16\n", @@ -1284,14 +1284,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "Constraints: 201491\n", - "Runtime for one instance: 15.774071216583252 seconds\n", + "Constraints: 158227\n", + "Runtime for one instance: 40.33675503730774 seconds\n", "\n", "Leo prediction: [-2015.02587890625, -1571.911376953125, 1426.609130859375, 1412.776123046875, -8980.85546875, -2928.00244140625, -8780.64306640625, 5337.92138671875, 1679.63037109375, 271.654296875]\n", "Python prediction: 7\n", "True label: 7\n", "\n", - "Proof: proof1qqqsqqqqqqqqqqqpqqqqqqqqqqqy5xmjz74ut3c2uplnf7ych7jvf4zy8nunyq9t6pftrrgxegmrvn6s5s52k4rlq3j4qx03j0ddnpypqy46tmkdmxwggr7ycma9f6jynurpr8w0nv5n4eye3ztqpe5xuqkar236mnxdsqec4ahskelj9akrxqpr8puhzp25mjkh3uap9g25uu7helvz39an8tfaxqcclu64je8km9ht2nmyqgst4vcjl2yakwjdtzqydd078h04r67hh726u877zyujs5e0fnae8t0fqyjxrx98kxhgu7n4xykyar5e3w22npvhe2qg5dvqspru8ysug5zfk2xszaan80lxdj28cngzss8pd923d92r4avgywzkwuqk59vmsc55w6e3k9cp2f6sqdfj28ta3s4m5uf3vl6ehfuyxq4mpgrv5w0ktqs24xppfa8rywaelxsphwuummpl385ta9qexdcmq92f7gmch7w288l9ppht9sppare24w9mjqnmpshanq5txy3k4t4capgsdvcj04nlfu4zkscekwcfvqrymatqm9lyu0c3g8htzq9k5fzqsrzm24k5jnjmc6w03e5jejc9n0xv3l8c998nesshuvuz2z2gwzqs5mj3830xc42vv0hhg7wxcmyts7td65j3wgxqdmrsjq2wvvrtxuvmt5t49e5s4cyfaqrwrgfdr9yqucsdj9xaunphfs0hpxahz3jfjvt59vuv4ym2rsruf93c09vtavqd0z2sepf0c90myaxy72qawwkm0pwt3w0cmu9m0yfvunvgju65gp5zxlttvu5rfrkweccfrxwxrhew7dntdfvkj5tft3zgk89tu9pmqwdgj706zx0cd95n984f2rlu6gu74lavgh45d7aay3tgafg2wx73zyupftfgdyd4204kfgrnpetqpkxqhx5yxg7vmq3arsl3feufmlcwd4l4zmgsmv40wpetdmjqjasnhhvkey5jresq9wk26zu398pk0vysf80k9z4ep7sjtraccx8zl6s9x68zq3yasy8lxshwh7fs4mwfvzn3yku7yc8lxqnwvtkwlf574vm3739z2npvvztvj63n3g67vh4gp035hmxsgajd0alatkdvsvy5n776jky9y8nsq2fjw9x9xknmxkcsdtydhj20jv4x0qjec058dhkcxttv8zvjaaxhhawwaqe0ka4222qdqvqqqqqqqqqqq6lxex0v4m5y24wyfe2c6h6d3pnug8025k7ngt8zlafmhpz3lf407pjzvhry2r3cyp77zrhxr2ddsyqqa6u6qejf63y54epg9nv02m8lzh3ygg3lvhjftl84ntny4ysjm936edplktejvegwz0yls4d8pg5pqy3naeqxug55rh5uuk3yha9q679jhmvygrnxlkvg3rfgrapet6fs99ndwte93ymusxe4yeg39gcjdl9p70h2z4ffw2nun7kt3mseady844n9f3stxmkyqxu8t72jh0ytqqqqptq77d\n" + "Proof: proof1qyqsqqqqqqqqqqqpqqqqqqqqqqq9k0pqe4avch5kc3qrtu8em2gdlk2gpxcg3vacr97fant2zhyngldw8uh9scre6c4yz0yglfv7excpq9h4avqx9gszgzrpvej5t69tasyv2jq5yhxdcwxeptp2698j6twkv74vq8dkdu93kr03wctmfrmrfqpkqacyqvu50ntv307hd3yh54wfugxuz774ddhhf6hcqyxv6yaprtt22chznm4hfrwvn0cxxmmadwq3ycnd7qmv46zemnt540l63c9h8xgxe4a8l7yyw3qywfml8wye3u28qwn8ed76pgal7qhd4r3nrxcplgulcmz0220fmkkle33wccankrfemkqdc4qv6av9qwmd53zkychlg0jeeqvxfqacp0uvhdt7gffcpp5702gccfhvtrkte6m36qve6w332n43jnpgtkpe8svjq76tyjwq7mh82w7xpjccp3x2nvj3x75lspzwg4rcx9hmfvq66n3usc04cdwjwtxy9mcpr4la5fnfwq9ac0y3rezdj9thr2jmnfqfn7q2gq2qrqxkaa4qu8valaqzsf4kkt287z8qvx8gkzwydf0w88f9gna25fj4cegn3fjj487tlrvqjkruxqay9yql89p5g8ufdxafst4d80cqguzlz2yglw65ac5xpfuctexsnfe334tn2003k8zt8wm6x569wx8695uqhe27x8ts9nra8np3xlvfs26fphs8q6y2fjg95x57cs6z4ja8pgy05alwjm98q44mz5apkuypuz47epp6pqq9hs6fzl05qmty2p3wsz6hcx97xkrupp9ngndvxr8zttasg8e5sf0acencpnqydsg2ct9lqhqdj0r564ywwr6pdgugke2uevrfzavykx8em2y09d6fff0k0zzsyhwtsgpvpsnhwwa4mxnspw09wx8je6vex7gpud6897lhax7fh9gfdtheaejlfvmt93fnnncjnduvc9hg8vp9awms34ua04slpy5vpu98xfnt4murmxusu9ya8cmfvxsv6fe8az0dg2h02xccfamsk7dajrvuxpsxklh5t02ptd3mt6may6rhv8ry0qdyl9jsc00qrp4scya2prew4vmndq9q502zcje5rp6tjhgwrnh5edey2x4lwhfkwzxpm3rsppcnnz5mm67xphfyp9ujjpcwmjkr695jy95uq3eyc42hskp2y0gvqvqqqqqqqqqqpuq3xu4t49yeh8w97dvcya5wtl5959vzplxwmj8k80y9r54qq6jxcxfusf90w7m0pl2zs8qpj9rvsqqza9n9hh8h97kg8967hd0nq4fqvyzquz3agzfjyu32ttqupdza9dpgc9geg6842xxewnd0s6wttpcqq9s6jjtv4l3jlhdmvjz8f27nnmdeyt37zeca94hermruyqhytg0qe2w5xd4lx4agu4ne848luetcsdqza6zvmglvgey9p6gxynhz7j8ywnhsegk0k72xv2rhjgd63e9fqqqq2y2u39\n" ] } ],