Skip to content

Instantly share code, notes, and snippets.

@lazuxd
Created July 20, 2021 06:23
Show Gist options
  • Save lazuxd/94d31f22a5e45fe93be863ad80a1c52b to your computer and use it in GitHub Desktop.
Save lazuxd/94d31f22a5e45fe93be863ad80a1c52b to your computer and use it in GitHub Desktop.
def reset_state(self, num_samples: int) -> None:
def get_init_values():
return [tf.zeros((num_samples, self.inter_time_step_size),
dtype=tf.double) for i in range(self.depth)]
self.a = get_init_values()
if self.unit_type == 'lstm':
self.c = get_init_values()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment