Skip to content

Instantly share code, notes, and snippets.

@SnowMasaya
Last active June 28, 2018 23:22
Show Gist options
  • Save SnowMasaya/8863f50827a0fab14d32d00bf3053842 to your computer and use it in GitHub Desktop.
Save SnowMasaya/8863f50827a0fab14d32d00bf3053842 to your computer and use it in GitHub Desktop.
KerasによるLSTMの高速化: cuDNNLSTM ref: https://qiita.com/GushiSnow/items/65975667482291329bd5
pip install git+https://github.com/fchollet/keras.git
model = Sequential()
model.add(CuDNNLSTM(hidden_number))
x = CuDNNLSTM(hidden_number)(x)
params = self._canonical_to_params(
weights=[
self.kernel_r,
self.kernel_z,
self.kernel_h,
self.recurrent_kernel_r,
self.recurrent_kernel_z,
self.recurrent_kernel_h,
],
biases=[
self.bias_r_i,
self.bias_z_i,
self.bias_h_i,
self.bias_r,
self.bias_z,
self.bias_h,
],
)
RNNParamsSaveable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment