Giter VIP home page Giter VIP logo

Comments (7)

nTrouvain avatar nTrouvain commented on June 4, 2024

Hello,
Thank you for reporting this error. Could you provide the code of the objective function you are trying to run ? The error probably comes from one of the values inserted in the returned dictionary. Are your results correctly saved as JSON files ?

from reservoirpy.

FuzzyWuzzyIsABear avatar FuzzyWuzzyIsABear commented on June 4, 2024

Sorry cannot post the whole thing.

But i was returning return {'loss': np.mean(losses)}

from reservoirpy.

FuzzyWuzzyIsABear avatar FuzzyWuzzyIsABear commented on June 4, 2024

It writes a json file with this:

{"returned_dict": {"loss": 842.2902508909732, "status": "ok", "start_time": 1635807096.9917843, "duration": 24.424065113067627}, "current_params": {"N":

This is the hyperopt config:

hyperopt_config = {
    "exp": f"{experimentation_no}-hyperopt",
    "hp_max_evals": 200,             # the number of differents sets of parameters hyperopt has to try
    "hp_method": "random",           # the method used by hyperopt to chose those sets (see below)
    "instances_per_trial": 1,        # how many random ESN will be tried with each sets of parameters
    "hp_space": {                    # what are the ranges of parameters explored
        "N": ["randint", 4950, 5050],             # the number of neurons is fixed to 300
        "sr": ["uniform", 0.9, 0.999],   # the spectral radius is log-uniformly distributed between 1e-6 and 10
        "leak": ["uniform", 1e-3, 1],  # idem with the leaking rate, from 1e-3 to 1
        "iss": ["uniform", 0.5, 0.9],           # the input scaling is fixed
        "ridge": ["uniform",1e-10, 1e-3],        # and so is the regularization parameter.
        "seed": ["choice", 1234]          # an other random seed for the ESN initialization
    }
}

It looks like the first variable "N" is being stored as an numpy int64.

from reservoirpy.

nTrouvain avatar nTrouvain commented on June 4, 2024

In this case, could you try to explicitely cast "N" to Python int type with N = int(...) ? Be carefull that your loss and everything you store in the result dictionary are also native Python types, and not Numpy arrays. Numpy sometimes returns unidimensional arrays instead of scalars.

from reservoirpy.

neuronalX avatar neuronalX commented on June 4, 2024

Hi @FuzzyWuzzyIsABear,

remarks on your search space:

  • did you train running on just 1000 units in the reservoir N = 1000 instead of setting it at 5000 which can be difficult to compute depending on your computer resources.
  • for all variables where you put "uniform" I would advise to put "loguniform" instead, because all these variable have this kind of log-scale sensitivity
  • restricting spectral radius (SR) to [0.9, 1.] is very narrow, we advise to explore it in [10^-2 ; 10^1], like the input scaling (iss), or to fix one of those.

You can refer to our recent paper on advices on hyperparameter search for reservoirs:
"Which Hype for My New Task? Hints and Random Search for Echo State Networks Hyperparameters", ICANN 2021
https://link.springer.com/chapter/10.1007/978-3-030-86383-8_7
with a preprint version here:
https://hal.inria.fr/hal-03203318/

from reservoirpy.

FuzzyWuzzyIsABear avatar FuzzyWuzzyIsABear commented on June 4, 2024

Thanks for your advice. I'm not using hyperopt anymore though and I changed my code around a bit so I cannot test your solution but the memory leak issue is prominent.

from reservoirpy.

nTrouvain avatar nTrouvain commented on June 4, 2024

I am closing this issue as the problem seems to be solved. Let us know if it is not the case.

from reservoirpy.

Related Issues (20)

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.