Skip to content

Commit

Permalink
Experiment 01 update (#236)
Browse files Browse the repository at this point in the history
* mod_config bug fix

* Model training example

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Tetracarbonylnickel and pre-commit-ci[bot] authored Mar 1, 2024
1 parent 32f1387 commit c361f0e
Show file tree
Hide file tree
Showing 4 changed files with 313 additions and 46 deletions.
2 changes: 1 addition & 1 deletion apax/utils/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from . import convert, data, jax_md_reduced, math, random, datasets
from . import convert, data, datasets, jax_md_reduced, math, random

__all__ = ["convert", "data", "math", "random", "jax_md_reduced", datasets]
5 changes: 4 additions & 1 deletion apax/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ def mod_config(config_path, updated_config):
config_dict = yaml.safe_load(stream)

for key, new_value in updated_config.items():
config_dict[key].update(new_value)
if isinstance(config_dict[key], dict):
config_dict[key].update(new_value)
else:
config_dict[key] = new_value
return config_dict
350 changes: 307 additions & 43 deletions examples/01_Model_Training.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from apax.config.train_config import Config
from apax.model.builder import ModelBuilder
from apax.train.run import run
from apax.utils.random import seed_py_np_tf
from apax.utils.datasets import download_md22_stachyose
from apax.utils.helpers import mod_config
from apax.utils.random import seed_py_np_tf


@pytest.fixture(autouse=True)
Expand Down

0 comments on commit c361f0e

Please sign in to comment.