alonfnt / bayex Goto Github PK
View Code? Open in Web Editor NEWMinimal Implementation of Bayesian Optimization in JAX
License: MIT License
Minimal Implementation of Bayesian Optimization in JAX
License: MIT License
Is your feature request related to a problem? Please describe.
Right now, there is only a printing inside the loop displaying the sampled points. I believe this can be improved.
Describe the solution you'd like
A context manager that could deal with displaying the results on screen with a nicely tabulated format.
There should be several levels of printing (display all the sampled values, display only those values that yield a larger target, not display anything) and maybe there should also be a flag to store the results into a log file (for long running cluster scenarios).
I was thinking about something similar to this:
target | x | y |
--------------------------------
-2.2 | 1 | 5.34 |
-1.2 | 2 | 5.14 |
-0.1 | 4 | 6.23 |
.
.
.
which resembles a lot what is done in the bayes_opt
package.
However, if at some point the main loop gets jitted. Then there may be a problem as no printing will happen (maybe batches?).
Since JAX works on both architectures and requires some installation tweaking to use them, it would be nice to add an indicator on pip to install JAX (jaxlib
) with GPU support or not.
Likewise, adding a flag such as bayex.set_platform("cpu")
on bayex.set_platform("gpu")
, etc... would be nice too.
Is your feature request related to a problem? Please describe.
Functions sometimes have variables that are not in the real domain. If there is some categorical variable, the Bayesian optimization will not work.
Describe the solution you'd like
In order to be able to deal with categorical data, we need to preprocess them so that they can be mapped to the real domain.
Casting to a number will create weird dependencies, so some kind of one-hot encoding should be done.
This is not a new field, which means that there are already some papers out there with methods to deal with them.
among others. We should implement them and see how they work.
In order to check whether a new PR has an effect on the performance. A suite of benchmarks should be added and a CI Github Action that runs them (and report when significant changes happen).
During installation I get the error ERROR: No matching distribution found for jaxlib<0.2.0,>=0.1.69
My JAX is version 0.4.12
Would it take minor tweaks to get this working for the later JAX releases or it's a huge task?
Thanks
Is your feature request related to a problem? Please describe.
The current README file is not very organized since there hasn't even been a release, so it's not clear what bayex offers and what capabilities has.
Describe the solution you'd like
It would be nice to clean it a bit and add specific markdowns with more details steps and guidance for those who need it.
Some specific ideas I have are:
Add some bullet points on the main characteristics of bayex (different types, jax, parallel, reproducibility, GPU, etc)
Usage section:
Contributing:
and more to come that I may think of when I (or someone) tackle(s) this one.
The most common acquisition functions are:
it would be nice to have a way to pass this to bayex.optim
. Probably a custom module with all the acq fun would also be clear and nice.
Additionally, including a basic tour on the difference of each criterion on a notebook/md would be of great help.
Is your feature request related to a problem? Please describe.
Since there are plans to deal with variable other than float
, e.g. integers and #3, there should be a method to specify the type of the variable so that the suggested values can be casted correctly and be shown properly.
Also, knowing the type would help when dealing with the constrains
.
Describe the solution you'd like
A method to deal with it could be passing a dictionary, similar to the constrains
dict where the variable has an specific type.
Maybe consider that if the variable is not include, float
will be assumed.
constrains = {'x': (-10, 10), 'y': (0, 10)}
dtypes = {'x': float, 'y': int}
optim_params = bayex.optim(f, constrains=constrains, dtypes=dtypes, seed=42, n=10)
which could yield the same as
constrains = {'x': (-10, 10), 'y': (0, 10)}
dtypes = dict(y=int)
optim_params = bayex.optim(f, constrains=constrains, dtypes=dtypes, seed=42, n=10)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.