Skip to content

Instantly share code, notes, and snippets.

@yukiB
yukiB / file0.txt
Last active November 24, 2017 08:11
【Python】QRNNでカオス時系列データ予測【Keras】 ref: https://qiita.com/yukiB/items/681f68690ffabbf3e1e1
Z = tanh(W_z * X)\\
F = \sigma(W_f * X)\\
O = \sigma(W_o * X)
@yukiB
yukiB / file0.cljs
Created October 6, 2017 02:01
ClojureScriptでページ内URL操作(pushState, popState) ref: http://qiita.com/yukiB/items/ec7f80be0b36735f1b5c
(def data (atom {}))
...
;; pushState
(-> js/window .-history (.pushState #js {:data (pr-str data)} nil (str "/url"))))
;; popState
(set! (.-onpopstate js/window)
#(when-not (nil? (aget % "state"))
@yukiB
yukiB / continuous.py(161~165行目)
Last active October 6, 2017 01:46
Pythonで連続ウェーブレット変換(scipy, mlpy, swan) ref: http://qiita.com/yukiB/items/59f8484e72bb0471ad47
J = floor(dj**-1 * log2((N * dt) / s0))
s = empty(int(J) + 1)
for i in range(s.shape[0]):
s[i] = s0 * 2**(i * dj)
@yukiB
yukiB / client.js
Last active August 4, 2017 06:39
ElectronでSplatoon2のルール・エリア通知desktopアプリを作成する ref: http://qiita.com/yukiB/items/7afc51894cce9b973d78
// client(web page)側
const {ipcRenderer} = require('electron')
console.log(ipcRenderer.sendSync('synchronous-message', 'ping')) // prints "pong"
ipcRenderer.on('asynchronous-reply', (event, arg) => {
console.log(arg) // prints "pong"
})
ipcRenderer.send('asynchronous-message', 'ping')
@yukiB
yukiB / file0.txt
Last active May 27, 2017 01:53
Pythonでバックグラウンド実行中にキー入力を取得する(windows) ref: http://qiita.com/yukiB/items/586b20c58b16b5d3917c
wheel install pyHook‑1.5.1‑cp36‑cp36m‑win_amd64.whl
@yukiB
yukiB / file0.txt
Last active May 23, 2017 13:01
JavaScript(ES6)で辞書内包表記 ref: http://qiita.com/yukiB/items/87ab3f313a75b547c278
>>> [i * 2 for i in range(10)]
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
@yukiB
yukiB / file0.txt
Last active July 25, 2018 22:29
[Python]KerasをTensorFlowから,TensorFlowをc++から叩いて実行速度を上げる ref: http://qiita.com/yukiB/items/1ea109eceda59b26cd64
# モデル作成
model = Sequential()
model.add(InputLayer(input_shape=input_shape, name='input'))
model.add(Dense(nb_classes))
model.add(Activation('softmax', name='softmax'))
optimizer = SGD(lr=0.5)
model.compile(loss='categorical_crossentropy',
optimizer=optimizer,
metrics=['accuracy'])
@yukiB
yukiB / file0.txt
Last active October 20, 2017 06:59
[Python]強化学習(DQN)を実装しながらKerasに慣れる ref: http://qiita.com/yukiB/items/0a3faa759ca5561e12f8
# input layer (8 x 8)
self.x = tf.placeholder(tf.float32, [None, 8, 8])
# flatten (64)
x_flat = tf.reshape(self.x, [-1, 64])
# fully connected layer (32)
W_fc1 = tf.Variable(tf.truncated_normal([64, 64], stddev=0.01))
b_fc1 = tf.Variable(tf.zeros([64]))
@yukiB
yukiB / file0.txt
Created February 10, 2017 06:07
[Python]SQLAlchemyのエラー回避備忘録 ref: http://qiita.com/yukiB/items/67336716b242df3be350
_mysql_exceptions.OperationalError: (2006, 'MySQL server has gone away')
@yukiB
yukiB / file0.txt
Last active October 24, 2017 17:43
[Python] SQLAlchemyを頑張って高速化 ref: http://qiita.com/yukiB/items/d6a70da802cb5731dc01
team_list = ['A', 'B',...,'Z']
user_list = [('John', 14, 'C'), ...]