-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from thorben-frank/v1.0-finetuning
first draft for finetuning logic
- Loading branch information
Showing
4 changed files
with
290 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import argparse | ||
import json | ||
from mlff.config import from_config | ||
from ml_collections import config_dict | ||
import pathlib | ||
import yaml | ||
|
||
|
||
def fine_tune_so3krates_sparse(): | ||
# Create the parser | ||
parser = argparse.ArgumentParser(description='Train a SO3kratesSparse model.') | ||
parser.add_argument( | ||
'--config', | ||
type=str, | ||
required=True, | ||
help='Path to the config file.' | ||
) | ||
parser.add_argument( | ||
'--start_from_workdir', | ||
type=str, | ||
required=True, | ||
help='Path to workdir from which fine tuning should be started.' | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
config = pathlib.Path(args.config).expanduser().absolute().resolve() | ||
if config.suffix == '.json': | ||
with open(config, mode='r') as fp: | ||
cfg = config_dict.ConfigDict(json.load(fp=fp)) | ||
elif config.suffix == '.yaml': | ||
with open(config, mode='r') as fp: | ||
cfg = config_dict.ConfigDict(yaml.load(fp, Loader=yaml.FullLoader)) | ||
|
||
from_config.run_fine_tuning(cfg, start_from_workdir=args.start_from_workdir) | ||
|
||
|
||
if __name__ == '__main__': | ||
fine_tune_so3krates_sparse() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters