ziatdinovmax / gpax

Gaussian Processes for Experimental Sciences
http://gpax.rtfd.io
MIT License
205 stars 27 forks source link

Add cBO (1D Problem) #76

Closed arpanbiswas52 closed 8 months ago

arpanbiswas52 commented 9 months ago

Added notebook in example folder for 1D version. The 2D version is larger than 25 MB, so wont be able to upload. Please review. Thank you

arpanbiswas52 commented 8 months ago

The piecewise function is just a demonstration to showcase how it will work with some incorrect information (which it worked still!). We can use different mean function as well.

On the prior distribution, the normal values are changed to real values and therefore the unif distribution is provided as part of the real parameter space (non-normalized one) [0, 15]. Please look below.

@jit def mean_func(x: jnp.ndarray, params: Dict[str, float]) -> jnp.ndarray:

x_data = x[:,0]
#jax.debug.print("x_norm: {}", x_data)
**lb = 0
ub = 15
x_data = x_data*(ub-lb) + lb**
#jax.debug.print("x: {}", x_data)

return jnp.piecewise(
        x_data, [x_data < params["t"], x_data >= params["t"]],
        [lambda x_data: (params["a2"]*jnp.sin(x_data*params["a1"])),
         lambda x_data: (params["b2"]*jnp.sin(x_data*params["b1"]))])
codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (b7c2577) 95.59% compared to head (e2c8189) 95.62%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #76 +/- ## ========================================== + Coverage 95.59% 95.62% +0.02% ========================================== Files 51 51 Lines 3930 3930 ========================================== + Hits 3757 3758 +1 + Misses 173 172 -1 ``` | [Flag](https://app.codecov.io/gh/ziatdinovmax/gpax/pull/76/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Maxim+Ziatdinov) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/ziatdinovmax/gpax/pull/76/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Maxim+Ziatdinov) | `95.62% <ø> (+0.02%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Maxim+Ziatdinov#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

arpanbiswas52 commented 8 months ago

Yes definitely, I am advising Shakti (Sergei’s postdoc) to apply cBO on nano indentation problem. We can use that notebook as real problem.