gnahtb / RealFL

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

Transfer JSON training configuration keys into properties in the TrainingConfiguration class #28

Closed tem556 closed 1 year ago

tem556 commented 1 year ago

This PR is to close #18.

tem556 commented 1 year ago

@bnnthang if you check Server/App.java, you'll see that I set values of TrainingConfiguration that can be null (i.e. don't have @NonNull over them) using the "set....." method, instead of passing it in as parameter to training constructor. Is there a way to pass them as parameters to constructor?

gnahtb commented 1 year ago

@bnnthang if you check Server/App.java, you'll see that I set values of TrainingConfiguration that can be null (i.e. don't have @nonnull over them) using the "set....." method, instead of passing it in as parameter to training constructor. Is there a way to pass them as parameters to constructor?

The TrainingConfiguration class is annotated with Data. You should be able to pass all arguments via a constructor. Check this out https://projectlombok.org/features/Data.

By the way, this also fixes #26 right?

tem556 commented 1 year ago

Yes, I already did. But for some reason, only arguments with the @NonNull constructor are recognized.

tem556 commented 1 year ago

I think I unintentionally fixed some parts of #26. I think its best if I take another look after I finish #18 and #19

gnahtb commented 1 year ago

Yes, I already did. But for some reason, only arguments with the @nonnull constructor are recognized.

I think you can look at this as well https://projectlombok.org/features/constructor. In short, you just need to add the AllArgsConstructor annotation, I think.

gnahtb commented 1 year ago

@tem556 Have you finished? Let me know, and I will close this PR. Your new commit is included here as well.

tem556 commented 1 year ago

Yes I am done