Skip to content

0.15.0

Compare
Choose a tag to compare
@danieljanes danieljanes released this 12 Mar 08:05
· 2515 commits to main since this release
799540e

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 called initialize_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 to flwr.server.strategy.FedAvg, which is equivalent)