neuromancer.slim.butterfly.permutation module
- class neuromancer.slim.butterfly.permutation.Permutation(size, share_logit=False, increasing_stride=False)[source]
Bases:
Module
Product of log N permutation factors.
- Parameters:
size – size of input (and of output)
share_logit – whether the logits in the permutation factors are shared. If True, will have 4N parameters, else will have 2 N log N parameters (not counting bias)
increasing_stride – whether to multiply from smaller stride to larger stride, or in the reverse order.
- argmax()[source]
- Returns:
(self.size, ) array of int, the most probable permutation.
- Return type:
p
- class neuromancer.slim.butterfly.permutation.PermutationFactor(size)[source]
Bases:
Module
A single permutation factor.
- Parameters:
size – size of input (and of output)
- argmax()[source]
- Returns:
(self.size, ) array of int, the most probable permutation.
- Return type:
p