404 – Page not found
404 – Page not found -
The requested URL could not be found on this server.
If you entered the URL manually please check your spelling and try again.
If you think this is a server error please use our contact form to let us know.
makitweb/titanape<|file_sep|>/examples/non_linear/convergence.py
import numpy as np
import matplotlib.pyplot as plt
import pickle
import os
import pandas as pd
from titanape.kernels import GaussianKernel
class NonLinearConvergence:
def __init__(self):
self.plot_hyperparameters = False
self.n_fidelities = 5
self.domain_size = [0,1]
self.bounds = [(0,1),(0,1)]
self.kernel = GaussianKernel()
self.sobol_file = os.path.join("data", "sobol_max_200d_set_5_numbers_cleaned_lasttofirst.txt")
self.fidelities_per_batch = [25]
self.num_fidelities = len(self.fidelities_per_batch)
self.batch_fidelities = [i for i in range(num_fidelities)]
self.num_candidates_search = 100
self.seed = np.random.randint(0,1000)
print("seed", self.seed)
np.random.seed(self.seed)
self.true_batch_size = self.num_candidates_search
self.batch_ratio = [self.true_batch_size/size for size in self.fidelities_per_batch]
def generate_hierarchical_base_design(self):
input_file = open(self.sobol_file,"r")
lines = input_file.readlines()
example_per_line = int(lines[0])
# balance the dataset
batches = []
max_fidelity = self.fidelities_per_batch[-1]
example_per_fidelity = example_per_line//