Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
lauri-codes committed Jun 20, 2024
1 parent 644fada commit 7103856
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 278 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"data": {
"m_def": "nomad_bayesian_optimization.schema_packages.bayesian_optimization.BayesianOptimization",
"optimization": "gASVvwMAAAAAAACMEXBhbmRhcy5jb3JlLmZyYW1llIwJRGF0YUZyYW1llJOUKYGUfZQojARfbWdylIwecGFuZGFzLmNvcmUuaW50ZXJuYWxzLm1hbmFnZXJzlIwMQmxvY2tNYW5hZ2VylJOUKIwWcGFuZGFzLl9saWJzLmludGVybmFsc5SMD191bnBpY2tsZV9ibG9ja5STlIwVbnVtcHkuY29yZS5tdWx0aWFycmF5lIwMX3JlY29uc3RydWN0lJOUjAVudW1weZSMB25kYXJyYXmUk5RLAIWUQwFilIeUUpQoSwFLAUsBhpRoD4wFZHR5cGWUk5SMAk84lImIh5RSlChLA4wBfJROTk5K/////0r/////Sz90lGKJXZSMB1NpbGljb26UYXSUYowIYnVpbHRpbnOUjAVzbGljZZSTlEsASwFLAYeUUpRLAoeUUpRoC2gOaBFLAIWUaBOHlFKUKEsBSwNLAYaUaBiMAmY4lImIh5RSlChLA4wBPJROTk5K/////0r/////SwB0lGKJQxgL2B0UJzZ/QFfdIlBVafc/4aCIaXfX/D+UdJRiaCNLAUsESwGHlFKUSwKHlFKUaAtoDmgRSwCFlGgTh5RSlChLAUsBSwGGlGgYjAJpOJSJiIeUUpQoSwNoL05OTkr/////Sv////9LAHSUYolDCAEAAAAAAAAAlHSUYmgjSwRLBUsBh5RSlEsCh5RSlGgLaA5oEUsAhZRoE4eUUpQoSwFLAUsBhpRoLolDCAAAAAAAAPh/lHSUYmgjSwVLBksBh5RSlEsCh5RSlHSUXZQojBhwYW5kYXMuY29yZS5pbmRleGVzLmJhc2WUjApfbmV3X0luZGV4lJOUaFGMBUluZGV4lJOU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0YWRhdGGUXZSMBWF0dHJzlH2UjAZfZmxhZ3OUfZSMF2FsbG93c19kdXBsaWNhdGVfbGFiZWxzlIhzdWIu",
"figures": [
{
"label": "Optimization results",
"figure": {
"data": [
{
"hovertemplate": "x=%{x}<br>y=%{y}<extra></extra>",
"hovertemplate": "Iteration=%{x}<br>refractive_index=%{y}<extra></extra>",
"legendgroup": "",
"marker": {
"color": "#636efa",
Expand All @@ -19,11 +19,29 @@
"orientation": "v",
"showlegend": false,
"x": [
NaN
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"xaxis": "x",
"y": [
1.802604114762339
2.079667473416009,
0.8709893157455393,
1.555503748783007,
2.1257166481210845,
1.3503182438353836,
1.659098503962656,
1.4384127557009232,
2.4284166175171773,
2.490676597333392,
2.621132760598248
],
"yaxis": "y",
"type": "scatter"
Expand Down Expand Up @@ -875,12 +893,7 @@
],
"matches": "y",
"showticklabels": false
},
"title": {
"text": "Optimization results"
},
"height": 400,
"width": 716
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_samples(recommendations):

i = 0
result = 0
threshold = 1
threshold = 0.1
while abs(refractive_index_target - result) > threshold:
df = campaign.recommend(batch_size=1)
print('New recommendation:')
Expand Down Expand Up @@ -136,6 +136,7 @@ def get_samples(recommendations):

with open('archive.json', 'w') as fout:
json.dump(archive.m_to_dict(), fout, indent=2)

# print(bopt.search_space)
# campaign_dict = campaign.to_dict()
# recommendation = deserialize_dataframe(campaign_dict['_cached_recommendation'])
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,21 @@ def normalize(self, archive, logger):

df = deserialize_dataframe(self.optimization)
target_name = self.objective.target.name
first_line = px.scatter(x=df['FitNr'], y=df[target_name])
figure1 = make_subplots(rows=1, cols=2, shared_yaxes=True)
first_line = px.scatter(
df,
x='BatchNr',
y=target_name,
title='Optimization result',
labels={
'target_name': 'Refractive index',
'BatchNr': 'Iteration',
},
)
figure1 = make_subplots(rows=1, cols=1, shared_yaxes=True)
figure1.add_trace(first_line.data[0], row=1, col=1)
figure1.update_layout(height=400, width=716, title_text='Optimization results')
self.figures.append(
self.figures = [
PlotlyFigure(label='Optimization results', figure=figure1.to_plotly_json())
)
]


m_package.__init_metainfo__()

0 comments on commit 7103856

Please sign in to comment.