Commit efeb976e authored by Marcel Langer's avatar Marcel Langer
Browse files

Add data and run

parent 93740d1b
# Used to prepare the example datasets for hyper-parameter optimisation
import numpy as np
np.random.seed(42)
import cmlkit
data = cmlkit.load_dataset("nmd18u") # obtained from qmml.org
rest, train, test = cmlkit.utility.threeway_split(2400, 800, 200)
train = cmlkit.dataset.Subset.from_dataset(
data, idx=train, name="nmd18_hpo_train"
)
print(train.n)
train.save()
test = cmlkit.dataset.Subset.from_dataset(data, idx=test, name="nmd18_hpo_test")
print(test.n)
test.save()
train = cmlkit.dataset.Subset.from_dataset(
data, idx=np.arange(2400), name="nmd18_train"
)
print(train.n)
train.save()
test = cmlkit.dataset.Subset.from_dataset(
data, idx=np.arange(start=2400, stop=3000), name="nmd18_test"
)
print(test.n)
test.save()
import cmlkit
space = {
"model": {
"per": "cell",
"regression": {
"krr": {
"kernel": {
"kernel_atomic": {
"norm": False,
"kernelf": {
"gaussian": {
"ls": [
"hp_loggrid",
"ls_start",
-10,
2,
25,
]
}
},
}
},
"nl": ["hp_loggrid", "nl_start", -20, -10, 21],
}
},
"representation": {
"ds_soap": {
"elems": [8, 13, 31, 49],
"n_max": 6,
"l_max": 6,
"cutoff": 5,
"sigma": ["hp_loggrid", "sigma", -4, 1, 11],
"rbf": "gto",
}
},
}
}
search = cmlkit.tune.Hyperopt(space, method="tpe")
evaluator = cmlkit.tune.TuneEvaluatorHoldout(
train="nmd18_hpo_train", test="nmd18_hpo_test", target="fe", lossf="rmse"
)
search = cmlkit.tune.Hyperopt(space, method="tpe")
run = cmlkit.tune.Run(
search=search,
evaluator=evaluator,
stop={"stop_max": {"count": 200}},
context={"max_workers": 40},
name="nmd18_hpo",
caught_exceptions=["QMMLException"]
)
run.prepare()
run.run()
This diff is collapsed.
### Status of run nmd18_hpo at 2020-05-23 00:33:30 ###
nmd18_hpo: Done. Have a good day! Runtime: 4629.6/inf. Active evaluations: 0.
Counted trials: 200/200.
Best 3: 0.0109 0.0110 0.0111. Live: 41/T: 200 (150)/E: 124 (93).
{'QMMLException': 50}
model:
per: cell
regression:
krr:
kernel:
kernel_atomic:
kernelf:
gaussian:
ls: 0.011048543456039806
norm: false
nl: 2.1579186437577746e-05
representation:
ds_soap:
cutoff: 5
elems: [8, 13, 31, 49]
l_max: 6
n_max: 6
rbf: gto
sigma: 0.0625
model:
per: cell
regression:
krr:
kernel:
kernel_atomic:
kernelf:
gaussian:
ls: 0.08838834764831845
norm: false
nl: 1.3486991523486091e-06
representation:
ds_soap:
cutoff: 5
elems: [8, 13, 31, 49]
l_max: 6
n_max: 6
rbf: gto
sigma: 0.0625
model:
per: cell
regression:
krr:
kernel:
kernel_atomic:
kernelf:
gaussian:
ls: 0.02209708691207961
norm: false
nl: 3.0517578125e-05
representation:
ds_soap:
cutoff: 5
elems: [8, 13, 31, 49]
l_max: 6
n_max: 6
rbf: gto
sigma: 0.0625
model:
per: cell
regression:
krr:
kernel:
kernel_atomic:
kernelf:
gaussian:
ls: 0.7071067811865476
norm: false
nl: 6.103515625e-05
representation:
ds_soap:
cutoff: 5
elems: [8, 13, 31, 49]
l_max: 6
n_max: 6
rbf: gto
sigma: 0.125
model:
per: cell
regression:
krr:
kernel:
kernel_atomic:
kernelf:
gaussian:
ls: 2.8284271247461903
norm: false
nl: 5.3947966093944364e-06
representation:
ds_soap:
cutoff: 5
elems: [8, 13, 31, 49]
l_max: 6
n_max: 6
rbf: gto
sigma: 0.125
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment