🏃♂️
This file contains 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
from kurobako import problem | |
class BinhAndKornProblemFactory(problem.ProblemFactory): | |
def specification(self): | |
params = [ | |
problem.Var("x", problem.ContinuousRange(0, 5)), | |
problem.Var("y", problem.ContinuousRange(0, 3)), | |
] | |
return problem.ProblemSpec( |
This file contains 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 matplotlib.pyplot as plt | |
import numpy as np | |
from scipy.stats import norm | |
from scipy.special import erfcinv | |
import optuna | |
def objective(trial): | |
# Suggest from U(0, 1) with Optuna. |
This file contains 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 argparse | |
import math | |
import time | |
import sqlalchemy | |
import optuna | |
class Profile: |
This file contains 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 lightgbm as lgb | |
import numpy as np | |
import pandas as pd | |
import sklearn.datasets | |
from sklearn.datasets import fetch_openml | |
import sklearn.metrics | |
from sklearn.model_selection import train_test_split | |
import optuna |
This file contains 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 optuna | |
def objective(trial): | |
x = trial.suggest_int("x", 0, 2) | |
y = trial.suggest_float("y", -1.0, 1.0) | |
z = trial.suggest_float("z", 0.0, 1.5) | |
return x ** 2 + y ** 3 - z ** 4 | |
study = optuna.create_study(sampler=optuna.samplers.RandomSampler()) | |
study.optimize(objective, n_trials=100) |
This file contains 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
FROM optuna/optuna:py3.7-dev | |
RUN apt-get update | |
# Compile sqlite with a low SQLITE_MAX_VARIABLE_NUMBER. | |
RUN mkdir sqlite3_tmp | |
WORKDIR sqlite3_tmp | |
RUN wget https://www.sqlite.org/src/tarball/sqlite.tar.gz | |
RUN tar zxf sqlite.tar.gz | |
ENV CFLAGS -DSQLITE_ENABLE_FTS3 \ |
This file contains 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 | |
import optuna | |
from optuna import visualization | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
import torch.utils.data | |
from torchvision import datasets |
This file contains 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
""" | |
Plots importances evaluated by fANOVA (AutoML.org) and Fanova (sklearn based implementation). | |
1. Loads data from csv containing parameter configuration-objective value pairs. | |
2. Loads search space definitions from csv. | |
3. Evaluates all single and pairwise importances between parameters. | |
4. Repeats evaluation N times (with different random seeds). | |
5. Plots the average over N evaluations. | |
""" | |
import argparse |
This file contains 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
from collections import OrderedDict | |
import time | |
from matplotlib import pyplot as plt | |
import optuna | |
from optuna import samplers | |
from optuna.storages import RDBStorage | |
from optuna.storages import RedisStorage | |
This file contains 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 logging | |
import threading | |
import time | |
import joblib | |
import tqdm | |
class TqdmLoggingHandler(logging.StreamHandler): | |
def emit(self, record): |
NewerOlder