コード例 #1
0
ファイル: main_boa.py プロジェクト: parismav87/air2014
import math

import acquisition_function as acq

D = 10  # number of features
n_training = 10
n_test = 5
max_iter = 100  # maximum number of iterations
sigma_0 = 0.001


# Sample training input and ouput
ytrain = np.matrix(np.random.uniform(-5, 5, (n_training, D)))
fytrain = acq.sample_training_output(ytrain)

# Step 3 - 6
for t in range(0, max_iter):
    # Set of points to be tested
    ytest = np.matrix(np.random.uniform(-5, 5, (n_test, D)))

    # Get mu and sigma
    mu, sigma = acq.gp_posterior(ytrain, ytest, fytrain, sigma_0, n_test)

    # Find ybest
    ybest = acq.gp_optimize(ytest, t, D, mu, sigma, n_test)

    # Augment the data
    ytrain, fytrain = acq.augment_data(ytrain, fytrain, ybest)

    print ybest
コード例 #2
0
ファイル: main_rembo.py プロジェクト: parismav87/air2014
#define initial mu and sigma
mu = 0
sigma = np.matrix(1)

# Step 3 - 6
#ytrain : D dimensional dataset
#ytest: Y subset
#fytrain: sample from dataset (ytrain)

for t in range(0, max_iter):
    number_of_samples = t + 1

    #Step 3 : sample out of y , and create Y
    Y = acq.select_sample_set(number_of_samples, y)

    # Select points from bounded box to be tested
    #ytest =Y
    #ytest = acq.select_test_set(n_test, Y)

    # Get mu and sigma
    mu, sigma, ybest = acq.gp_posterior(ytrain, sigma, ytest, fytrain, A, t, d,
                                        number_of_samples)

    # Find ybest
    # ybest = acq.gp_optimize(ytest, t, D, mu, sigma, n_test)

    # Augment the data
    # ytrain, fytrain = acq.augment_data(ytrain, fytrain, ybest, A)

    print ybest
コード例 #3
0
ファイル: main_boa.py プロジェクト: parismav87/air2014
import numpy as np
import math

import acquisition_function as acq

D = 10  # number of features
n_training = 10
n_test = 5
max_iter = 100  # maximum number of iterations
sigma_0 = 0.001

# Sample training input and ouput
ytrain = np.matrix(np.random.uniform(-5, 5, (n_training, D)))
fytrain = acq.sample_training_output(ytrain)

# Step 3 - 6
for t in range(0, max_iter):
    # Set of points to be tested
    ytest = np.matrix(np.random.uniform(-5, 5, (n_test, D)))

    # Get mu and sigma
    mu, sigma = acq.gp_posterior(ytrain, ytest, fytrain, sigma_0, n_test)

    # Find ybest
    ybest = acq.gp_optimize(ytest, t, D, mu, sigma, n_test)

    # Augment the data
    ytrain, fytrain = acq.augment_data(ytrain, fytrain, ybest)

    print ybest
コード例 #4
0
ファイル: main_rembo.py プロジェクト: Jsalim/air2014
# Step 3 - 6
#ytrain : D dimensional dataset
#ytest: Y subset
#fytrain: sample from dataset (ytrain)



for t in range(0, max_iter):
  number_of_samples =  t+1

  #Step 3 : sample out of y , and create Y
  Y = acq.select_sample_set(number_of_samples,y)



  # Select points from bounded box to be tested
  #ytest =Y
  #ytest = acq.select_test_set(n_test, Y)

  # Get mu and sigma
  mu, sigma, ybest = acq.gp_posterior(ytrain, sigma, ytest, fytrain, A, t, d, number_of_samples)

  # Find ybest
  # ybest = acq.gp_optimize(ytest, t, D, mu, sigma, n_test)

  # Augment the data
  # ytrain, fytrain = acq.augment_data(ytrain, fytrain, ybest, A)

  print ybest