guanyilun / galilei

A generic function emulator that supports multiple backends
MIT License
1 stars 0 forks source link

support loading and saving models #4

Closed guanyilun closed 1 year ago

guanyilun commented 1 year ago

support saving models with syntax of

@emulate(samples={
    'a': np.random.rand(100),
    'b': np.random.rand(100)
}, backend='sklearn', save="test.pkl")
def test_em(a=1, b=1):
    x = np.linspace(0, 10, 100)
    return np.sin(a*x) + np.sin(b*x)

and then loading it with

@emulate(backend='sklearn', load="test.pkl")
def test_em(a=1, b=1):
    x = np.linspace(0, 10, 100)
    return np.sin(a*x) + np.sin(b*x)
codecov-commenter commented 1 year ago

Codecov Report

Base: 0.00% // Head: 0.00% // No change to project coverage :thumbsup:

Coverage data is based on head (66930c4) compared to base (a4a6508). Patch coverage: 0.00% of modified lines in pull request are covered.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4 +/- ## ====================================== Coverage 0.00% 0.00% ====================================== Files 3 3 Lines 172 223 +51 ====================================== - Misses 172 223 +51 ``` | [Impacted Files](https://codecov.io/gh/guanyilun/galilei/pull/4?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yilun+Guan) | Coverage Δ | | |---|---|---| | [galilei/emulator.py](https://codecov.io/gh/guanyilun/galilei/pull/4?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yilun+Guan#diff-Z2FsaWxlaS9lbXVsYXRvci5weQ==) | `0.00% <0.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yilun+Guan). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yilun+Guan)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.