Coder Social home page Coder Social logo

gmc-drl / metabox Goto Github PK

View Code? Open in Web Editor NEW
51.0 51.0 8.0 233.7 MB

MetaBox: A Benchmark Platform for Meta-Black-Box Optimization with Reinforcement Learning (https://arxiv.org/abs/2310.08252)

Home Page: https://gmc-drl.github.io/MetaBox/

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
benchmark-platform black-box-optimization deep-reinforcement-learning evolutionary-algorithms hyperparameter-optimization learning-to-optimize meta-black-box-optimization protein-protein-docking real-parameter-optimization

metabox's People

Contributors

atwillteam avatar crazynicolas avatar jc-chen1 avatar pgj-0419 avatar yining043 avatar zhenruili avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

metabox's Issues

RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.

Hi, I tried to run the l2l code with:
python main.py --train --problem bbob --difficulty easy --train_agent L2L_Agent --train_optimizer L2L_Optimizer --max_learning_step 150000
but it returned error:

start training: 20240315T134833_bbob_easy_10D
Training L2L_Agent Epoch 0: 0%| | 0/18 [00:00<?, ?it/s]
Traceback (most recent call last):
File "D:\git-repos\MetaBox\src\main.py", line 24, in
trainer.train()
File "D:\git-repos\MetaBox\src\trainer.py", line 151, in train
exceed_max_ls, pbar_info_train = self.agent.train_episode(env) # pbar_info -> dict
File "D:\git-repos\MetaBox\src\agent\l2l_agent.py", line 49, in train_episode
y,,=env.step(x)
File "D:\git-repos\MetaBox\src\environment\basic_environment.py", line 22, in step
return self.optimizer.update(action, self.problem)
File "D:\git-repos\MetaBox\src\optimizer\l2l_optimizer.py", line 41, in update
y=problem.eval(x)-problem.optimum
File "D:\git-repos\MetaBox\src\problem\basic_problem.py", line 21, in eval
x = np.array(x)
File "C:\Users\minhh\miniconda3\envs\py39\lib\site-packages\torch_tensor.py", line 643, in array
return self.numpy()
RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.

The line number might differ a little bit since I added some comment code. According to the suggestion, I replace x = np.array(x) by x = x.detach().numpy() but it returned another error:

start training: 20240315T135459_bbob_easy_10D
Training L2L_Agent Epoch 0: 0%| | 0/18 [00:00<?, ?it/s]
Traceback (most recent call last):
File "D:\git-repos\MetaBox\src\main.py", line 24, in
trainer.train()
File "D:\git-repos\MetaBox\src\trainer.py", line 151, in train
exceed_max_ls, pbar_info_train = self.agent.train_episode(env) # pbar_info -> dict
File "D:\git-repos\MetaBox\src\agent\l2l_agent.py", line 65, in train_episode
loss.mean().backward()
AttributeError: 'numpy.float64' object has no attribute 'backward'

What did I do wrong here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.