Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 get_optuna_minimizer(n_trials, study=None): | |
if study is None: | |
study = optuna.create_study() | |
def minimizer(objective, n_params): | |
def optuna_objective(trial): | |
params = [trial.suggest_uniform(f'params[{i}]', 0.0, 1.0) for i in range(n_params)] | |
return objective(params) | |
study.optimize(optuna_objective, n_trials=n_trials) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 nvidia/cuda:9.2-runtime-ubuntu16.04 | |
RUN apt update && \ | |
apt install -y --no-install-recommends apt-transport-https curl python-pip python-setuptools ipython && \ | |
. /etc/lsb-release && \ | |
(echo "deb [arch=amd64] https://shinmorino.github.io/sqaod/ubuntu ${DISTRIB_CODENAME} multiverse" | tee /etc/apt/sources.list.d/sqaod.list) && \ | |
(curl -s -L https://shinmorino.github.io/sqaod/gpgkey | apt-key add -) && \ | |
apt update && apt install -y libsqaodc libsqaodc-dev libsqaodc-cuda-9-2 && pip install sqaod | |
CMD ipython |
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
function c | |
if test (count $argv) -eq 0 | |
cd | |
else if test (count $argv) -gt 1 | |
echo "Too many arguments" >&2 | |
else if test -d $argv[1] | |
cd $argv[1] | |
else if test ! -e $argv[1] | |
echo "Not exists" >&2 | |
else if test (head -26 $argv[1] | wc -l) -lt 26 |
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
// This software contains source code provided by NVIDIA Corporation. | |
// http://docs.nvidia.com/cuda/eula/index.html#nvidia-cuda-samples-end-user-license-agreement | |
#include <cuda_runtime.h> | |
__global__ void reduce0(int *g_idata, int *g_odata, unsigned int n) | |
{ | |
// shared memoryは、うまく使えば速度が速い。(ここでは、うまく使ってない。後で直す) | |
// 同じブロック内のスレッド間で共有される。 | |
extern __shared__ int sdata[]; |
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
#include <stdio.h> | |
#include <inttypes.h> | |
#include <stdlib.h> | |
#include <cuda_runtime.h> | |
#include <curand_kernel.h> | |
__constant__ uint8_t seq[75]; | |
__device__ void make_card(uint8_t *card) | |
{ |
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
#![allow(unused_macros, unused_imports, dead_code)] | |
use std::io::*; | |
use std::collections::*; | |
fn read_line() -> String { | |
let mut s = String::new(); | |
stdin().read_line(&mut s).unwrap(); | |
s | |
} |
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
macro_rules! let_from_str { | |
($($a:ident : $t:ty),+ = $s:expr) => { | |
$(let $a: $t;)+ | |
{ | |
let mut _it = $s.split_whitespace(); | |
$($a = _it.next().unwrap().parse().unwrap();)+ | |
assert!(_it.next().is_none()); | |
} | |
}; | |
} |
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
macro_rules! let_from_iter { | |
($($a:ident),+ = $it:expr) => { | |
$(let $a;)+ | |
{ | |
let mut _it = $it.into_iter(); | |
$($a = _it.next().unwrap();)+ | |
assert!(_it.next().is_none()); | |
} | |
}; | |
} |