Skip to content

Instantly share code, notes, and snippets.

@TsuMakoto
TsuMakoto / ReinforcementLearning_sample_CartPoleEnv.jl
Created December 24, 2019 00:52
ReinforcementLearning.jlのサンプル
using Pkg; Pkg.add.(["ReinforcementLearning", "ReinforcementLearningEnvironments", "Flux", "StatsBase", "Plots"])
# import Random # hide
# Random.seed!(1) # hide
using ReinforcementLearning, ReinforcementLearningEnvironments, Flux
# using StatsBase:mean
env = CartPoleEnv(;T=Float32)
ns, na = length(observation_space(env)), length(action_space(env)) # (4, 2)
@TsuMakoto
TsuMakoto / TuringjlTest.ipynb
Last active November 16, 2020 16:27
https://turing.ml/v0.14/tutorials/3-bayesnn/ のチュートリアルを動くように
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TsuMakoto
TsuMakoto / RentalPartyData.csv
Last active November 30, 2020 08:52
レンタルパーティの画像を収集し、解析した結果 (formはリージョンフォルム等)
party_id name ability item weapon1 weapon2 weapon3 weapon4 id form type1 type2 h a b c d s
1 サザンドラ ふゆう こだわりスカーフ あくのはどう りゅうせいぐん かえんほうしゃ とんぼがえり 1 1 あく ドラゴン 92 105 90 125 90 98
1 ミミッキュ ばけのかわ いのちのたま かげうち シャドークロー じゃれつく つるぎのまい 2 1 ゴースト フェアリー 55 90 80 50 105 96
1 ドリュウズ かたやぶり きあいのタスキ じしん アイアンヘッド がんせきふうじ つのドリル 3 1 じめん はがね 110 135 60 50 65 88
1 ロトム ふゆう こだわりメガネ ハイドロポンプ 10まんボルト ボルトチェンジ トリック 4 3 でんき みず 50 65 107 105 107 86
1 カビゴン あついしぼう とつげきチョッキ のしかかり ヘビーボンバー かみなりパンチ じわれ 5 1 ノーマル 160 110 65 65 110 30
1 アーマーガア ミラーアーマー オボンのみ ブレイブバード ボディプレス てっぺき はねやすめ 6 1 ひこう はがね 98 87 105 53 85 67
2 ピカチュウ せいでんき でんきだま ボルテッカー じゃれつく ねこだまし かわらわり 7 1 でんき 35 55 40 50 50 90
2 バタフリー ふくがん きあいのタスキ ぼうふう ねむりごな ギガドレイン ちょうのまい 8 1 むし ひこう 60 45 50 90 80 70
2 カビゴン くいしんぼう フィラのみ からげんき じしん ほのおのパンチ はらだいこ 9 1 ノーマル 160 110 65 65 110 30
@TsuMakoto
TsuMakoto / 2x2_problem.py
Last active March 23, 2021 11:00
gamma-poissonモデルとdynamic-gamma-poissonモデル
import math
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import gamma, poisson
# parameters
E_p0 = 0.088
g = 500
a = E_p0 * g
@TsuMakoto
TsuMakoto / atomic_macro_test.jl
Created December 18, 2021 20:35
NennmatsuLT2021 - demo
module Basic01
function main()
Threads.@threads for i = 1:10
println("(threadid, loop_number) = ($(Threads.threadid()), $(i))")
end
end
end; Basic01.main()
import sys
# Deliver more ore to hq (left side of the map) than your opponent. Use radars to find ore but beware of traps!
def std_err(args):
print(args, file=sys.stderr, flush=True)
def get_line():
i = input()
std_err(i)
return i