We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute the script below.
TypeError: Object of type int64 is not JSON serializable
plot.html
from hiplot import Experiment import nevergrad as ng from nevergrad.optimization.callbacks import ParametersLogger from math import cos parametrization = ng.p.Instrumentation( ng.p.TransitionChoice(10) ) optimizer = ng.optimizers.NGOpt(parametrization=parametrization, budget=10) logger = ParametersLogger("log.json") optimizer.register_callback("tell", logger) recommendation = optimizer.minimize(cos) print("Recommendation: ", recommendation.value) exp: Experiment = logger.to_hiplot_experiment() exp.to_html("plot.html")
The reason that it crashes is that exp.datapoints[0].values['0.indices#0'] is a np.int64 instead of a simple native int.
exp.datapoints[0].values['0.indices#0']
np.int64
int
TransitionChoice has the layer _datalayers.Int. And its _layered_get_value function returns an np.int64.
TransitionChoice
_datalayers.Int
_layered_get_value
nevergrad/nevergrad/parametrization/_layering.py
Lines 269 to 285 in 8403d6c
Not sure if this is the source of the problem, I'm not familiar with the guts of nevergrad
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Steps to reproduce
Execute the script below.
Observed Results
TypeError: Object of type int64 is not JSON serializable
Expected Results
plot.html
which shows the HiPlot of the optimization.Relevant Code
Notes
The reason that it crashes is that
exp.datapoints[0].values['0.indices#0']
is anp.int64
instead of a simple nativeint
.TransitionChoice
has the layer_datalayers.Int
. And its_layered_get_value
function returns annp.int64
.nevergrad/nevergrad/parametrization/_layering.py
Lines 269 to 285 in 8403d6c
Not sure if this is the source of the problem, I'm not familiar with the guts of nevergrad
The text was updated successfully, but these errors were encountered: