0.15.0
What's new?
-
Server-side parameter initialization (#658)
Model parameters can now be initialized on the server-side. Server-side parameter initialization works via a new
Strategy
method calledinitialize_parameters
.Built-in strategies support a new constructor argument called
initial_parameters
to set the initial parameters. Built-in strategies will provide these initial parameters to the server on startup and then delete them to free the memory afterward.# Create model model = tf.keras.applications.EfficientNetB0( input_shape=(32, 32, 3), weights=None, classes=10 ) model.compile("adam", "sparse_categorical_crossentropy", metrics=["accuracy"]) # Create strategy and initilize parameters on the server-side strategy = fl.server.strategy.FedAvg( # ... (other constructor arguments) initial_parameters=model.get_weights(), ) # Start Flower server with the strategy fl.server.start_server("[::]:8080", config={"num_rounds": 3}, strategy=strategy)
If no initial parameters are provided to the strategy, the server will continue to use the current behavior (namely, it will ask one of the connected clients for its parameters and use these as the initial global parameters).
Deprecations
- Deprecate
flwr.server.strategy.DefaultStrategy
(migrate toflwr.server.strategy.FedAvg
, which is equivalent)