Skip to content

Commit

Permalink
Merge branch 'master' of github.com:LatticeX-Foundation/Rosetta
Browse files Browse the repository at this point in the history
  • Loading branch information
joyoFeng committed Jul 30, 2021
2 parents f90acf1 + d698a86 commit ccbf79a
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 13 deletions.
2 changes: 2 additions & 0 deletions python/latticex/rosetta/test/spass/test_di.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@
print("Fail")


rtt.deactivate()

Writer = tf.summary.FileWriter("log/di", tf.get_default_graph())
Writer.close()
4 changes: 2 additions & 2 deletions python/latticex/rosetta/test/spass/test_graph_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


# rtt.set_backend_loglevel(0)

rtt.activate("SecureNN")
X = tf.Variable([[2., 3.], [4., 5.]], tf.float64, name="x")
Y = tf.Variable([[1.], [1.]], tf.float64, name="y")
W = tf.Variable(tf.zeros([2, 1], dtype=tf.float64), name="w")
Expand Down Expand Up @@ -39,7 +39,7 @@
print("Fail")



rtt.deactivate()

Writer = tf.summary.FileWriter("log/graph_opt", tf.get_default_graph())
Writer.close()
4 changes: 2 additions & 2 deletions python/latticex/rosetta/test/spass/test_graph_opt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


# rtt.set_backend_loglevel(0)

rtt.activate("SecureNN")
X = tf.Variable([[2., 3.], [4., 5.]], tf.float64, name="x")
Y = tf.Variable([[1.], [1.]], tf.float64, name="y")
W = tf.Variable(tf.zeros([2, 1], dtype=tf.float64), name="w")
Expand Down Expand Up @@ -41,7 +41,7 @@
print("Fail")



rtt.deactivate()

Writer = tf.summary.FileWriter("log/graph_opt2", tf.get_default_graph())
Writer.close()
2 changes: 1 addition & 1 deletion python/latticex/rosetta/test/spass/test_graph_opt3.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
print("Fail")



rtt.deactivate()

Writer = tf.summary.FileWriter("log/graph_opt3", tf.get_default_graph())
Writer.close()
Expand Down
2 changes: 1 addition & 1 deletion python/latticex/rosetta/test/spass/test_iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@
print("Fail")



rtt.deactivate()
Writer = tf.summary.FileWriter("log/iter", tf.get_default_graph())
Writer.close()
5 changes: 5 additions & 0 deletions python/latticex/rosetta/test/spass/test_iter2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
with_index = False
batch_size = 2

rtt.activate("SecureNN")

def decode(line):
fields = tf.string_split([line], ',').values
if with_index: # Skip index
Expand Down Expand Up @@ -54,5 +56,8 @@ def decode(line):
except:
print("Fail")


rtt.deactivate()

Writer = tf.compat.v1.summary.FileWriter("log/iter2", tf.compat.v1.get_default_graph())
Writer.close()
4 changes: 2 additions & 2 deletions python/latticex/rosetta/test/spass/test_mpc_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np



rst.activate("SecureNN")
X = tf.placeholder(tf.float64, [2])
print(X)
Y = tf.Variable(tf.ones([2], dtype=tf.float64))
Expand All @@ -29,6 +29,6 @@
print("Fail")



rst.deactivate()
Writer = tf.summary.FileWriter("log/feed", tf.get_default_graph())
Writer.close()
4 changes: 2 additions & 2 deletions python/latticex/rosetta/test/spass/test_mpc_feed2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np



rst.activate("SecureNN")
X = tf.placeholder(tf.float64, [2, 2])
Y = tf.placeholder(tf.float64, [2, 1])

Expand Down Expand Up @@ -43,6 +43,6 @@
print("Fail")



rst.deactivate()
Writer = tf.summary.FileWriter("log/feed2", tf.get_default_graph())
Writer.close()
3 changes: 2 additions & 1 deletion python/latticex/rosetta/test/spass/test_mpc_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import latticex.rosetta as rst


rst.activate()
X = tf.Variable(1.0, name='x')
Y = tf.Variable(2.0, name='y')
Z = tf.multiply(X, Y)
Expand All @@ -19,7 +20,7 @@
print("Fail")



rst.deactivate()
Writer = tf.summary.FileWriter("log/pridict", tf.get_default_graph())
Writer.close()

Expand Down
3 changes: 2 additions & 1 deletion python/latticex/rosetta/test/spass/test_mpc_reveal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import latticex.rosetta as rst


rst.activate("SecureNN")
xa = tf.Variable(
[
[1.892, 2],
Expand Down Expand Up @@ -35,6 +36,6 @@
print("Fail")



rst.deactivate()
Writer = tf.summary.FileWriter("log/reveal", tf.get_default_graph())
Writer.close()
3 changes: 2 additions & 1 deletion python/latticex/rosetta/test/spass/test_node_dup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import numpy as np
np.set_printoptions(suppress=True)


rtt.activate("SecureNN")
xa = tf.Variable(
[
[1.892, 2],
Expand Down Expand Up @@ -58,5 +58,6 @@
print("Fail")


rtt.deactivate()
Writer = tf.summary.FileWriter("log/node_dup", tf.get_default_graph())
Writer.close()

0 comments on commit ccbf79a

Please sign in to comment.