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
optuna ❯ python optuna_create_trial.py | |
Optuna version: 2.3.0 | |
[I 2020-12-20 16:15:44,324] A new study created in memory with name: no-name-e5c3d5a2-c5b0-43a6-91d0-d20150726e9d | |
optuna_create_trial.py:12: ExperimentalWarning: create_trial is experimental (supported from v2.0.0). The interface can change in the future. | |
trial: optuna.trial.FrozenTrial = optuna.trial.create_trial(value=-80, params={"x": -5}) | |
Traceback (most recent call last): | |
File "optuna_create_trial.py", line 20, in <module> | |
main() | |
File "optuna_create_trial.py", line 12, in main | |
trial: optuna.trial.FrozenTrial = optuna.trial.create_trial(value=-80, params={"x": -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
If you want to use VSCode's fantastic feature: Dev Container, put the `devcontainer.json` in `.devcontainer` directory. |
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
// ref: https://www.youtube.com/watch?v=VIz6xBvwYd8 | |
#include <stdio.h> | |
#include <type_traits> | |
#include <memory> | |
template <typename Element> | |
struct tree_iterator { | |
tree_iterator& operator ++(); |
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://youtu.be/7DTlWPgX6zs | |
// x86-64 Clang 9 | |
// opts: either `-std=c++17 --pedantic-errors` or `-std=c++14 --pedantic-errors` | |
#include <vector> | |
#include <string> | |
#include <atomic> | |
long long getLongInt(); | |
struct C{}; |
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
// Type your code here, or load an example. | |
#include <string> | |
#include <map> | |
using namespace std; | |
// https://youtu.be/hEx5DNLWGgA?t=4261 | |
void f(void) { |
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
// ref: https://stackoverflow.com/a/39990387 | |
#include <iostream> | |
#include <vector> | |
#include <omp.h> | |
struct Value { | |
Value(void) : x(-1) {} | |
Value(float x) : x(x) {} | |
float x; |
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
Collecting pip | |
[?25l Downloading https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl (1.4MB) | |
[?25hInstalling collected packages: pip | |
Found existing installation: pip 19.3.1 | |
Uninstalling pip-19.3.1: | |
Successfully uninstalled pip-19.3.1 | |
Successfully installed pip-20.0.2 | |
Obtaining file:///opt | |
Collecting alembic |
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 inspect | |
from typing import (Any, Callable, Tuple) | |
def str_func_name_args( | |
func: Callable[[Any], Any] | |
) -> Tuple[str, Callable[[Any], Any]]: | |
name = func.__name__ | |
argspec = inspect.getfullargspec(func) |
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
# Copied from https://blog.amedama.jp/entry/lightgbm-custom-metric (written in Japanese) | |
from lightgbm import callback | |
import lightgbm as lgb | |
import numpy as np | |
from sklearn import datasets | |
from sklearn.model_selection import train_test_split | |
def accuracy(preds, data): | |
y_true = data.get_label() |
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
[[source]] | |
name = "pypi" | |
url = "https://pypi.org/simple" | |
verify_ssl = true | |
[dev-packages] | |
[packages] | |
tensorflow = "*" | |
optuna = {editable = true,git = "https://github.com/optuna/optuna.git"} |