models.py
def forward(self, log_alpha, use_max):
		"""
		log_alpha : Tensor of shape (batch size, N)

		Multiply previous timestep's alphas by transition matrix (in log domain)
		"""
		# Each col needs to add up to 1 (in probability domain)
		log_transition_matrix = torch.nn.functional.log_softmax(self.unnormalized_transition_matrix, dim=0)

		# Matrix multiplication in the log domain
		#out = genbmm.logbmm(log_alpha.unsqueeze(0).contiguous(), transition_matrix.unsqueeze(0).contiguous())[0]
		if use_max:
			out1, out2 = maxmul(log_transition_matrix, log_alpha.transpose(0,1))
			return out1.transpose(0,1), out2.transpose(0,1)
		else:
			out = log_domain_matmul(log_transition_matrix, log_alpha.transpose(0,1))
			out = out.transpose(0,1)
			return out

		log_alpha : Tensor of shape (batch size, N)

		Multiply previous timestep's alphas by transition matrix (in log domain)
		
log_alpha : Tensor of shape (batch size, N)
Multiply previous timestep's alphas by transition matrix (in log domain)
log_alpha : Tensor of shape ( batch size N ) Multiply previous timestep ' s alphas by transition matrix ( in log domain )
def forward(self, log_alpha, use_max):
		log_transition_matrix = torch.nn.functional.log_softmax(self.unnormalized_transition_matrix, dim=0)
		if use_max:
			out1, out2 = maxmul(log_transition_matrix, log_alpha.transpose(0,1))
			return out1.transpose(0,1), out2.transpose(0,1)
		else:
			out = log_domain_matmul(log_transition_matrix, log_alpha.transpose(0,1))
			out = out.transpose(0,1)
			return out
def forward ( self , log_alpha , use_max ) : log_transition_matrix = torch . nn . functional . log_softmax ( self . unnormalized_transition_matrix , dim = 0 ) if use_max : out1 , out2 = maxmul ( log_transition_matrix , log_alpha . transpose ( 0 , 1 ) ) return out1 . transpose ( 0 , 1 ) , out2 . transpose ( 0 , 1 ) else : out = log_domain_matmul ( log_transition_matrix , log_alpha . transpose ( 0 , 1 ) ) out = out . transpose ( 0 , 1 ) return out
log_alpha : Tensor of shape (batch size, N)
Multiply previous timestep's alphas by transition matrix (in log domain)
log_alpha : Tensor of shape ( batch size N ) Multiply previous timestep ' s alphas by transition matrix ( in log domain )
"""
		log_alpha : Tensor of shape (batch size, N)

		Multiply previous timestep's alphas by transition matrix (in log domain)
		""" # Each col needs to add up to 1 (in probability domain) # Matrix multiplication in the log domain #out = genbmm.logbmm(log_alpha.unsqueeze(0).contiguous(), transition_matrix.unsqueeze(0).contiguous())[0]
self
log_alpha
use_max