How to use the sru.sru.SRU function in sru

To help you get started, we’ve selected a few sru examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github musyoku / chainer-sru / sru / sru.py View on Github external
def __init__(self, channels, use_tanh=True, dropout=0, initialW=None, initial_bias=0):
		super(SRU, self).__init__()
		self.channels = channels
		self.use_tanh = use_tanh
		self.dropout = dropout

		with self.init_scope():
			self.W = variable.Parameter(initializers._get_initializer(initialW))
			self.B = variable.Parameter(initializers._get_initializer(initial_bias))

			if channels is not None:
				self._initialize_params(channels)