Last active
June 28, 2018 23:22
-
-
Save SnowMasaya/8863f50827a0fab14d32d00bf3053842 to your computer and use it in GitHub Desktop.
KerasによるLSTMの高速化: cuDNNLSTM ref: https://qiita.com/GushiSnow/items/65975667482291329bd5
This file contains hidden or 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
pip install git+https://github.com/fchollet/keras.git |
This file contains hidden or 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
model = Sequential() | |
model.add(CuDNNLSTM(hidden_number)) |
This file contains hidden or 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
x = CuDNNLSTM(hidden_number)(x) |
This file contains hidden or 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
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, | |
], | |
) |
This file contains hidden or 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
RNNParamsSaveable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment