Documentation
¶
Index ¶
- Variables
- func CreateClients(attack string) ([]*Client, []*Client, *python3.PyObject, *python3.PyObject, *python3.PyObject, ...)
- type Client
- func (c *Client) Attack(global_model [][]float64, global_r int, K int, B int)
- func (c *Client) GetGlobalModel(nodes []*node.Node) ([][]float64, int)
- func (c *Client) SendUpdates(nodes []*node.Node, round int, conn *rpc.Client)
- func (c *Client) Sign(modelUpdate [][]float64) []byte
- func (c *Client) Train(global_model [][]float64, global_r int, K int, B int)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Task = "femnist" Attack = "None" //laber flipping attack K = 5 //local training step B = 64 //batch size Beta = 0.9 Lr = 0.1 //client learning rate Slr = 1.0 //server learning rate Round = 50 M = 20 //the number of participants in each round Cm = 0.0 //the fraction of malicious clients existed per round Rank = 2 //the rank of the compressed matrix ClientsNum = 50 )
Functions ¶
Types ¶
type Client ¶
type Client struct {
ID int //the id of client
PublicKey rsa.PublicKey
Round int //the current training round
LocalModelUpdates [][]float64
// contains filtered or unexported fields
}
FL client
func (*Client) Attack ¶
Attacker launch attack: Args: - global_model: the global params of last round - K: the local training step - B: the batch size
func (*Client) GetGlobalModel ¶
Client 'download' global model from a nearest node (randomly picked)
func (*Client) SendUpdates ¶
Client 'send' updates to a randomly choosed edge node
Click to show internal directories.
Click to hide internal directories.