File size: 4,311 Bytes
44714bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3119968
44714bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "fleven"
version = "1.0.0"
description = "FLEVEn — Federated Learning for Vehicular Environment"

readme = "README.md"
keywords = ["federated-learning", "flower", "mlflow", "federated-learning-vehicular", "time-series", "lstm", "pytorch", "obd"]
classifiers = [
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "License :: OSI Approved :: Apache Software License",
    "Operating System :: OS Independent",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
    "Topic :: Software Development :: Libraries :: Python Modules"
]
authors = [
    {name = "João C. Braz", email = "calbraz@gmail.com"},
    {name = "José Wilson C. Souza", email = "josewilson@matematica.ufrj.br"},
    {name = "Erick de Souza Lima", email = "erickcefetbcc@gmail.com"},
    {name = "Mina", email = "minammonteiro4@gmail.com"},
]

maintainers = [
    {name = "José Wilson C. Souza", email = "josewilson@matematica.ufrj.br"}
]

license = {text = "Apache-2.0"}
dependencies = [
    "flwr[simulation]>=1.22.0,<2.0",
    "torch>=2.0.0",
    "pandas>=2.0.0",
    "numpy>=1.24.0",
    "scikit-learn>=1.3.0",
    "matplotlib>=3.7.0",
    "seaborn>=0.12.0",
    "toml",
    "mlflow>=2.9.0"
]

[project.urls]
Repository = "https://github.com/josewilsonsouza/fleven"
"Issue Tracker" = "https://github.com/josewilsonsouza/fleven/issues"

[tool.hatch.build.targets.wheel]
packages = ["fleven"]

[tool.flwr.app]
publisher = "Lainf_Dmtic_Inmetro"

[tool.flwr.app.components]
serverapp = "fleven.server:app"
clientapp = "fleven.client:app"

[tool.flwr.app.config]
# Configurações de Federação
strategy = "fedavg"  # Opções: "fedavg", "fedadam", "fedadagrad", "fedyogi"
rounds = 10
min-nodes = 3
seed = 42

# 🔧 Caminhos (ajustar conforme necessário). (deixar só "" parece que funciona)
data-base-path = "" #"C:/Users/abece/Documents/fleven-test/data"
metrics-base-path = "" #"C:/Users/abece/Documents/fleven-test/metrics"
results-base-path = "" #"C:/Users/abece/Documents/fleven-test/results"

# Configurações MLflow
mlflow-tracking-uri = "https://jwsouza13-fleven.hf.space"  # URI do servidor MLflow --> Hugging Face Spaces
mlflow-experiment-name = "FLEVEn-Experiments"
mlflow-enable = true  # Habilitar/desabilitar MLflow


# Escolha dos modelos do FLEVEn: "lstm", "lstm_dense", "mlp"
model-type = "lstm_dense"

# Parâmetros para "lstm" e "mlp"
hidden-size = 32

# Parâmetros para "lstm_dense" (o novo modelo adaptado)
lstm-hidden-size = 32  # Tamanho da camada LSTM
dense-hidden-size = 16 # Tamanho da camada Densa intermediária

# Parâmetros para "lstm" e "lstm_dense"
input-size = 3
num-layers = 1
dropout = 0.2  # Taxa de dropout (0.0 para desativar)

# Configurações de Séries Temporais
sequence-length = 100
prediction-length = 50
target-column = "vehicle_speed"

# Configurações de Treinamento
batch-size = 32
learning-rate = 1e-5
local-epochs = 1
max-grad-norm = 1.0

# Configurações de Dados
train-test-split = 0.8

# Configurações de Checkpoint
save-checkpoint-every = 5

[tool.flwr.app.config.strategy-params]
# Parâmetros para FedAdam
eta = 0.01
beta_1 = 0.9
beta_2 = 0.999

# Parâmetros para FedAdagrad
eta_adagrad = 0.1
initial_accumulator_value = 0.1

# Parâmetros para FedYogi
eta_yogi = 0.01
beta_1_yogi = 0.9
beta_2_yogi = 0.999
initial_accumulator_value_yogi = 1e-6

[tool.flwr.federations]
default = "local-simulation"

[tool.flwr.federations.local-simulation]
options.num-supernodes = 3
options.backend.client-resources.num-cpus = 2
options.backend.client-resources.num-gpus = 0.0

# essas configs vão ser importantes mais na frente, quando quisermos, 
# por exemplo, outros parametros para certos clients
#[[tool.flwr.federations.local-simulation.options.supernode.resources]]
#node-config.partition-id = 1
#node-config.num-partitions = 3

#[[tool.flwr.federations.local-simulation.options.supernode.resources]]
#node-config.partition-id = 2
#node-config.num-partitions = 3

#[[tool.flwr.federations.local-simulation.options.supernode.resources]]
#node-config.partition-id = 3
#node-config.num-partitions = 3

[tool.flwr.federations.fleven-deployment]
address = "127.0.0.1:9093"
insecure = true