3.1.11. aijack.collaborative.splitnn package#

3.1.11.1. Submodules#

3.1.11.2. aijack.collaborative.splitnn.api module#

class aijack.collaborative.splitnn.api.SplitNNAPI(clients, optimizers, dataloader, criterion, num_epoch)[source]#

Bases: aijack.collaborative.core.api.BaseFedAPI

backward(loss)[source]#
backward_gradient(grads_outputs)[source]#
eval()[source]#
forward(x)[source]#
local_train()[source]#
run()[source]#
step()[source]#
train()[source]#
zero_grad()[source]#

3.1.11.3. aijack.collaborative.splitnn.client module#

class aijack.collaborative.splitnn.client.SplitNNClient(model, user_id=0)[source]#

Bases: aijack.collaborative.core.client.BaseClient

distribute()[source]#
download(grad_from_next_client)[source]#

Download the global model from the server.

forward(prev_intermediate)[source]#

Send intermidiate tensor to the server

Parameters

x (torch.Tensor) – the input data

Returns

the output of client-side

model which the client sent to the server

Return type

intermidiate_to_next_client (torch.Tensor)

upload(x)[source]#

Upload the locally learned informatino to the server.

3.1.11.4. Module contents#

class aijack.collaborative.splitnn.SplitNNAPI(clients, optimizers, dataloader, criterion, num_epoch)[source]#

Bases: aijack.collaborative.core.api.BaseFedAPI

backward(loss)[source]#
backward_gradient(grads_outputs)[source]#
eval()[source]#
forward(x)[source]#
local_train()[source]#
run()[source]#
step()[source]#
train()[source]#
zero_grad()[source]#
class aijack.collaborative.splitnn.SplitNNClient(model, user_id=0)[source]#

Bases: aijack.collaborative.core.client.BaseClient

distribute()[source]#
download(grad_from_next_client)[source]#

Download the global model from the server.

forward(prev_intermediate)[source]#

Send intermidiate tensor to the server

Parameters

x (torch.Tensor) – the input data

Returns

the output of client-side

model which the client sent to the server

Return type

intermidiate_to_next_client (torch.Tensor)

upload(x)[source]#

Upload the locally learned informatino to the server.