Federation plans are YAML configuration files that define how federated learning sessions are conducted. They specify the participants, algorithms, models, and other parameters.
A federation plan consists of several key sections:
federation:
name: "string" # Unique federation name
description: "string" # Human-readable description
aggregator: # Aggregator configuration
host: "string"
port: integer
collaborators: # List of collaborators
- name: "string"
host: "string"
port: integer
algorithm: # Federated learning algorithm
type: "string"
parameters: {}
model: # Model configuration
type: "string"
parameters: {}
monitoring: # Monitoring configuration (optional)
enabled: boolean
config: {}algorithm:
type: "fedavg"
rounds: 10
epochs_per_round: 5
learning_rate: 0.01algorithm:
type: "fedopt"
rounds: 10
epochs_per_round: 5
learning_rate: 0.01
beta1: 0.9
beta2: 0.999algorithm:
type: "fedprox"
rounds: 10
epochs_per_round: 5
learning_rate: 0.01
mu: 0.001model:
type: "simple_nn"
input_size: 784
hidden_size: 128
output_size: 10
activation: "relu"model:
type: "cnn"
input_channels: 1
input_height: 28
input_width: 28
num_classes: 10
layers: [32, 64, 128]monitoring:
enabled: true
config:
api_port: 8080
webui_port: 3000
metrics_retention: "24h"
collection_interval: "5s"security:
mtls:
enabled: true
ca_cert: "path/to/ca.crt"
cert: "path/to/cert.crt"
key: "path/to/key.key"See the examples directory for complete working examples:
- Basic Plans - Simple federations
- Advanced Plans - Complex algorithms
- Monitoring Plans - With monitoring enabled
Validate your plan before running:
fx plan validate my_federation.yaml- Use descriptive names for federations and collaborators
- Set appropriate timeouts for network operations
- Enable monitoring for production deployments
- Use security features for sensitive data
- Test with small datasets before scaling up
Common issues and solutions:
- Connection refused: Check host/port configuration
- Invalid plan: Use
fx plan validateto check syntax - Performance issues: Adjust algorithm parameters
- Security errors: Verify certificate paths and permissions