Esempio n. 1
0
    {
        'name': 'x27',
        'type': 'continuous',
        'domain': (1, 4),
        'dimensionality': 1
    },
    {
        'name': 'x28',
        'type': 'continuous',
        'domain': (1, 4),
        'dimensionality': 1
    },
    {
        'name': 'x29',
        'type': 'continuous',
        'domain': (1, 4),
        'dimensionality': 1
    },
]

dim = len(domain)
fill_in_strategy = 'random'
f = GaussianMixtureFunction(dim=dim, mean_1=2, mean_2=3)
X = np.array([np.full(dim, 1)])
method = Dropout(f=f,
                 domain=domain,
                 subspace_dim_size=5,
                 fill_in_strategy=fill_in_strategy,
                 maximize=True)
method.run_optimization(max_iter=200)
Esempio n. 2
0
from bayopt.methods.dropout import Dropout
from bayopt.objective_examples.experiments import SchwefelsFunction
import numpy as np

domain = [{'name': 'x0', 'type': 'continuous', 'domain': (-1, 1), 'dimensionality': 1},
          {'name': 'x1', 'type': 'continuous', 'domain': (-1, 1), 'dimensionality': 1},
          {'name': 'x2', 'type': 'continuous', 'domain': (-1, 1), 'dimensionality': 1},
          {'name': 'x3', 'type': 'continuous', 'domain': (-1, 1), 'dimensionality': 1},
          {'name': 'x4', 'type': 'continuous', 'domain': (-1, 1), 'dimensionality': 1},
          ]

dim = len(domain)
fill_in_strategy = 'random'
f = SchwefelsFunction()
X = np.array([np.full(dim, 1)])
method = Dropout(f=f, domain=domain, subspace_dim_size=2, fill_in_strategy=fill_in_strategy, maximize=False,
                 X=X)
method.run_optimization(max_iter=300, eps=-1)
Esempio n. 3
0
        'type': 'continuous',
        'domain': (-1, 1),
        'dimensionality': 1
    },
]

for i in range(5):

    fill_in_strategy = 'random'
    f = SchwefelsFunction()
    method = Dropout(f=f,
                     domain=domain,
                     subspace_dim_size=5,
                     fill_in_strategy=fill_in_strategy,
                     maximize=False)
    method.run_optimization(max_iter=500, eps=0)

    fill_in_strategy = 'copy'
    f = SchwefelsFunction()
    method = Dropout(
        f=f,
        domain=domain,
        subspace_dim_size=1,
        fill_in_strategy=fill_in_strategy,
        maximize=False,
    )
    method.run_optimization(max_iter=500, eps=0)

    fill_in_strategy = 'mix'
    f = SchwefelsFunction()
    method = Dropout(f=f,