teaclave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ms...@apache.org
Subject [incubator-mesatee] branch master updated: Implement an example about Logistic Regression in MesaPy (#58)
Date Mon, 18 Nov 2019 21:19:10 GMT
This is an automated email from the ASF dual-hosted git repository.

mssun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mesatee.git


The following commit(s) were added to refs/heads/master by this push:
     new 2adb87f  Implement an example about Logistic Regression in MesaPy (#58)
2adb87f is described below

commit 2adb87f20e6100b99f7632ba5d2a4c0a860ddd98
Author: hi-T0day <zhang_juntao@sjtu.edu.cn>
AuthorDate: Tue Nov 19 05:19:05 2019 +0800

    Implement an example about Logistic Regression in MesaPy (#58)
    
    * implement an example of python logistic regression
    
    * Delete py_file.sh in python logistic regression
    
    * Modify relative file about python logistic regressio modulen
    
    * Modify the MAXPYBUFLEN=20480 in fns module about mesapy
    
    * Add py_logistic_reg part in examples/README
    
    * Add description in py_logistic_reg/Cargo.toml
    
    * Fix a format issue
---
 Makefile.deprecated                                |   2 +-
 examples/README.md                                 |   4 +
 examples/py_logistic_reg/Cargo.toml                |  12 ++
 examples/py_logistic_reg/data/predict.txt          |   5 +
 examples/py_logistic_reg/data/train.txt            | 100 +++++++++++++++
 examples/py_logistic_reg/payload.py                | 141 +++++++++++++++++++++
 examples/py_logistic_reg/py_logistic_reg.sh        |  23 ++++
 examples/py_logistic_reg/py_result.txt             |   1 +
 examples/py_logistic_reg/src/main.rs               |  72 +++++++++++
 .../sgx_trusted_lib/src/trusted_worker/mesapy.rs   |   2 +-
 tests/integration_test.sh                          |   3 +
 toolchain_deps/Cargo.unix_app.toml                 |   1 +
 12 files changed, 364 insertions(+), 2 deletions(-)

diff --git a/Makefile.deprecated b/Makefile.deprecated
index 45adf24..d6d0271 100644
--- a/Makefile.deprecated
+++ b/Makefile.deprecated
@@ -75,7 +75,7 @@ SGX_MODULES := mesatee_services/kms mesatee_services/tdfs mesatee_services/tms
\
 	mesatee_services/fns tests/functional_test
 SGX_LIBS :=
 UNIX_MODULES := integration_test private_join_and_compute quickstart \
-	image_resizing online_decrypt rsa_sign py_matrix_multiply py_file kmeans \
+	image_resizing online_decrypt rsa_sign py_matrix_multiply py_file py_logistic_reg kmeans
\
 	logistic_reg lin_reg svm gen_linear_model gaussian_mixture_model \
 	gaussian_processes dbscan neural_net naive_bayes gbdt mesatee_cli
 UNIX_LIBS := mesatee_sdk protected_fs_rs
diff --git a/examples/README.md b/examples/README.md
index f191009..2cb85ac 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -39,6 +39,10 @@ improvements. Details are discussed
 	  dedicated project called
 [MesaPy](https://github.com/mesalock-linux/mesapy). In this specific example,
 we demonstrate how to invoke the MesaPy engine integrated into MesaTEE.
+* [py_logistic_reg](py_logistic_reg)
+	- MesaTEE supports secondary AI development all in Python with the help of 
+	  MesaPy Engine. Here is an example about logistic regression model 
+	  including training and prediction.
 * [DBSCAN](DBSCAN)
 	- Provides an implementaton of DBSCAN clustering.
 * [Generalized Linear Model](GeneralizedLinearModel)
diff --git a/examples/py_logistic_reg/Cargo.toml b/examples/py_logistic_reg/Cargo.toml
new file mode 100644
index 0000000..334acb2
--- /dev/null
+++ b/examples/py_logistic_reg/Cargo.toml
@@ -0,0 +1,12 @@
+[package]
+name = "py_logistic_reg"
+version = "0.1.0"
+authors = ["MesaTEE Authors <developers@mesatee.org>"]
+description = "Logistic Regression in Python with MesaTEE."
+license = "Apache-2.0"
+edition = "2018"
+
+[dependencies]
+mesatee_sdk = { path = "../../mesatee_sdk" }
+base64 = { version = "0.10.1" }
+lazy_static = { version = "1.3.0" }
diff --git a/examples/py_logistic_reg/data/predict.txt b/examples/py_logistic_reg/data/predict.txt
new file mode 100644
index 0000000..4440050
--- /dev/null
+++ b/examples/py_logistic_reg/data/predict.txt
@@ -0,0 +1,5 @@
+1.5619560125603997,-1.3585291014731475,-1.929064964958864,-0.48811178352065915,-1.6298734512909983,0.8556691653018434,0.3798596856717057,0.5206354603638552,1.4795022936289703,-1.475871675153695,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+0.4317415153486741,-1.2724398149784077,1.2065551475519039,0.30051381061013843,-1.126829867003464,-0.5463861825373719,1.0927733527526797,1.3761579259389451,-1.077581460405606,-0.66117948106943,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+0.1831170075985541,0.8266275084009919,-1.6263223984375375,0.22082406698679818,1.1026886446611233,-1.079671043815752,0.6608823735448814,-0.5931674081381179,0.7960784158847922,-0.5670352239419173,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0
+-1.7258296754127966,0.3190923551324158,-0.07759090516648384,0.47445362292910587,-0.43834833360941045,0.4858568905058413,-1.029447361090786,-0.6760396593910052,-0.9488385062478163,1.7400447870621698,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0
+-1.3273559563065362,1.3048414649869655,-0.5504419191862819,0.48415113906417967,0.6153152869330243,0.5076592437240378,0.9637908015683003,1.0405852286895143,-0.48539483338526546,1.4724927513878685,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0
\ No newline at end of file
diff --git a/examples/py_logistic_reg/data/train.txt b/examples/py_logistic_reg/data/train.txt
new file mode 100644
index 0000000..3f7b546
--- /dev/null
+++ b/examples/py_logistic_reg/data/train.txt
@@ -0,0 +1,100 @@
+1.5619560125603997,-1.3585291014731475,-1.929064964958864,-0.48811178352065915,-1.6298734512909983,0.8556691653018434,0.3798596856717057,0.5206354603638552,1.4795022936289703,-1.475871675153695,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+0.4317415153486741,-1.2724398149784077,1.2065551475519039,0.30051381061013843,-1.126829867003464,-0.5463861825373719,1.0927733527526797,1.3761579259389451,-1.077581460405606,-0.66117948106943,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+0.1831170075985541,0.8266275084009919,-1.6263223984375375,0.22082406698679818,1.1026886446611233,-1.079671043815752,0.6608823735448814,-0.5931674081381179,0.7960784158847922,-0.5670352239419173,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0
+-1.7258296754127966,0.3190923551324158,-0.07759090516648384,0.47445362292910587,-0.43834833360941045,0.4858568905058413,-1.029447361090786,-0.6760396593910052,-0.9488385062478163,1.7400447870621698,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+-1.3273559563065362,1.3048414649869655,-0.5504419191862819,0.48415113906417967,0.6153152869330243,0.5076592437240378,0.9637908015683003,1.0405852286895143,-0.48539483338526546,1.4724927513878685,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0
+-0.9883012866586356,-0.47706900393995083,0.5441840234804988,0.49711453231624636,-1.3185489576551508,0.27718050254541643,-1.4232625219607271,1.0409567228171936,-1.0261730151908213,0.6624908793393907,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0
+0.5290118761178912,0.9837766136100965,1.5678356827607158,-1.5239260559884877,0.9934328056618343,0.2836262080892855,0.13021307317438224,-0.575628974351558,-0.8420896930073243,0.41733033714661494,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0
+-0.4313715348242698,-1.6998330627941716,0.1756964157194881,-0.7269397750911857,-0.7211964702660263,-0.8753480176186667,-1.1826533686279357,0.5028705250762748,1.454493354500663,-0.47972453968731066,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0
+0.38647558978601126,-0.1815522707316249,-1.4743044156087082,1.3832839484636836,-0.41915382826886916,-1.458653687569744,-0.5153279429908125,0.7182516974178286,0.6274516504409945,-1.5073686679010256,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0
+0.33625877509648416,0.46053283851893667,1.4388864282104135,-0.4547119062572154,1.2159635947361702,-1.0006519533124738,0.4309885255553048,0.00915306568136259,-1.02166712637295,0.5208913381447607,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0
+-0.757994463073517,0.08745138696896772,1.6105629968589947,1.1242622335791304,-0.6754776880429879,-0.09922960194138288,0.057717253302562964,0.6123162626263629,1.442390631621617,1.0407711385204896,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0
+-1.1200415534672112,-0.6852905254786092,-0.20497445915062087,0.18239558945274606,-1.3558550800968072,0.09395265237012496,1.1260081537480593,-0.696017400093251,0.5252304069310793,-1.4731347765849505,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0
+-0.4874948679383725,1.6675471089847538,0.8977838865514127,0.32583803532183436,-0.38492666553169863,-1.3177173509036975,1.374584696240998,1.3677481971591732,-1.375879579360442,0.5495552331487632,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0
+1.0709775154130656,1.5814184337427883,1.0262819291702783,-1.1554601686388843,-0.57621648291726,-1.584453283020811,-0.2441161367477059,0.8194973112297457,-0.9182420870548689,-0.1283251834948503,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0
+-1.5418026763241623,-1.094569150305336,0.36701922300105067,-1.3172980124993072,1.4174737664541388,1.4887187467615615,0.9002616262104822,1.5043102897435705,1.4717319397574429,-0.7760214575943337,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+-1.2257999947688072,-0.3228081783963726,-0.5390990987451102,-0.9839997759556336,-0.7100688016525823,-0.3540008399024116,0.229772960006134,0.24493012857326105,0.32272765166077594,0.23420582412510452,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0
+-0.18775501111297793,-0.7515642784993796,1.0669790946389734,-0.3156035113994513,0.46986908910712233,1.3324624586895732,-1.1802497153374736,-0.8305982307632442,-1.672362252650579,0.29306386992935984,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+0.27433889339317596,-1.0591319388250653,-0.38463660145817763,-0.5320216946916236,-1.5399121794242296,-1.8161212688515422,0.5630711926818575,-0.8733081014824631,-0.012161831720661515,-0.4673331814765107,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0
+-0.1533850583236166,-1.077666275996578,-0.8090492558690214,1.1025795528196654,-0.20579472364647028,-1.6703046511262252,-0.29197053631440995,-1.3581878103155631,1.0218675309334293,0.24156767481970123,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0
+-0.26926527700939584,-1.5125452084876998,-1.1327998984231265,-0.468205229445207,-0.1887665023590423,1.6265193779942217,0.4948696630295795,1.116873238584059,-0.8345320972652884,-1.1407833641843934,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0
+0.2138261788807956,1.2854983015148198,0.5866964816744622,-1.5196765932164569,0.803609238555592,1.1668531161529656,-0.6084247934912035,-0.633755367959083,-0.9143291148172691,0.5071169336483407,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0
+0.873644288361191,-0.35188868345220725,-1.4093507015638036,1.470422284526711,0.9138032095465283,-1.9008553024474868,0.9034296070481326,0.0924087522240648,1.4579331704425322,0.9435895420166721,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+-1.5549858451007896,-0.11695937236625653,0.21252918753054328,-1.3691871897517827,-1.184074701322598,-0.33856075441225625,-0.48850605120965523,0.11885469855110212,0.5315867291953816,-1.183290249897471,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0
+-1.419983006393978,-0.26004844939186744,0.21898217577984172,0.03079498154952442,-1.5934085305454742,1.8104161320587027,-0.14180407788131869,0.8044689497447863,1.0066428581322935,0.5126092611479752,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+-1.6995576583327159,0.34855198761393746,-0.4961588067186437,1.465846849919688,1.2218086758169728,0.32765811078693435,0.3543856904287387,-0.07243882553634853,0.12987970508387983,-1.2476518464836943,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0
+0.5097719380585937,-0.3470451821748197,-1.1451699766097556,-1.3841467193318178,0.4265759508025478,-0.24575259076495787,-0.49582796013265296,1.466935970832189,-0.39545455626415826,-1.466649963765446,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0
+0.645881485308668,-0.5779921913716259,0.5180901281784773,1.0654785736873456,-0.9111988438673115,-0.2842673123416376,-0.34202668091415805,0.9745164072521393,1.5435875751789023,-1.6200479723043066,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+1.303220818723531,-1.268098104130051,-1.5092025997535967,0.37330148881781233,-1.6311093476476284,0.7265025899593861,-1.195292153372415,1.592123662238664,-1.3410960780393206,-0.9017363543516728,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0
+-0.26271224827463524,0.5490790358568705,0.6975513230910768,0.5647440482814118,-0.746440660183889,1.2874653045566324,-0.5202793923657159,0.6466854191573799,0.7145269845216994,1.0377183459630899,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0
+0.5554335914997205,0.595459327446735,0.9237019415387836,-1.500055462985303,-1.5987528815197949,-0.33103092638789383,0.8810619246423244,0.3177328125349107,0.24133090388993345,-1.0987519493440863,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+0.6221255420835226,1.5880017059284222,0.09032314402525393,1.5005906516642278,-0.05463807418486889,0.33239606621310336,-0.7110597806985647,-1.405059791111007,1.0600230778470683,-1.2945107814532033,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0
+-0.2204761592243881,-0.9367311890930937,0.043425871767032054,0.718466982589775,1.4313585080111781,-0.4202415238395203,-1.2909160226895215,-1.682105739622478,0.6625522784634186,-0.07258080004448254,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+-1.0074337060782166,-1.4758669807357883,1.3653669065940568,-1.2462525593804834,-0.626066718218894,-0.428172246028875,1.2371880362305085,0.6849403186555204,1.4867589702994584,0.41918277985608654,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+0.9957104515085553,-1.135510420748069,1.1604582591222115,1.1092714579807388,1.5934412421270745,0.5316083145641264,1.6883103832764252,0.5307362849076164,-1.275184064837613,-0.08713220682451399,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+1.0515872037955,-1.620914361980279,-0.45566691660250164,1.5606009975577397,-0.45964848312984513,1.489422118447278,0.09044580653777315,0.5082032746902106,-0.9504784556529615,-1.5774198655267755,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+0.6423896693150641,1.6238608345676404,0.2132202653226597,-0.20088438348250195,1.363646884941679,0.6759637239575708,1.41328908941196,-0.9389878391075018,0.29026752386335447,1.3259579217259994,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+-1.5834943176444531,-0.05314149324764772,-0.43484182975735836,-0.49628177463172524,0.8532415601856883,-0.6900651206131041,-0.6551170838086202,0.13073706475012592,-0.6492229103083185,1.7018625475084714,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0
+1.257724446981226,-0.7177577830090236,1.5509615926218707,-1.3627883411872574,1.3024770109222976,-0.2189252590602529,-1.483742430751049,1.203874725915931,-1.0735063245240573,0.10472220333102128,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0
+-1.479168662124649,-0.4159727871571659,0.8818369119078387,-0.9223701258811609,1.5148458591371876,1.097123368875702,0.8626771677148857,1.3469985675509595,0.910884633150514,-0.7305001328956676,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+1.5347168995950118,0.9989523543347506,-1.2168904613050138,1.418855557773109,0.09623472447517623,-0.4721751885185601,-1.3726813086713063,-0.8105097492701564,-1.5339455159129691,0.15155501811596572,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0
+1.0425958375196869,0.003499243776820816,1.5235354847527323,0.5792060391901585,1.4431465419364784,0.16695692454113797,1.0481036369522965,-0.6146615117449634,-1.1282460844650979,1.0013029911796152,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0
+1.2733007542869652,0.06321892191829771,1.3325870543113367,-0.8763089078945544,-0.41938809226490953,-0.026325450355122737,0.16614214705334548,-0.5610058853159452,-1.3961696117291809,-1.128802631071363,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0
+-0.420087172321165,-1.550264593500241,-0.5889633140847907,-1.1004481938568254,-1.2866555606232082,-0.2888975659972951,-1.3806212481067521,1.3855706526908251,0.4743631972759521,0.5890934854869816,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+0.85675665837349,1.3272439776028302,-1.254865194973406,0.72296715265505,0.27025565190428574,-0.415390294759455,0.611397320328051,-0.36847287672184287,-1.3099133031595283,0.7067012008377344,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0
+1.5030529881655397,-0.6208386220973888,-0.6718772401967547,-0.40512233439794215,-0.44579975958425744,-1.500558153558061,1.7925251889984546,1.0092150793998278,-0.9852830376703399,-1.484560284778115,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+-0.22362902031662157,-0.2926963152377163,0.9331020799800616,-0.9391409551154382,0.021920808221342535,1.3353199337997503,-0.9749588959496317,0.07563820113861872,-0.24137025515960855,-1.0618709025112576,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+-0.5944292542696287,-0.8915132120692064,-0.9254189465197484,-0.6264901074506388,-0.26292168030037727,1.4683667035335835,1.0759004994877488,0.7380605496177826,-0.36860504952401285,-0.5506409335881159,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0
+0.8537447363294065,0.8798007026145933,-0.48514581336932877,-1.134264775267038,0.05801235465795603,0.5783675727058541,-0.8685733060389305,1.265167203831612,1.3517663777398263,1.355501192567533,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+0.7551830293557233,0.3197905211146069,-0.21407199061285484,-1.003490464319007,0.11158805693638536,1.6118646162135557,0.7111172519773412,-0.30814841285306,-0.5974663417948856,0.8688577764348161,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+-1.0548078499690783,0.7909135680370112,-1.6508410405591218,0.7292658954754563,1.1345976320054458,-0.4623974143225602,0.8867987191790183,1.0839054366182859,1.559723953816586,1.6515953398730558,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0
+1.630030032252656,-1.36461742820237,-1.4453672759255254,0.010468710320240557,-1.6620232855831527,-0.2533633421343047,-1.1647942177761776,0.5662846148142459,-1.560419162712323,-0.7686223003700122,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+-0.7506403483754214,0.9009045432294974,-0.18826852856871912,-1.145829425413356,-1.3954088733289696,-0.09887986069176033,1.4944948509222435,-0.4143207543863763,0.762510175797599,-0.2548202356101859,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,1.0
+0.3244506443144471,1.2474299410658407,0.9780784861714904,-0.6719247620309636,-0.4433978075827382,0.5051262200900215,-0.6502977173592606,-1.0741526200412421,-1.7206068717557093,-1.6155286903747088,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0
+-0.9875699099979149,-0.6956522932605723,-1.8659814199727833,0.9758574783018842,0.8402186161554617,-0.8713056532031304,-1.1002293328644184,0.7198150907222735,-0.03773982987452305,0.8241563988489594,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0
+-0.0484014342057765,-1.0189318526973832,0.9029990926018443,1.3882539021011122,-0.8816806927610685,-1.1812404247098574,-1.0309350974211824,-1.0418992060370382,1.2477247909306985,-1.187023186117969,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+0.008100479926357283,-1.6506037822170958,-0.6977293376195807,1.213938787618817,0.7594965398060494,1.7225337052352654,-0.754742224526368,-0.6823456807178123,-0.9654158848254035,1.3514311774450873,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0
+1.4437291371749812,0.8753989760452418,1.5804884642616213,-0.8153558184011129,0.8694729102031898,-0.01648120256256848,-0.06339213279018799,-0.020291530244397067,-0.1438287512511335,1.329048345402034,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0
+-1.5962763116322953,1.1730778650668248,-1.0800255329082815,-1.3418943949206894,0.061457677212943235,0.0684011430479774,1.6336900922154782,1.1941660958148552,0.40459536267856955,-1.606633279506196,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0
+-0.5636122280405349,-0.8722133624848291,0.5292973378000551,0.868023519641998,-1.3210650821110628,0.41894022330386527,1.2889103112984004,-1.591396834485353,-0.20382633862060462,0.7331197005033193,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,1.0
+-0.2556728833296065,0.9840133222051575,1.109971712712083,-0.8294780167631746,1.496487300286894,-1.524226735080367,1.5816938358006805,-1.6980526700169958,-0.5702678688237703,0.3946526939858869,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0
+0.8855997006980469,0.9836691026541994,0.710739983292258,-1.1190560873710156,-0.17705386664106304,-1.4204978580290066,1.6899468002620135,0.4867481352003576,1.3183893486623495,0.19554896116325862,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0
+0.8571963592780125,1.287836293046851,1.0725145049024996,0.544410437796583,0.5462619213700666,-1.3689697788309116,-0.5524107157046912,-0.4099252235850663,-0.7643824034546367,0.0973524162980443,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+-1.636382812958107,1.1697300862695208,1.3911663258878524,-0.8855556603842554,-0.9452519538643129,-1.266528897352265,0.9643075378166076,-1.1535851229890866,0.19394250360598564,-0.12837312887437477,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0
+-1.2520823181382916,-1.2499188708639464,1.405362376331709,0.0969927497047017,1.3014499092415284,0.8939364066286227,1.762822461719236,-0.1926534786406653,1.5183808218406472,-0.48822205285691306,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+-0.28760644493772347,0.6877754724422088,1.0222304241468174,-0.5291228317396881,-1.0793576887043177,0.8991858433377214,-1.4777384448745907,0.5210834962129764,0.2601175232935592,1.402628800618264,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0
+-0.5488527635667897,-0.11559509849653617,-1.5485554868606417,0.9738631398270009,-1.450374930625399,0.7226145527960279,-0.9807412722495561,-0.6180645325962352,0.9199527257094988,0.5425982445477573,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0
+1.2727624612468151,-1.4040560770531023,-0.24131323009211128,1.1665108454961655,1.0952028730758663,0.9956944862769426,-1.2219496533549847,0.4411618746069493,1.1217059030980205,-0.38173187168800715,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0
+-1.5702964613209647,0.15411492175397473,-0.5745907394800686,-1.4976793906439374,0.3861815275210276,-0.09888055068275678,1.3577185441602604,1.4374222572696884,0.02510216621380471,-1.6575523452381782,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0
+0.20525432091286683,0.005553199223743193,0.13111050849624656,-0.5283591539076101,1.582984033155931,-0.5775158251948188,-1.5074376670745664,-1.4778183964185712,0.2289045678744767,0.248829180142186,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0
+-0.6304222113006505,-1.5880159344525129,1.3935128811665043,-0.3402514215523758,-0.3311340059148066,0.8543409188777636,-0.24953379581063206,1.702441295352902,0.3174371472944516,-1.1718275236806854,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0
+-0.5137018909966644,0.45106830282414584,-0.5405118287560954,-1.0471664661200004,0.5863500779400185,0.8225436774784408,1.084217518668952,0.1821820693270858,-1.4824734946423905,0.34805239316894987,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0
+-1.1634208267023705,0.13384071398547687,0.6623744145220034,-1.4731315144368424,1.3815459590375399,0.7287860946449933,-0.7549189831804488,-0.5474298268787956,0.21178845450057807,1.4406406568093144,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+0.4852242305739518,1.3182826234928866,-0.8088280058771944,0.3713430313502879,-0.9984550939776056,-1.422461924611811,-0.3450184347344565,-0.6849206903909003,-1.4306627726413976,0.5910903081804576,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0
+-0.040118704381414294,-0.4493873195990256,-1.2527073059973837,-1.063208807126096,1.4756010830047621,0.3193978089951104,1.5934129853718615,-1.757980537429635,0.31883275300786335,1.5573396146111151,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0
+-0.09753126519078774,0.6928349573450631,-1.5749293288509048,0.1900091653648595,0.7279016460240764,0.05988211683813188,0.6152039155132741,1.581588223981373,1.424906306280968,0.1250456455520284,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0
+-1.0181316991114042,0.38341756920918274,0.17292250330718237,1.411809611102773,1.0818163783848334,1.39065983558992,-0.9879297917129046,0.5689271433858472,-1.1124631353618775,1.5917066658438102,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0
+1.633055447693917,-0.7486474095044605,-1.5616925274437603,1.1807753006178878,0.518268176544498,1.2850349807971961,1.2254854821322203,-1.575934424782461,-0.8176724186905255,-0.48774244663023264,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0
+-0.9230188436740355,0.8116143332717559,-1.3014016639464359,-0.34140964243832195,-1.049268488024348,-0.9450818056049377,1.25926656840282,0.05479916712670453,1.5322586746753877,0.8677519342370846,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+1.2430350580875542,-1.0619528369102549,-0.07792548552147764,-1.4586252144217344,0.5350608015206678,1.7523112281524915,-1.2637678560533332,-0.563782242609647,0.800454974487186,1.2817816290902493,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0
+-1.7897122854423342,1.6866974189390076,-0.02075959180818841,-1.4896260381820219,-1.643841402100641,-0.2877655971937084,0.19124469800747584,-1.310647075699285,-0.09267182815399932,0.3803390238871754,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0
+-1.0007234979076967,0.6239615460517597,0.7556876859723138,1.3637206457319135,0.14615198878816843,0.25397153920189,-0.10045900961207746,1.3621620526600458,-1.6221253973522465,-1.2568124875182751,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0
+-0.8987606447326303,0.5408596208670771,-1.9144115611090229,0.6303520790560548,0.3956377954752495,1.3614255748225137,1.42454236524759,0.2599507989251022,0.8987884455151527,0.9021460389093101,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0
+1.198227376973283,0.1800562984339008,-0.6053407281672172,0.7288949091435942,0.014529357941625276,-0.4896962925086329,-1.1503881320340867,1.2306973485831343,1.546217440457115,-0.8271036831278642,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+1.147486421259352,-0.11188440198422588,1.2075175966334917,1.2431265669401883,0.5283740434638589,-1.014817144429933,-0.7120315776495064,0.6832109509757617,-0.32657051350087346,-0.005888152479460462,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0
+0.11593433595020218,-0.8463238011366493,0.6198272063528166,1.075188716343682,-0.07482723343057754,1.7429150422817488,-1.3450262467491867,-1.3532044099885503,-0.20541217592123326,1.64453494323622,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
+-0.09216522076898116,-1.085713536923351,-0.402989678856182,1.3492165518839314,0.37036713590712994,-1.1010658325172666,-0.8839362982351464,1.6561448231282316,0.7115363417357379,-1.3753178547476452,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0
+-1.0248822808685318,-0.8842408915500893,-1.2198608711226842,0.9533824088776033,1.0239658588119447,1.0534950372848555,0.8696775204055233,-1.151542127140379,0.6993336007002287,0.7604028113792899,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0
+-0.4317893164470922,1.4765272907297384,0.9458036948142066,0.6795682310295768,1.6260278288797434,1.330704116554391,-0.5052640609680907,0.9042512199828961,-0.9200310218624196,-0.8808170005614734,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+1.3084986824529188,-0.5697037229816664,-0.6878312992084499,-1.2932037183907192,-0.5610938744583089,-0.5858854895810732,1.265224363540798,-0.5324987075153558,0.2922634797233818,-0.7887853576005875,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0
+1.529183743117623,0.9563679497798458,0.7706889753444235,0.48568060553010683,-1.4769598466388378,-1.4004070433791336,-0.8121163942895684,-0.9166867546976751,0.6860418139737939,1.7087689922122333,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0
+0.1977654203559811,-0.6364254039923355,1.4089567433215546,0.8557816683131975,0.9235997029420102,-1.7049839554312145,-0.6971243318754867,-1.3905389179237437,-0.24536500690713917,0.9473287524999536,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+-1.5305905111516307,1.6478208460807835,-0.2741316011535213,-1.1729673179610418,-1.3559227742411755,-0.9917549238452041,-0.4043197263604878,0.2959552937010735,1.3275149762635068,-1.5657510927073977,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0
+0.11970244545134008,-1.617314784924177,0.418800066481392,1.5130357807760728,1.5950217379263767,-0.8943556700514398,-1.4924944131644076,-1.7123721851530775,0.8552651351449608,0.7670083629866711,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0
+-0.271398649641796,1.5948408955210356,-0.6262686253274706,1.263897341968114,-0.3440675683199049,-0.5889079668523304,-0.11825131388853188,-0.14095509820324764,-0.02218788074648131,-0.3880609769342706,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0
+1.6126098009876082,1.327462691438375,-0.40526113902386657,0.5491124153536424,-0.8857931324925802,0.0016925317022039375,-1.2484895215456169,-1.6486238230932326,-1.1944702065351958,-0.06273230877417826,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0
+-0.22488031091300836,-1.1714751563844652,0.0571078321307184,1.0802183424645875,0.7836556441110707,0.24642214123850956,-1.4992445969886365,-0.9759745243452184,-0.5903566727777004,0.3853794657462495,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0
+1.397404122635458,1.2888238171486681,1.3966149099062282,-1.3208341800471708,0.48627990791259496,-1.280142059848388,0.00734377666130651,-0.5583784701042198,-1.4256796916109766,-1.3407054170001156,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0
+0.8825015989752106,-0.3609970304651066,-0.6964254732258737,-0.6191790786776985,-1.047859336220384,1.2293140635137905,0.20542418830687662,-1.537948933474376,1.5365765681106238,-0.626890789527878,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0
+0.6839625867101362,0.48407124331051044,0.06389409555185667,1.4621444263568015,-1.3873414442293417,-0.15694494595497094,-0.6076640510038883,0.8074722391032636,-1.2363793895024608,0.05338606562467698,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,1.0
+1.4395462205198315,0.9566995136474037,-0.06196444179712549,0.006238880341787953,-0.4914247839736721,-0.8489453667496505,0.4373121377962489,-1.7755058937121666,-0.6576419117907626,0.5280170116079959,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0
diff --git a/examples/py_logistic_reg/payload.py b/examples/py_logistic_reg/payload.py
new file mode 100644
index 0000000..83a2c0c
--- /dev/null
+++ b/examples/py_logistic_reg/payload.py
@@ -0,0 +1,141 @@
+import mesatee
+from ffi import ffi
+import _numpypy as np
+import marshal
+
+
+def read_file_train(context_id, context_token, file_id):
+    content = mesatee.mesatee_read_file(context_id, context_token, file_id)
+    featureData=[]
+    labelData=[]
+    lines = content.strip().split('\n')
+    for line in lines:
+        line = line.strip().split(',')
+        featureData.append(line[:-1])
+        labelData.append(line[-1])
+    label = np.multiarray.array(labelData, dtype='float64').reshape(-1,1)
+    feature = np.multiarray.array(featureData, dtype='float64')
+    return feature, label
+
+def read_file_predict(context_id, context_token, file_id, params_id, scaler_id):
+    params = mesatee.mesatee_read_file(context_id, context_token, params_id) 
+    scaler = mesatee.mesatee_read_file(context_id, context_token, scaler_id)
+    params = marshal.loads(params)
+    scaler = marshal.loads(scaler)
+    content = mesatee.mesatee_read_file(context_id, context_token, file_id)
+    featureData=[]
+    labelData=[]
+    lines = content.strip().split('\n')
+    for line in lines:
+        line = line.strip().split(',')
+        featureData.append(line)
+
+    feature = np.multiarray.array(featureData, dtype='float64')
+    return feature, params, scaler
+
+def save_model(context_id, context_token, params, scaler):
+    params = marshal.dumps(params)
+    scaler = marshal.dumps(scaler)
+    params_saved_id = mesatee.mesatee_save_file_for_task_creator(context_id, context_token,
params)
+    scaler_saved_id = mesatee.mesatee_save_file_for_task_creator(context_id, context_token,
scaler)
+    return params_saved_id, scaler_saved_id
+
+
+def minmaxscaler_train(input_array):
+    array_max = input_array.max(0)
+    array_min = input_array.min(0)
+    scaler = {
+        "max": array_max,
+        "min": array_min
+    }
+    input_array = (input_array - array_min) / (array_max - array_min)
+    return input_array, scaler
+
+def minmaxscaler_predict(input_array, scaler):
+    array_max = np.multiarray.frombuffer(scaler["max"])
+    array_min = np.multiarray.frombuffer(scaler["min"])
+    input_array = (input_array - array_min) / (array_max - array_min)
+    return input_array 
+
+
+def sigmoid(z):
+    a = 1/(1+np.umath.exp(-z))
+    return a
+
+def initialize_with_zeros(dim):
+    w = np.multiarray.zeros((dim,1))
+    b = 0
+    return w,b
+
+def propagate(w, b, X, Y):
+    m = X.shape[1]
+    A = sigmoid(w.T.dot(X) + b)  
+    cost = -((Y * np.umath.log(A) + (1-Y) * np.umath.log(1-A)).sum())/m  
+
+    dZ = A-Y  
+    dw = (X.dot(dZ.T))/m
+    db = (dZ.sum())/m
+
+    grads = {"dw": dw,
+             "db": db}
+    return grads, cost
+
+def optimize(w, b, X, Y, num_iterations, learning_rate):
+    costs = []
+    for i in range(num_iterations):
+        grads, cost = propagate(w,b,X,Y)
+        dw = grads["dw"]
+        db = grads["db"]
+        w = w - learning_rate*dw
+        b = b - learning_rate*db
+    params = {"w": w,
+              "b": b}
+    return params
+
+
+def logistic_model(feature, label, learning_rate=0.1, num_iterations=2000):
+    dim = feature.shape[0]
+    w,b = initialize_with_zeros(dim)
+
+    params = optimize(w,b,feature,label,num_iterations,learning_rate)
+
+    return params
+
+def logistic_predict(feature, params):
+    w = np.multiarray.frombuffer(params['w'])
+    b = np.multiarray.frombuffer(params['b'])
+    m = feature.shape[1]
+    prediction = np.multiarray.zeros((1,m))
+
+    A = sigmoid(w.T.dot(feature) + b) 
+    for i in range(m):
+        if A[i]>0.5:
+            prediction[0,i] = 1
+        else:
+            prediction[0,i] = 0
+
+    return prediction
+
+
+def train(context_id, context_token, file_id):
+    feature, label = read_file_train(context_id, context_token, file_id)
+    feature, scaler = minmaxscaler_train(feature)
+    feature = feature.T
+    label = label.T
+    params = logistic_model(feature, label, num_iterations = 2000, learning_rate = 0.05)
+    params_saved_id, scaler_saved_id = save_model(context_id, context_token, params, scaler)
+    return params_saved_id, scaler_saved_id
+    
+def predict(context_id, context_token, file_id, params_id, scaler_id):
+    feature, params, scaler = read_file_predict(context_id, context_token, file_id, params_id,
scaler_id)
+    feature = minmaxscaler_predict(feature, scaler)
+    feature = feature.T
+    prediction = logistic_predict(feature, params)
+    return prediction
+
+
+def entrypoint(argv):
+    context_id, context_token, train_file_id, predict_file_id = argv
+    params_saved_id, scaler_saved_id = train(context_id, context_token, train_file_id)
+    prediction = predict(context_id, context_token, predict_file_id, params_saved_id, scaler_saved_id)
+    return str(prediction)
diff --git a/examples/py_logistic_reg/py_logistic_reg.sh b/examples/py_logistic_reg/py_logistic_reg.sh
new file mode 100755
index 0000000..39eac28
--- /dev/null
+++ b/examples/py_logistic_reg/py_logistic_reg.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 &&
pwd )"
+BIN_DIR=$SCRIPT_DIR/../../bin
+BIN=./py_logistic_reg
+cd $BIN_DIR
+
+PY_SCRIPT=$SCRIPT_DIR/payload.py
+RESULT_PATH=/tmp/py_result.txt
+GROUND_TRUTH=$SCRIPT_DIR/py_result.txt
+
+# check ports
+for port in 5554 5555 3444 6016 5065 5066; do
+    if ! lsof -i :$port > /dev/null; then
+        echo "[-] port $port is not open"
+        echo "[-] please run service.sh start|restart to launch services"
+        exit 1
+    fi
+done
+
+RESULT=`$BIN $PY_SCRIPT`
+DECODE_RESULT="import marshal; print($RESULT)" 
+python -c "$DECODE_RESULT" > $RESULT_PATH # result is in Python marshal format
+cmp $RESULT_PATH $GROUND_TRUTH && echo "Python Execution Successful" || exit 1
diff --git a/examples/py_logistic_reg/py_result.txt b/examples/py_logistic_reg/py_result.txt
new file mode 100644
index 0000000..d30508f
--- /dev/null
+++ b/examples/py_logistic_reg/py_result.txt
@@ -0,0 +1 @@
+[1.0 1.0 0.0 0.0 0.0]
diff --git a/examples/py_logistic_reg/src/main.rs b/examples/py_logistic_reg/src/main.rs
new file mode 100644
index 0000000..b1e60bb
--- /dev/null
+++ b/examples/py_logistic_reg/src/main.rs
@@ -0,0 +1,72 @@
+// Copyright 2019 MesaTEE Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+use lazy_static::lazy_static;
+use mesatee_sdk::{Mesatee, MesateeEnclaveInfo};
+use std::net::SocketAddr;
+use std::{env, fs};
+
+static FUNCTION_NAME: &str = "mesapy_from_buffer";
+static USER_ID: &str = "uid";
+static USER_TOKEN: &str = "token";
+
+lazy_static! {
+    static ref TMS_ADDR: SocketAddr = "127.0.0.1:5554".parse().unwrap();
+    static ref TDFS_ADDR: SocketAddr = "127.0.0.1:5065".parse().unwrap();
+}
+
+fn main() {
+    let auditors = vec![
+        (
+            "../auditors/godzilla/godzilla.public.der",
+            "../auditors/godzilla/godzilla.sign.sha256",
+        ),
+        (
+            "../auditors/optimus_prime/optimus_prime.public.der",
+            "../auditors/optimus_prime/optimus_prime.sign.sha256",
+        ),
+        (
+            "../auditors/albus_dumbledore/albus_dumbledore.public.der",
+            "../auditors/albus_dumbledore/albus_dumbledore.sign.sha256",
+        ),
+    ];
+    let enclave_info_file_path = "../out/enclave_info.txt";
+    let info = MesateeEnclaveInfo::load(auditors, enclave_info_file_path).unwrap();
+
+    let args_string: Vec<String> = env::args().collect();
+    let args: Vec<&str> = args_string.iter().map(|s| s.as_str()).collect();
+    if args.len() < 2 {
+        println!("Please specify the python script");
+        return;
+    }
+    let py_script_path = args[1];
+    let py_script = fs::read(py_script_path).unwrap();
+    let request = base64::encode(&py_script);
+
+    let mesatee = Mesatee::new(&info, USER_ID, USER_TOKEN, *TMS_ADDR, *TDFS_ADDR).unwrap();
+    let train_file_id = mesatee
+        .upload_file("../examples/py_logistic_reg/data/train.txt")
+        .unwrap();
+    let predict_file_id = mesatee
+        .upload_file("../examples/py_logistic_reg/data/predict.txt")
+        .unwrap();
+
+    let file_ids: [&str; 2] = [train_file_id.as_str(), predict_file_id.as_str()];
+
+    let task = mesatee
+        .create_task_with_files(FUNCTION_NAME, &file_ids)
+        .unwrap();
+    let result = task.invoke_with_payload(&request).unwrap();
+    println!("{}", result);
+}
diff --git a/mesatee_services/fns/sgx_trusted_lib/src/trusted_worker/mesapy.rs b/mesatee_services/fns/sgx_trusted_lib/src/trusted_worker/mesapy.rs
index e923484..c1c999c 100644
--- a/mesatee_services/fns/sgx_trusted_lib/src/trusted_worker/mesapy.rs
+++ b/mesatee_services/fns/sgx_trusted_lib/src/trusted_worker/mesapy.rs
@@ -23,7 +23,7 @@ use sgx_types;
 use std::ffi::CString;
 use std::{format, vec};
 
-const MAXPYBUFLEN: usize = 1024;
+const MAXPYBUFLEN: usize = 20480;
 const MESAPY_ERROR_BUFFER_TOO_SHORT: i64 = -1i64;
 const MESAPY_EXEC_ERROR: i64 = -2i64;
 
diff --git a/tests/integration_test.sh b/tests/integration_test.sh
index e625c7a..6b17e93 100755
--- a/tests/integration_test.sh
+++ b/tests/integration_test.sh
@@ -70,6 +70,9 @@ echo "[+] run rsa_sign"
 echo "[+] run py_matrix_multiply"
 ../examples/py_matrix_multiply/py_matrix_multiply.sh 2>&1 | tee py_matrix_multiply.log
 [ ${PIPESTATUS[0]} -eq 0 ] || exit ${PIPESTATUS[0]}
+echo "[+] run py_logistic_reg"
+../examples/py_logistic_reg/py_logistic_reg.sh 2>&1 | tee py_logistic_reg.log
+[ ${PIPESTATUS[0]} -eq 0 ] || exit ${PIPESTATUS[0]}
 echo "[+] run py_file"
 ../examples/py_file/py_file.sh 2>&1 | tee py_file.log
 [ ${PIPESTATUS[0]} -eq 0 ] || exit ${PIPESTATUS[0]}
diff --git a/toolchain_deps/Cargo.unix_app.toml b/toolchain_deps/Cargo.unix_app.toml
index a1b28a2..7d6f5ed 100644
--- a/toolchain_deps/Cargo.unix_app.toml
+++ b/toolchain_deps/Cargo.unix_app.toml
@@ -13,6 +13,7 @@ members = [
   "examples/rsa_sign",
   "examples/py_matrix_multiply",
   "examples/py_file",
+  "examples/py_logistic_reg",
   "examples/kmeans",
   "examples/logistic_reg",
   "examples/lin_reg",


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@mesatee.apache.org
For additional commands, e-mail: commits-help@mesatee.apache.org


Mime
View raw message