Created
July 20, 2021 06:15
-
-
Save lazuxd/663971033be87085772c824c0832ccc6 to your computer and use it in GitHub Desktop.
This file contains 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
def _init_gru(self): | |
for s in ['wr', 'wu', 'wa']: | |
setattr(self, s, [tf.Variable(tf.random.normal( | |
stddev=std_dev, | |
shape=shape, | |
dtype=tf.double)) | |
for shape, std_dev in self.w_shapes]) | |
for s in ['br', 'bu', 'ba']: | |
setattr(self, s, [tf.Variable(tf.random.normal( | |
stddev=std_dev, | |
shape=shape, | |
dtype=tf.double)) | |
for shape, std_dev in self.b_shapes]) | |
all_weights = [] | |
for w in [self.wr, self.br, self.wu, self.bu, self.wa, self.ba]: | |
all_weights.extend(w) | |
return all_weights |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment