Comments (5)
@takluyver Thanks for the results. I've looked at those sections of code as well to look for methods of acceleration. I haven't spent too much time looking at performance simply because I typically train a model once, then query often. Do you have a need where model training would limit the usefulness of PyKriging?
from pykriging.
No, not particularly. I just spotted an easy way to improve performance in the samplingplan module, and so I profiled the rest of an example to see if there was more low-hanging fruit. I couldn't see any, but I thought I'd leave the results here as a starting point for anyone who wants to take it further.
from pykriging.
====== Update Line =======
Hi @capaulson and @takluyver
It has been verified that the following line in the updatePsi function is a major(more than 70% runtime!) contributer to the runtime of the code.
newPsi = np.exp(-np.sum(self.theta * np.power(self.distance, self.pl), axis=2))
Since the updateModel will be called frequently this command will be excuted thousands or even millions times and will take up most of the rumtime.
So if there are some way to make this code run faster, the whole program will be boosted dramatically.
========================
Hi there, I've faced with the performance problem in #20 , and just ran some simple test to see what's going on in the code that takes time. I believe that what really takes time is the PSO optimization in train function.
This optimization takes about 1 minute on average in my case.
I've got some experience on PSO, though I haven't take look at its detail in Inspyred, if it is a classic PSO,
the swarm size could be smaller(40 in my experience), and a 1000 max_evaluations could give a relative good results (30000 will take much more time if no terminate conditions meet).
Take Rosenbrock benchmark function with 10 dimensions as an example:(according to my experience)
This functions global optimum is:
f(1, 1, 1, 1, 1, 1, 1, 1, 1, 1) = 0
PSO with 40 swarms and 1000 max iter perform results:
classic PSO reaches around 0.5-5(may be trapped in local minima)
PSO with adaptive intertia weight reaches around 0.5
OPSO reaches around 0.0005 - 0.05
All this PSO will not take more than 15 seconds on this optimization.
So a relatively smaller swarm size and max evaluation may save time significantly without too much lose accuacy. If a absolute global minimum is indeed needed, I'll suggest OPSO method.
from pykriging.
@TsingQAQ thanks for the recommendation. I'll take a look. The line you've identified is indeed the bulk of the computation happening here. This line is where new hyperparameters are tested during optimization. I've looked for ways to expedite that calculation, but haven't been too successful yet (at least not in a way that remains general enough for distribution). There may be ways to speed this up with GPU computing etc.
One thing that would be useful to have would be a bench marking test suite. It would be great if you could compile some of these test functions you're using and create a pull request. I can work from there to start building a way to actually record performance values based on optimizers, swarm sizes, etc.
from pykriging.
Hi @capaulson , I've update the testfunction in #23 , which includes the bench mark function tested in #20
Also, I've tried to make it faster through some ways(numba, numexpr) though failed to make any progress, though I'm not familar with these tools so just some biased experience for your reference.
from pykriging.
Related Issues (20)
- Documentation for your library HOT 1
- Prediction with multiple inputs HOT 4
- It starts to predict the same value as I increase sample number to predict HOT 3
- How could I output the predicted array as a numpy array? HOT 2
- Regression Kriging not able to use the optimizer option when called from MATLAB HOT 1
- How to save the result as picture HOT 4
- How to save the trained Kriging Model? HOT 1
- PyKriging Documentation HOT 1
- n-dimensional Kriging HOT 1
- How do I save the trained model? HOT 1
- Optimizer of krige and regressionkrige HOT 1
- How the code works? What is sp, X, y and testfun? HOT 1
- Regression kringe HOT 1
- How to save the trained model for later recall?
- N dimension kriging model
- the problem of k.plot()
- -
- How to use Cokriging algorithm? HOT 3
- The website could not be visited? HOT 2
- CoKiging HOT 1
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 pykriging.