पिछले विश्लेषकों में, हम हर बार अपने हुक और अपने सभी श्रमिकों (workers) को हाथ से शुरू कर रहे हैं। यह थोड़ा परेशान करने वाला हो सकता है जब आप सिर्फ हस्तक्षेप के आसपास खेल रहे हों / सीख रहे हों। इसलिए, यहां से हम एक विशेष सुविधा का उपयोग करके इन सभी समान चर को बनाएंगे।
अनुवादक - nbTranslate
संपादक - Urvashi Raheja - Github: @raheja
In [ ]:
import torch
import syft as sy
sy.create_sandbox(globals())
जैसा कि आप ऊपर देख सकते हैं, हमने कई आभासी श्रमिकों को बनाया और बहुत सारे टेस्ट डेटासेट में लोड किया, उन्हें विभिन्न श्रमिकों (workers) के आसपास वितरित किया ताकि हम गोपनीयता संरक्षण तकनीकों जैसे फेडरेटेड लर्निंग का उपयोग करके अभ्यास कर सकें।
हमने छह कार्यकर्ता (workers) बनाए ...।
In [ ]:
workers
हमने बहुत सारे वैश्विक चरों को भी आबाद किया है जिसका हम तुरंत उपयोग कर सकते हैं!
In [ ]:
hook
In [ ]:
bob
In [ ]:
torch.Tensor([1,2,3,4,5])
In [6]:
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)
#यह एक टैग के भीतर या विवरण के भीतर सटीक मिलान के लिए खोज करता है
results = bob.search(["#boston", "#housing"])
In [ ]:
results
In [ ]:
print(results[0].description)
In [11]:
grid = sy.PrivateGridNetwork(*workers)
In [ ]:
results = grid.search("#boston")
In [ ]:
boston_data = grid.search("#boston","#data")
In [ ]:
boston_target = grid.search("#boston","#target")
In [ ]: