Comments (3)
I was not able to reproduce this error in Ubuntu 20.04 with the same python and hyperactive version. The fact that it works on my end surprises me, because Hyperactive uses multiprocessing as default. I always thought multiprocessing cannot handle lambda because it uses pickle.
Maybe you could try using joblib for Hyperactive. It is a shot in the dark but maybe this works for your OS.
Here is a snipped to try out:
import numpy as np
from hyperactive import Hyperactive
space = dict(alpha=np.linspace(0, 1), beta=np.linspace(0, 1), start=[-0.95], end=[0.95])
points = np.random.rand(10)
def model(opt):
rv = lambda x: x
return np.sum(rv(points))
hyper = Hyperactive(distribution="joblib")
hyper.add_search(
model,
space,
n_iter=50,
n_jobs=2,
)
hyper.run()
Let me know if this solves your problem.
It is difficult for me to reproduce this error, because I do not have access to MacOS. I hope we find a solution with joblib.
from hyperactive.
Joblib works, thanks!
One more thing, n_jobs is independent of the number of runs, is this correct? So if I wanted to run the experiment 50 times, I'd have to call run 50 times and collect the results each time, is this correct? I am asking because running:
hyper.add_search(model, space, n_iter=50, n_jobs=N)
gives me min(N, 12)
for N >= -1, and I assume 12 is because my CPU shows 12 cores.
from hyperactive.
Very good! It works now, because joblib uses an alternative to pickle.
I am not sure i understand your question.
n_jobs opens n processes during the optimization run. Each of those processes runs n_iter iterations. If n_jobs == -1 then n_jobs is set to the number of CPU cores available.
I hope this answers your question. If you need more clarification or have another question feel free to open another issue.
from hyperactive.
Related Issues (20)
- ValueError: assignment destination is read-only HOT 3
- Dynamic inertia in ParticleSwarmOptimizer HOT 4
- Feature: Passing extra parameters to the optimization function HOT 5
- Optimization in serial? HOT 4
- New feature: save optimizer object to continue optimization run at a later time.
- hyper.results(model) HOT 1
- New feature: Optimization Strategies HOT 1
- add ray multiprocessing support
- Change Optimization paramters at runtime
- Show speed difference between python version
- Question of Particle Swarm Optimizer HOT 6
- Progress Bar visual error when running in parallel HOT 2
- Error when creating shared memory HOT 1
- TypeError: cannot pickle '_thread.RLock' object HOT 5
- Redesign command-line output of optimization run HOT 1
- Add early stopping feature to custom optimization strategies HOT 1
- Add type hints to hyperactive-api HOT 1
- add `prune_search_space`-method to optimization strategies HOT 1
- add constrained optimization to API HOT 1
- Stop verbosity of search HOT 3
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 hyperactive.