gnahtb / RealFL

Implement basic steps in a model-centric federated learning model
The Unlicense
0 stars 2 forks source link

Transfer training configuration JSON properties into class properties #18

Closed gnahtb closed 1 year ago

gnahtb commented 1 year ago

Currently, we are storing the training configuration for data distribution and node dropping as a JSON object in the code.

https://github.com/bnnthang/RealFL/blob/c3510b7dfc32b54e74eda4207fc335fc3c82d837/CommonUtils/src/main/java/com/bnnthang/fltestbed/commonutils/models/TrainingConfiguration.java#L53

This is not a good practice as we need to keep using the JSON utility methods to extract the values we want. Instead, for each key-value pair in the JSON configuration file, create a variable in the TrainingConfiguration class (with a suitable data type). For example, we want to store the key-value-pair "evenLabelDistributionByClient": true as a boolean variable.

gnahtb commented 1 year ago

Also, avoid using the asterisk notation for imports. IMO, it's a bad practice.

https://github.com/bnnthang/RealFL/blob/c3510b7dfc32b54e74eda4207fc335fc3c82d837/Server/src/main/java/com/bnnthang/fltestbed/Server/App.java#L16-L17

tem556 commented 1 year ago

Also, avoid using the asterisk notation for imports. IMO, it's a bad practice.

https://github.com/bnnthang/RealFL/blob/c3510b7dfc32b54e74eda4207fc335fc3c82d837/Server/src/main/java/com/bnnthang/fltestbed/Server/App.java#L16-L17

Yes, after losing style points over it in cloud, I agree.