Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save checkpoints during unsupervised training and make it resumable #178

Merged
merged 11 commits into from
Dec 10, 2021

Conversation

baixiac
Copy link
Member

@baixiac baixiac commented Dec 2, 2021

This PR saves CDB as checkpoints after certain steps during the unsupervised training. How many checkpoints are kept on the disk is also configurable.

@baixiac baixiac requested a review from w-is-h December 2, 2021 14:55
medcat/cat.py Outdated
"""
if ckpt_max_to_keep < 1:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not like this, I've rarely (or never) seen this feature

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checks like this are now wrapped in the decorator.

medcat/cat.py Outdated
N.B.: A larger number could result in the out-of-disk-space error.
num_of_skipped (int):
The number of sentences/documents to ignore at the beginning.
is_resumed (bool):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer to have it named: resume_from_checkpoint which can be bool/path (have a look at spacy or HF)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Collaborator

@w-is-h w-is-h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@baixiac baixiac merged commit cd1e432 into master Dec 10, 2021
@baixiac baixiac deleted the CAT-92 branch December 10, 2021 16:30
mart-r pushed a commit to mart-r/MedCAT that referenced this pull request Jun 14, 2023
…ogStack#178)

* CAT-92 add the method for resuming training

* CAT-92 deal with file list ordering in the test

* CAT-92 refactor and improve based on review

* CAT-92 save potentially large checkpoint asynchronously

* CAT-92 add workaround for py36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants