Esempio n. 1
0
    end_range = n * leaf_size + start_range + 1
    pixel_range = np.arange(start_range, end_range, leaf_size)
    sample_range_x = np.round(grid_x, 1)
    sample_range_y = np.round(grid_y, 1)
    plt.xticks(pixel_range, sample_range_x)
    plt.yticks(pixel_range, sample_range_y)
    plt.xlabel("z[0]")
    plt.ylabel("z[1]")
    plt.imshow(figure, cmap='Greys_r')
    plt.savefig(filename)
    plt.show()


######## Code ########
# Set up the data given to us
train_list, test_list, train_ids, test_ids, train, test, y, y_train, classes = data_setup.data(
)

# fit_transform() calculates the mean and std and also centers and scales data
x_train = StandardScaler().fit_transform(train)
x_test = StandardScaler().fit_transform(test)

# We need to reshape our images so they are all the same dimensions
train_mod_list = data_setup.reshape_img(train_list, global_max_dim)
test_mod_list = data_setup.reshape_img(test_list, global_max_dim)

# Grab the dimensions we are using for our images
image_size = global_max_dim
# Find the flattened size
original_dim = image_size * image_size

# Set up our validation set (10% of data)
Esempio n. 2
0
import model
from matplotlib import pyplot as plt
import cornerplot
import time
import json
import os
import csv

start = time.time()

n_params = len(parameters)

output_directory = 'out/'
os.makedirs(os.path.dirname(output_directory), exist_ok=True)

x, x_full, opacity_grid, bin_indices, ydata, yerr, wavelength_centre, wavelength_err = data_setup.data(
)
len_x = len(x)

## Run PyMultinest ##
b = ns_setup.Priors(1, n_params)
pymultinest.run(
    b.loglike,
    b.prior,
    n_params,
    loglike_args=[len_x, x_full, bin_indices, opacity_grid, ydata, yerr],
    outputfiles_basename=output_directory + planet_name + '_',
    resume=False,
    verbose=True,
    n_live_points=live)

json.dump(parameters, open(output_directory + planet_name + '_params.json',
import model
from matplotlib import pyplot as plt
import cornerplot
import time
import json
import os
import csv

start = time.time()

n_params = len(parameters)

output_directory = '/home/aline/Desktop/PhD/HELIOS-T-master/out/'
os.makedirs(os.path.dirname(output_directory), exist_ok=True)

x, x_full, integral_grid, bin_indices, ydata, yerr, wavelength_centre, wavelength_err = data_setup.data(
)
len_x = len(x)

## Run PyMultinest ##
b = ns_setup.Priors(1, n_params)
pymultinest.run(
    b.loglike,
    b.prior,
    n_params,
    loglike_args=[len_x, x_full, bin_indices, integral_grid, ydata, yerr],
    outputfiles_basename=output_directory + planet_name + '_',
    resume=False,
    verbose=True,
    n_live_points=live)

json.dump(parameters, open(output_directory + planet_name + '_params.json',