In the last tutorials, we've been initializing our hook and all of our workers by hand every time. This can be a bit annoying when you're just playing around / learning about the interfaces. So, from here on out we'll be creating all these same variables using a special convenience function.
Person wey translate am:
In [ ]:
import torch
import syft as sy
sy.create_sandbox(globals())
In [ ]:
workers
We go add sometin for the global variables wey we go use right away!
In [ ]:
hook
In [ ]:
bob
In [ ]:
torch.Tensor([1,2,3,4,5])
In [ ]:
x = torch.tensor([1,2,3,4,5]).tag("#fun", "#boston", "#housing").describe("The input datapoints to the boston housing dataset.")
y = torch.tensor([1,2,3,4,5]).tag("#fun", "#boston", "#housing").describe("The input datapoints to the boston housing dataset.")
z = torch.tensor([1,2,3,4,5]).tag("#fun", "#mnist",).describe("The images in the MNIST training dataset.")
In [ ]:
x
In [ ]:
x = x.send(bob)
y = y.send(bob)
z = z.send(bob)
# make we search for exact match for this tag or for the description
results = bob.search(["#boston", "#housing"])
In [ ]:
results
In [ ]:
print(results[0].description)
In [ ]:
grid = sy.PrivateGridNetwork(*workers)
In [ ]:
results = grid.search("#boston")
In [ ]:
boston_data = grid.search("#boston","#data")
In [ ]:
boston_target = grid.search("#boston","#target")
In [ ]: