Comments (5)
Your data points should have size 20 x 3 since you have 20 points in 3 dimensions.
A simple example where you build a cubic RBF from 100 data points in 3 dimensions may look like this:
import numpy as np
from pySOT.surrogate import RBFInterpolant, CubicKernel, LinearTail
np.random.seed(0)
X = np.random.rand(100, 3)
y = np.sin(np.sum(X, 1))
rbf = RBFInterpolant(dim=3, kernel=CubicKernel(), tail=LinearTail(dim=3), eta=1e-6)
rbf.add_points(X, y)
print(rbf.predict(np.zeros((1, 3)))) # Should be close to 0
Output:
[[0.01681138]]
The functional form of the surrogate model depends on what model you're using. RBFs aren't easily interpretable from the model weights, but other models like polynomial regression are.
from pysot.
Hello,
My query is related to the above example.
Using your example above, I would like to build a cubic RBF over 20 points in 3*3 dimensions.
Does pySOT support this feature?
Thank you!
from pysot.
Hi Zosezhuo,
Can you clarify what you mean by 3*3
dimensions?
from pysot.
Hi
Specifically, I would like to do the following in 3 by 3 dimensions.
np.random.seed(0)
X = np.random.uniform(low=0.0, high=1.0, size=[3,3])
y= fun(X)
y2= fun2(X)
print(X)
print(y)
print(y2)
[[0.5488135 0.71518937 0.60276338]
[0.54488318 0.4236548 0.64589411]
[0.43758721 0.891773 0.96366276]]
134408.75071136828
3.144276104044118
When I tried to add points, I received the following output
rbf_cubic = RBFInterpolant(dim=[3,3], kernel=CubicKernel(), tail=LinearTail(dim=[3,3]), eta=1e-6)
rbf_cubic.add_points(X, y)
rbf_cubic.add_points(X, y2)
TypeError: unsupported operand type(s) for +: 'int' and 'list
Appreciate your time and help very much
from pysot.
An RBF interpolant is a function from R^d -> R. You need to pass in a matrix X
with shape (n, d)
and y
with shape (n,)
.
from pysot.
Related Issues (20)
- Implement SO-MI
- MPI example gets stuck HOT 3
- PendingDeprecationWarning from use of NumPy matrices HOT 2
- Multiple threads does not work HOT 10
- Evaluates the uncertainty of the surrogate model at points x HOT 3
- pySOT may propose the same point twice on pure integer problems HOT 1
- Add back option to restart algorithms when they converge early HOT 1
- mpiexample_simple.py fails after the increase of number of workers HOT 3
- Documentation has an error HOT 1
- `examples` and `tests` are being installed as top-level packages (directly in site-packages) HOT 5
- SurrogateUnitBox not longer required for RBF? HOT 1
- comparisons HOT 1
- MIssing parentheses
- Use of "extra" and "extra_vals"
- add_points() does not handle objective functions that output integers
- Comments in ei_merit() do not match the actual sizes of parameters passed to the function
- In gp.py, predict() returns incorrectly-sized array, causing IndexError exception in ei_merit().
- pySOT is slow to generate new points with large dataset HOT 1
- Stopping criteria based on objective and/or decision variable tolerance
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysot.