BalticBytes / vertical-federated-learning-kang

5 stars 1 forks source link

About save the model #2

Closed wulas09763 closed 2 years ago

wulas09763 commented 2 years ago

Hello, I would like to ask how do I save the model? Thank you.

BalticBytes commented 2 years ago

I assume you are not setting a fixed seed then, i.e. you removed and/or changed the following lines

https://github.com/BalticBytes/vertical-federated-learning-kang/blob/c55bcc85be82599c476d56de0f6717ab38c4bd72/tf_vertical_FL_train.py#L237 https://github.com/BalticBytes/vertical-federated-learning-kang/blob/c55bcc85be82599c476d56de0f6717ab38c4bd72/tf_vertical_FL_train.py#L246 https://github.com/BalticBytes/vertical-federated-learning-kang/blob/c55bcc85be82599c476d56de0f6717ab38c4bd72/tf_vertical_FL_train.py#L249

If you did not change the above, then there is no point in saving the models because they should always train "the same way".

Otherwise, take a look at checkpointing https://www.tensorflow.org/tutorials/keras/save_and_load#save_checkpoints_during_training

wulas09763 commented 2 years ago

Ok, thanks for your reply, I'm giving it a try.