Skip to content

Instantly share code, notes, and snippets.

View hppRC's full-sized avatar
🏠
sleepy

Hayato Tsukagoshi hppRC

🏠
sleepy
View GitHub Profile
{"lastUpload":"2020-04-04T07:45:57.757Z","extensionVersion":"v3.4.3"}
@hppRC
hppRC / 📊 Weekly development breakdown
Last active October 29, 2020 00:05
Weekly development breakdown🔥
Python 3 hrs 45 mins ██████████▌░░░░░░░░░░ 50.0%
Markdown 2 hrs 38 mins ███████▍░░░░░░░░░░░░░ 35.1%
TypeScript 37 mins █▋░░░░░░░░░░░░░░░░░░░ 8.2%
JSON 19 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.2%
JavaScript 5 mins ▎░░░░░░░░░░░░░░░░░░░░ 1.3%
N_TRIALS=10
STORAGE=sqlite:///example.db
STUDY_NAME=`optuna create-study --storage $STORAGE`
DISTRIBUTIONS=`cat distributions.json`
for _ in `seq 1 $N_TRIALS`; do
trial=`optuna ask \
--storage $STORAGE \
--study-name $STUDY_NAME \
from tqdm import tqdm
for i in tqdm(list(range(100)), position=0):
for batch in tqdm(list(range(10000000)), position=1):
pass
import hoge.a
print(__file__)
@hppRC
hppRC / install-jumanppv2.sh
Created January 4, 2023 07:07
Juman++ V2のインストール手順
ORIGIN_DIR=$(pwd)
JUMANPP_DIR="$HOME/.local/share/jumanpp"
mkdir -p $JUMANPP_DIR
cd $JUMANPP_DIR
curl -LO https://github.com/ku-nlp/jumanpp/releases/download/v2.0.0-rc3/jumanpp-2.0.0-rc3.tar.xz
tar -xf jumanpp-2.0.0-rc3.tar.xz
cd jumanpp-2.0.0-rc3
@hppRC
hppRC / print_params.py
Created December 15, 2023 03:27
モデルパラメータをわかりやすく表示するやつ
def format_param_with_unit(num_params: int) -> str:
if num_params >= 1000 * 1000 * 1000:
unit = "B"
num_params /= 1000 * 1000 * 1000
elif num_params >= 1000 * 1000:
unit = "M"
num_params /= 1000 * 1000
elif num_params >= 1000:
unit = "K"
num_params /= 1000