2.1.9. aijack.defense.sparse package#

2.1.9.1. Submodules#

2.1.9.2. aijack.defense.sparse.topk module#

class aijack.defense.sparse.topk.SparseGradientClientManager(*args, **kwargs)[source]#

Bases: aijack.manager.base.BaseManager

Client-side Manager for sparse gradients.

attach(cls)[source]#
class aijack.defense.sparse.topk.SparseGradientServerManager(*args, **kwargs)[source]#

Bases: aijack.manager.base.BaseManager

Server-side Manager for sparse gradients.

attach(cls)[source]#
aijack.defense.sparse.topk.attach_sparse_gradient_to_client(cls, k)[source]#

Make the client class communicate the sparse gradients.

Parameters
  • cls – client class

  • k (int) – strength of sparcity

Returns

a class wrapped in SparseGradientClientWrapper

Return type

cls

aijack.defense.sparse.topk.attach_sparse_gradient_to_server(cls)[source]#

Make the server class communicate the sparse gradients.

Parameters

cls – server class

Returns

a class wrapped in SparseGradientServerWrapper

Return type

cls

2.1.9.3. Module contents#