neuromancer.slim.butterfly.permutation module

class neuromancer.slim.butterfly.permutation.FixedPermutation(permutation)[source]

Bases: Module

forward(input)[source]
Parameters:

input – (batch, size) if real or (batch, size, 2) if complex

Returns:

(batch, size) if real or (batch, size, 2) if complex

Return type:

output

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

extra_repr()[source]

Set the extra representation of the module.

To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.

forward(input)[source]
Parameters:

input – (batch, size) if real or (batch, size, 2) if complex

Returns:

(batch, size) if real or (batch, size, 2) if complex

Return type:

output

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

extra_repr()[source]

Set the extra representation of the module.

To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.

forward(input)[source]
Parameters:

input – (batch, size) if real or (batch, size, 2) if complex

Returns:

(batch, size) if real or (batch, size, 2) if complex

Return type:

output