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 time | |
import optuna | |
import optuna_distributed | |
def objective(trial): | |
x = trial.suggest_float("x", -100, 100) | |
y = trial.suggest_categorical("y", [-1, 0, 1]) | |
time.sleep(1.0) |
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
sequential_start = time.time() | |
study = optuna.create_study() | |
study.optimize(objective, n_trials=20) | |
sequential_duration = time.time() - sequential_start | |
sequential_best_value = study.best_value | |
distributed_start = time.time() | |
distributed_study = optuna_distributed.from_study(study) | |
distributed_study.optimize(objective, n_trials=20) | |
distributed_duration = time.time() - distributed_start |
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
def objective(trial): | |
x = trial.suggest_float("x", -100, 100) | |
y = trial.suggest_categorical("y", [-1, 0, 1]) | |
time.sleep(1.0) | |
return x**2 + y |
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 time | |
import optuna | |
import sklearn.datasets | |
import sklearn.ensemble | |
import sklearn.model_selection | |
import sklearn.svm | |
from optuna.integration.wandb import WeightsAndBiasesCallback | |
import wandb |
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 cv2 | |
import requests | |
import platform | |
import numpy as np | |
import tflite_runtime.interpreter as tflite | |
IMG = { | |
'fname': 'test_img.jpg', | |
'origin': '1ew-FdIdrhks9yw8fDXc14uuxWUfmdqaD' |