MCPcopy Create free account

hub / github.com/HazyResearch/butterfly / functions

Functions1,242 in github.com/HazyResearch/butterfly

↓ 66 callersMethodmatrix
Matrix form of the butterfly matrix
learning_transforms/butterfly_old.py:74
↓ 57 callersMethodbackward
(ctx, grad)
learning_transforms/sparsemax.py:53
↓ 27 callersFunctionbitreversal_permutation
Return the bit reversal permutation used in FFT. By default, the permutation is stored in numpy array. Parameter: n: integer, must be
torch_butterfly/permutation.py:14
↓ 26 callersFunctionbitreversal_permutation
Return the bit reversal permutation used in FFT. Parameter: n: integer, must be a power of 2. Return: perm: bit reversal permu
butterfly/utils.py:8
↓ 23 callersFunctioncomplex_matmul
(X, Y)
torch_butterfly/complex_utils.py:94
↓ 23 callersFunctionreal_to_complex
A version of X that's complex (i.e., last dimension is 2). Parameters: X: (...) tensor Return: X_complex: (..., 2) tensor
butterfly/complex_utils.py:40
↓ 20 callersMethodmatrix
(self, temperature=1.0)
learning_transforms/butterfly_old.py:177
↓ 19 callersFunctionto_python_float
(t)
cnn/imagenet_experiment.py:233
↓ 18 callersFunctiondiagonal_butterfly
Combine a Butterfly and a diagonal into another Butterfly. Only support nstacks==1 for now. Parameters: butterfly: Butterfly(in_s
torch_butterfly/combine.py:11
↓ 16 callersMethodlog_metric
(self, metric_name, val, n=1)
cnn/imagenet/logger.py:110
↓ 16 callersMethodregister_metric
(self, metric_name, meter, log_level=0)
cnn/imagenet/logger.py:105
↓ 16 callersFunctionsemantic_loss_exactly_one
Semantic loss to encourage the multinomial probability to be "peaked", i.e. only one class is picked. The loss has the form -log sum_{i=1}^n p
learning_transforms/semantic_loss.py:35
↓ 14 callersFunctionbn
(planes, init_zero=False)
cnn/models/resnet_imagenet.py:42
↓ 13 callersMethodbackward
(ctx, grad)
cnn/models/circulant1x1conv.py:63
↓ 12 callersMethod__init__
A butterfly matrix where only the diagonal and the k-th subdiagonal and superdiagonal are nonzero. Parameters: size: size
learning_transforms/butterfly_old.py:36
↓ 12 callersMethodargmax
Return: p: (self.size, ) array of int, the most probable permutation.
learning_transforms/butterfly_old.py:585
↓ 11 callersFunctiontorch2cupy
(tensor)
butterfly/complex_utils.py:32
↓ 10 callersMethod__init__
(self, block, num_blocks, num_classes=10)
convolution/models/resnet_cifar.py:63
↓ 10 callersFunctionpolymatmul
Batch-multiply two matrices of polynomials Parameters: A: (N, batch_size, n, m, d1) B: (batch_size, m, p, d2) Returns:
learning_transforms/ops.py:10
↓ 10 callersFunctiontwiddle_normal_to_fast_format
Convert twiddle stored in the normal format to the fast format. Parameters: twiddle: (nstack, log_n, n / 2, 2, 2) Returns: twi
butterfly/utils.py:24
↓ 9 callersMethodargmax
Return: p: (self.size, ) array of int, the most probable permutation.
butterfly/permutation.py:41
↓ 9 callersFunctionbutterfly_ortho_mult_untied
(twiddle, input, increasing_stride)
butterfly/butterfly_multiply.py:304
↓ 9 callersMethodclose
(self)
convolution/tee.py:84
↓ 9 callersFunctionfft
Construct an nn.Module based on Butterfly that exactly performs the FFT. Parameters: n: size of the FFT. Must be a power of 2. no
torch_butterfly/special.py:19
↓ 9 callersMethodupdate
(self, val, n=1)
cnn/imagenet_experiment.py:409
↓ 8 callersFunctionbutterfly_mult_untied_torch
Parameters: twiddle: (nstack, log n, n / 2, 2, 2) if real or (nstack, log n, n / 2, 2, 2, 2) if complex input: (batch_size, nstac
butterfly/butterfly_multiply.py:126
↓ 8 callersFunctionbutterfly_ortho_mult_tied
(twiddle, input, increasing_stride)
butterfly/butterfly_multiply.py:254
↓ 8 callersFunctionconj_wrapper
csrc/cpu/butterfly_cpu.cpp:6
↓ 8 callersMethodforward
(self, x)
cnn/models/dpn.py:61
↓ 8 callersFunctionget_dali_train_loader
(dali_cpu=False)
cnn/imagenet/dataloaders.py:121
↓ 8 callersMethodupdate
(self, val, n=1)
cnn/imagenet_amp.py:428
↓ 7 callersMethod__init__
(self, block, num_blocks, num_classes=10)
convolution/models/resnet.py:77
↓ 7 callersMethodbatchnorm
(self, planes, last_bn=False)
cnn/imagenet/resnet.py:61
↓ 7 callersFunctionbutterfly_multiply_intermediate
butterfly/factor_multiply/factor_multiply.cpp:245
↓ 7 callersFunctionhadamard
Construct an nn.Module based on Butterfly that exactly performs the Hadamard transform. Parameters: n: size of the Hadamard transform. Mu
torch_butterfly/special.py:345
↓ 7 callersFunctionifft
Construct an nn.Module based on Butterfly that exactly performs the inverse FFT. Parameters: n: size of the iFFT. Must be a power of 2.
torch_butterfly/special.py:90
↓ 7 callersFunctioninvert
Get the inverse of a given permutation vector. Equivalent to converting a permutation vector from left-multiplication format to right multipli
torch_butterfly/permutation.py:81
↓ 7 callersMethodnext
(self)
cnn/train_utils.py:57
↓ 7 callersFunctionrun_experiments
Runs and blocks until all trials finish. Examples: >>> experiment_spec = Experiment("experiment", my_func) >>> run_experiments(ex
learning_transforms/tune.py:284
↓ 7 callersMethodto_base4
(self)
torch_butterfly/butterfly.py:192
↓ 7 callersFunctiontorch2numpy
Convert a torch float32 tensor to a numpy array, sharing the same memory.
butterfly/complex_utils.py:26
↓ 6 callersMethod__init__
(self, block=BasicBlock, layers=[2,2,2,2], num_classes=10, zero_init_residual=False, **perm_args)
cnn/models/presnet.py:114
↓ 6 callersFunction_make_divisible
This function is taken from the original tf repo. It ensures that all layers have a channel number that is divisible by 8 It can be seen
cnn/mobilenet_imagenet.py:20
↓ 6 callersFunctionbutterfly_multiply
(twiddle: torch.Tensor, input: torch.Tensor, increasing_stride: bool, output_size: Opti
torch_butterfly/multiply.py:22
↓ 6 callersFunctionbutterfly_multiply_intermediate_backward
butterfly/factor_multiply/factor_multiply.cpp:347
↓ 6 callersMethodentropy
(self, p)
cnn/models/presnet.py:290
↓ 6 callersFunctionget_dali_val_loader
()
cnn/imagenet/dataloaders.py:144
↓ 6 callersFunctionreduce_tensor
(tensor)
cnn/imagenet_experiment.py:442
↓ 6 callersFunctionreduce_tensor
(tensor)
cnn/imagenet_amp.py:471
↓ 6 callersFunctionrun
(in_, out_, batch_size)
butterfly/benchmark_linear.py:18
↓ 6 callersFunctionrun_raw
(in_, out_, batch_size)
butterfly/benchmark_linear.py:51
↓ 6 callersFunctionsinkhorn
Sinkhorn iterations. Parameters: logit: (..., n, n) n_iters: integer Return: (..., n, n) matrix that's close to a doub
learning_transforms/butterfly_old.py:15
↓ 6 callersFunctiontorch2cp
(tensor)
torch_butterfly/complex_utils.py:30
↓ 5 callersMethodcompute_perm
# twiddle: (depth, 1, log n, n/2) twiddle: (depth, samples, log n, n/2) strides: (depth,) bool Returns: (samples, n,
cnn/models/presnet.py:467
↓ 5 callersMethodconv
(self, kernel_size, in_planes, out_planes, stride=1)
cnn/imagenet/resnet.py:17
↓ 5 callersFunctionloss_fn
()
cnn/imagenet/training.py:486
↓ 5 callersMethodmap_twiddle
(self, twiddle)
cnn/models/presnet.py:457
↓ 5 callersFunctionperm_vec_to_mat
Convert a permutation vector to a permutation matrix. Parameters: p: a vector storing the permutation. left: whether it's in left-
torch_butterfly/permutation.py:98
↓ 5 callersMethodpost_process
(self, input, output, out_size=None)
torch_butterfly/butterfly.py:160
↓ 5 callersMethodupdate
(self, val, n=1)
cnn/train_utils.py:33
↓ 4 callersMethod__init__
(self, in_channels, out_channels)
cnn/models/shufflenetv2.py:59
↓ 4 callersMethod__init__
(self, block, layers, num_classes=1000, k=1, vgg_head=False, num_structured_layers=0, structure_ty
cnn/models/resnet_imagenet.py:195
↓ 4 callersMethod_make_dense_layers
(self, block, in_planes, nblock)
cnn/models/densenet.py:68
↓ 4 callersMethod_make_layer
(self, block, planes, num_blocks, stride)
convolution/models/resnet.py:90
↓ 4 callersMethod_make_layer
(self, builder, block, planes, blocks, stride=1)
cnn/imagenet/resnet.py:169
↓ 4 callersMethod_make_layer
(self, block, planes, num_blocks, stride)
cnn/models/senet.py:92
↓ 4 callersMethod_make_layer
(self, in_planes, out_planes, num_blocks, dense_depth, stride)
cnn/models/dpn.py:53
↓ 4 callersMethod_make_layer
(self, block, planes, blocks, stride=1)
cnn/models/presnet.py:155
↓ 4 callersMethod_make_layer
(self, block, planes, blocks, stride=1, is_structured=False, structure_type='B', nblocks=1, param=
cnn/models/resnet_imagenet.py:230
↓ 4 callersMethod_make_layer
(self, block, planes, num_blocks, stride)
cnn/models/preact_resnet.py:77
↓ 4 callersMethod_make_layer
(self, block, planes, num_blocks, stride, is_structured, structure_type='B', **kwargs)
cnn/models/resnet.py:124
↓ 4 callersFunctionbbt_ortho_mult_untied
(twiddle, input)
butterfly/butterfly_multiply.py:431
↓ 4 callersFunctioncalc_ips
(batch_size, time)
cnn/imagenet/training.py:366
↓ 4 callersFunctioncirculant
Construct an nn.Module based on Butterfly that exactly performs circulant matrix multiplication. Parameters: col: torch.Tensor of siz
torch_butterfly/special.py:248
↓ 4 callersFunctioncomplex_mul_torch
(X, Y)
butterfly/complex_utils.py:78
↓ 4 callersMethoddistributed
(self)
cnn/imagenet/training.py:77
↓ 4 callersFunctionevaluate_translation
(gen_args)
transformer/dynamic_conv_experiment.py:34
↓ 4 callersMethodforward
Parameters: input: (batch, *, in_size) transpose: whether the butterfly matrix should be transposed. conj
torch_butterfly/butterfly.py:118
↓ 4 callersMethodloss
(self)
cnn/distill_cov_experiment.py:111
↓ 4 callersFunctionlr_policy
(lr_fn, logger=None)
cnn/imagenet/training.py:125
↓ 4 callersFunctionnamed_target_matrix
Parameter: name: name of the target matrix Return: target_matrix: (n, n) numpy array for real matrices or (n, n, 2) for compl
learning_transforms/target_matrix.py:89
↓ 4 callersMethodnext
(self)
cnn/imagenet_experiment.py:257
↓ 4 callersFunctiontwiddle_list_concat
(B: Block2x2DiagProduct)
learning_transforms/test_factor_multiply.py:12
↓ 3 callersMethod__init__
(self, n)
cnn/shufflenet_imagenet.py:39
↓ 3 callersMethod__init__
(self, in_planes, out_planes, stride=1)
cnn/models/pnasnet.py:25
↓ 3 callersMethod_make_layer
(self, block, planes, num_blocks, stride)
convolution/models/resnet_cifar.py:76
↓ 3 callersMethod_make_layer
(self, out_planes, num_blocks, groups, grouped_conv_1st_layer=True, shuffle='P', preact=False)
cnn/shufflenet_imagenet.py:165
↓ 3 callersMethod_make_layer
(self, num_blocks, stride)
cnn/models/resnext.py:55
↓ 3 callersMethod_make_layer
(self, planes, num_cells)
cnn/models/pnasnet.py:88
↓ 3 callersMethod_make_layer
(self, block, planes, num_blocks, stride)
cnn/models/resnet_original.py:100
↓ 3 callersMethod_make_layer
(self, out_channels, num_blocks)
cnn/models/shufflenetv2.py:114
↓ 3 callersMethod_make_layer
(self, out_planes, num_blocks, groups)
cnn/models/shufflenet.py:66
↓ 3 callersMethod_wide_layer
(self, block, planes, num_blocks, dropout_rate, stride, structure_type=None, **kwargs)
cnn/models/wide_resnet.py:89
↓ 3 callersMethodactivation
(self)
cnn/imagenet/resnet.py:69
↓ 3 callersFunctionanticirculant_as_strided
(c, x)
cnn/models/circulant1x1conv.py:101
↓ 3 callersFunctionbbt_mult_untied
(twiddle, input, fast=True)
butterfly/butterfly_multiply.py:359
↓ 3 callersFunctionbenchmark
(fn, nrepeats=7)
torch_butterfly/benchmark_utils.py:7
↓ 3 callersFunctionbutterfly_mult_factors
Implementation that have separate kernels for each factor, for debugging. Parameters: twiddle: (n - 1, 2, 2) if real or (n - 1, 2, 2, 2) i
butterfly/butterfly_multiply.py:696
↓ 3 callersFunctionbutterfly_mult_torch
Parameters: twiddle: (nstack, n - 1, 2, 2) if real or (nstack, n - 1, 2, 2, 2) if complex input: (batch_size, nstack, n) if real
butterfly/butterfly_multiply.py:43
↓ 3 callersFunctionbutterfly_multiply_untied
butterfly/factor_multiply/factor_multiply.cpp:463
next →1–100 of 1,242, ranked by callers