November 2019
Intermediate to advanced
346 pages
9h 36m
English
The following steps utilize PySyft to simulate a client-server interaction in which the server has a pre-trained deep learning model to be kept as a black box, and the client wishes to use the model to predict on data that is kept private.
import torchimport torch.nn as nnimport torch.nn.functional as Ffrom torchvision import datasets, transforms
import syft as syhook = sy.TorchHook(torch)client = sy.VirtualWorker(hook, id="client")server = sy.VirtualWorker(hook, id="server")crypto_provider = sy.VirtualWorker(hook, id="crypto_provider")
class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.fc1 ...