This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://ax.dev/tutorials/multiobjective_optimization.html | |
import warnings | |
import ax | |
import torch | |
import numpy as np | |
from ax.metrics.noisy_function import NoisyFunctionMetric |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import torch | |
if torch.cuda.is_available(): | |
print('Using CUDA...') | |
torch.set_default_tensor_type(torch.cuda.FloatTensor) | |
# Ax Service API seems like the right level of abstraction? | |
from ax.service.ax_client import AxClient |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygmo as pg | |
class TestProblem: | |
def fitness(self, x): | |
param_1 = x[0] | |
param_2 = x[1] | |
metric_1 = 2 * param_1 | |
metric_2 = 2 * param_2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' | |
import tensorflow as tf | |
import numpy as np | |
BATCH_SIZE = 8 | |
WINDOW_SIZE = 5 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# os.environ["CUDA_VISIBLE_DEVICES"] = "-1" | |
import tensorflow as tf | |
root_dir = os.path.dirname(os.path.abspath(__file__)) | |
os.makedirs('test_files', exist_ok=True) | |
for i_dummy_file in range(10): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import tensorflow as tf | |
# Write test tfrecord | |
def _serialise_element(value): | |
elements = {'label_1': _float_feature(float(value))} | |
elements_proto = tf.train.Example(features=tf.train.Features(feature=elements)) | |
return elements_proto.SerializeToString() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from keras.layers.core import Dense, Activation, Dropout | |
from keras.layers import CuDNNLSTM, LSTM | |
from keras.models import Sequential | |
from keras.models import load_model | |
from keras import optimizers | |
from keras.engine.saving import preprocess_weights_for_loading | |
sample_size = 100 |