MCPcopy Create free account

hub / github.com/Vermeille/Torchelie / functions

Functions1,230 in github.com/Vermeille/Torchelie

↓ 85 callersMethodmean
(self)
torchelie/distributions.py:50
↓ 70 callersMethodto
Move a recipe and all its movable registered objects to a device Args: device: a torch device
torchelie/recipes/recipebase.py:174
↓ 44 callersMethodadd_callbacks
(self, cbs)
torchelie/recipes/recipebase.py:67
↓ 39 callersFunctionkaiming
Initialize a module with kaiming normal init Args: m (nn.Module): the module to init a (float): the slope of the nonlinearit
torchelie/utils.py:86
↓ 30 callersMethodbackward
(env, src, dst)
torchelie/recipes/pix2pix.py:138
↓ 29 callersMethodmodules
Iterate over all nn.Modules registered in the recipe
torchelie/recipes/recipebase.py:167
↓ 27 callersMethodget
Return the value averaged over the window
torchelie/callbacks/avg.py:60
↓ 24 callersMethodregister
Register an object into the recipe as a member. Calling :code:`recipe.register('foo', bar)` registers bar, and makes it usable
torchelie/recipes/recipebase.py:104
↓ 23 callersMethodrun
Run the recipe for :code:`epochs` epochs. Args: epochs (int): number of epochs Returns: The state
torchelie/recipes/recipebase.py:240
↓ 20 callersMethodbackward
(ctx, d_out)
torchelie/nn/layers.py:142
↓ 18 callersMethodcpu
Move a recipe and all its movable registered objects to cpu
torchelie/recipes/recipebase.py:200
↓ 18 callersMethodnorm
(self, x: torch.Tensor)
torchelie/callbacks/callbacks.py:1254
↓ 17 callersMethodcuda
Move a recipe and all its movable registered objects to cuda
torchelie/recipes/recipebase.py:194
↓ 15 callersMethodcondition
(self, z: torch.Tensor)
torchelie/nn/resblock.py:203
↓ 15 callersMethodsave
(self, state)
torchelie/callbacks/callbacks.py:719
↓ 14 callersFunctionconstant_init
Initialize a module with gaussian weights of standard deviation std Args: m (nn.Module): the module to init Returns: th
torchelie/utils.py:186
↓ 14 callersMethodleaky
(self)
torchelie/nn/encdec.py:162
↓ 14 callersMethodupdate
(self, val, n=1)
wip/imagenet.py:444
↓ 13 callersFunctionConv1x1
A 1x1 Conv2d
torchelie/nn/conv.py:37
↓ 13 callersMethodremove_batchnorm
(self)
torchelie/nn/encdec.py:156
↓ 11 callersMethod__init__
(self, from_k, to, post_each_batch=True)
torchelie/callbacks/callbacks.py:419
↓ 11 callersMethodlog
Log `x`
torchelie/callbacks/avg.py:52
↓ 11 callersMethodnormalize
(self, x: torch.Tensor)
torchelie/models/pixcnn.py:56
↓ 11 callersFunctionremove_batchnorm
Remove BatchNorm in Sequentials / CondSeqs in a smart way, restoring biases in the preceding layer.
torchelie/nn/utils.py:153
↓ 11 callersMethodstep
r"""Performs a single optimization step. Arguments: closure: A closure that reevaluates the model and returns the loss.
torchelie/optim.py:457
↓ 11 callersMethodtrain
(self, mode: bool = True)
torchelie/utils.py:435
↓ 10 callersMethodlog
(self, iters, xs, store_history=[])
torchelie/callbacks/callbacks.py:482
↓ 9 callersFunctionConv3x3
A 3x3 Conv2d with 'same' padding
torchelie/nn/conv.py:27
↓ 9 callersMethodadd_epilogues
(self, cbs)
torchelie/recipes/recipebase.py:71
↓ 8 callersMethod_change_block_type
(self, ty: str)
torchelie/models/resnet.py:149
↓ 8 callersFunctiongradient_penalty
Gradient penalty, mainly for GANs. Of the form :code:`E[(||dmodel(data)/ddata|| - objective_goal)²]` Args: model (function / nn.
torchelie/loss/gan/penalty.py:131
↓ 8 callersMethodload_state_dict
Restore a recipe
torchelie/recipes/recipebase.py:147
↓ 8 callersMethodremove_batchnorm
(self)
torchelie/models/unet.py:108
↓ 8 callersMethodto_spectral_norm
(self)
torchelie/models/snres_discr.py:56
↓ 8 callersMethodupdate_state
(self, state_additions)
torchelie/recipes/recipebase.py:51
↓ 7 callersMethod__init__
(self, channels, cond_channels, hidden,
torchelie/nn/batchnorm.py:162
↓ 7 callersMethodleaky
(self, leak: float = 0.2)
torchelie/models/unet.py:56
↓ 7 callersMethodsample
Sample a value.
torchelie/hyper.py:77
↓ 7 callersFunctionxavier
Initialize a module with xavier normal init Args: m (nn.Module): the module to init dynamic (bool): wether to scale the weig
torchelie/utils.py:131
↓ 6 callersFunctionGANRecipe
(G: nn.Module, D: nn.Module, G_fun, D_fun, test_fun,
torchelie/recipes/gan.py:10
↓ 6 callersMethod__init__
(self, *size: int)
torchelie/nn/layers.py:239
↓ 6 callersMethod__init__
(self, instance)
torchelie/datasets/__init__.py:152
↓ 6 callersMethodadd_operation
(self, inputs: List[str], outputs: List[str], name: str, operation: nn.Module)
torchelie/nn/graph.py:62
↓ 6 callersMethodadd_transform
(self, tfm: Callable[[PILImage], PILImage])
torchelie/transforms/randaugment.py:127
↓ 6 callersFunctionrun
(M)
tests/test_models.py:40
↓ 6 callersMethodsample
Sample a batch of images Args: temp (float): the sampling temperature N (int): number of images to generate
torchelie/models/pixcnn.py:174
↓ 6 callersMethodto_equal_lr
(self, leak: float = 0.2)
torchelie/nn/layers.py:51
↓ 5 callersMethod__init__
( self, params, lr: float = 1e-3, betas: (float, float) = (0.9, 0.999),
torchelie/optim.py:423
↓ 5 callersMethod__init__
(self, opt, warmup_iters: int, step_iters: int,
torchelie/lr_scheduler.py:215
↓ 5 callersMethod_mix
(self, m: torch.Tensor, prob: float)
torchelie/transforms/differentiable.py:190
↓ 5 callersMethodcallbacks
(self)
torchelie/recipes/recipebase.py:20
↓ 5 callersFunctionindent
Indent :code:`text` by :code:`amount` spaces. Args: text (str): some text amount (int): an indentation amount Returns:
torchelie/utils.py:688
↓ 5 callersMethodload_state_dict
(self, state)
torchelie/optim.py:348
↓ 5 callersMethodremove
(self, module: Module)
torchelie/nn/utils.py:69
↓ 5 callersMethodrender
Return the tensor on cpu and detached, ready to be transformed to a PIL image
torchelie/data_learning.py:233
↓ 5 callersFunctionresnet101
(num_classes: int)
torchelie/models/resnet.py:276
↓ 5 callersFunctionresnet50
(num_classes: int)
torchelie/models/resnet.py:267
↓ 5 callersMethodset_input_specs
(self, in_channels: int)
torchelie/models/vgg.py:58
↓ 5 callersMethodto_instance_norm
Replace BatchNorm with InstanceNorm.
torchelie/models/unet.py:42
↓ 5 callersMethodto_projection_discr
(self, num_classes: int)
torchelie/models/snres_discr.py:89
↓ 5 callersFunctionzero_gp
0-GP from Improving Generalization And Stability Of Generative Adversarial Networks ( https://arxiv.org/abs/1902.03984 ). Args:
torchelie/loss/gan/penalty.py:5
↓ 4 callersFunctionConv2d
A Conv2d with 'same' padding
torchelie/nn/conv.py:9
↓ 4 callersFunctionCrossEntropyClassification
Extends Classification with default cross entropy forward passes. Also adds AdamW/SGD and CosineDecay schedule Inherited training callba
torchelie/recipes/classification.py:160
↓ 4 callersFunctionTrainAndTest
Two nested loops, usually one for training and one for testing, but can serve other purposes. The model is automatically registered and c
torchelie/recipes/trainandtest.py:7
↓ 4 callersMethod__init__
(self, in_ch: int, reduction: int = 16)
torchelie/nn/resblock.py:22
↓ 4 callersMethod__init__
(self, in_channels: int, out_channels: int, cond_channels:
torchelie/nn/blocks.py:82
↓ 4 callersMethod__init__
(self, im_size, num_classes, patch_size, num_blocks, hidden_dim, tokens_mlp_dim, channels_mlp
torchelie/models/mlpmixer.py:58
↓ 4 callersMethod__init__
(self, in_ch: int, hid_ch: int, out_ch: int, ks: int, sz: Tuple[int, int])
torchelie/models/pixcnn.py:65
↓ 4 callersMethodadd_batchnorm
(self, remove_first=False)
torchelie/models/vgg.py:48
↓ 4 callersMethodfit
Args: lr (float, optional): the learning rate visdom_env (str or None): the name of the visdom env to use, or None
torchelie/recipes/deepdream.py:46
↓ 4 callersFunctionget_dataset
(typ: str, path: str, train: bool, size: int)
torchelie/recipes/unpaired.py:90
↓ 4 callersFunctionget_dataset
(typ: str, path: str, train: bool, size: int)
torchelie/recipes/cut.py:134
↓ 4 callersMethodinsert_after
(self, key: str, name: str, func=None)
torchelie/recipes/algorithm.py:72
↓ 4 callersMethodleaky
(self)
torchelie/models/stylegan2.py:25
↓ 4 callersMethodpreact_skip
(self)
torchelie/nn/resblock.py:306
↓ 4 callersMethodset_decoder_num_layers
(self, num_layers: int)
torchelie/nn/encdec.py:134
↓ 4 callersMethodset_keep_layers
(self, types=(nn.Conv2d, nn.Linear), names=None)
torchelie/nn/withsavedactivations.py:21
↓ 4 callersMethodset_pool_size
Average pool to spatial size :code:`size` rather than 1. Recreate the first Linear to accomodate the change.
torchelie/models/classifier.py:123
↓ 4 callersMethodshow
Get the HTML inspector view.
torchelie/callbacks/inspector.py:139
↓ 4 callersFunctionstd_s
(x, dim: Union[int, Tuple[int, ...]])
wip/adain.py:12
↓ 4 callersMethodto_convolutional
Remove pooling and flattening operations, convert linears to conv1x1
torchelie/models/classifier.py:84
↓ 4 callersMethodupdate_moments
(self, x)
torchelie/nn/batchnorm.py:20
↓ 4 callersMethodwide
(self, divisor: int = 2)
torchelie/nn/resblock.py:124
↓ 3 callersFunctionFastImageFolder
Load an ImageFolder dataset faster by caching the file list the first time it is accessed. Force refreshing by deleting :code:`{root}/cac
torchelie/datasets/__init__.py:18
↓ 3 callersFunctionTrainAndCall
Train a model and evaluate it with a custom function. The model is automatically registered and checkpointed as :code:`checkpoint['model']`,
torchelie/recipes/trainandcall.py:4
↓ 3 callersMethod__init__
(self, shape: Tuple[int, ...], sd: float = 0.01, init_img:
torchelie/data_learning.py:43
↓ 3 callersMethod__init__
(self, root: str, train: bool, transform: Optional[Callable
torchelie/datasets/debug.py:115
↓ 3 callersMethod__init__
(self, ch: int, inner: Optional[nn.Module], with_skip: bool
torchelie/models/attention.py:18
↓ 3 callersFunction_gblur_kernel_2d
(c)
torchelie/transforms/differentiable.py:79
↓ 3 callersFunction_mblur_kernel_2d
(c)
torchelie/transforms/differentiable.py:109
↓ 3 callersMethod_report
(self, dat)
torchelie/callbacks/inspector.py:105
↓ 3 callersFunctionbgram
Return the batched Gram matrix of `m` Args: m (tensor): a matrix of dim 3, first one is the batch Returns: The batch of
torchelie/utils.py:264
↓ 3 callersMethodclear
(self)
torchelie/transforms/randaugment.py:51
↓ 3 callersMethodcondition
(self, y: torch.Tensor)
wip/adain.py:30
↓ 3 callersFunctioncontinuous_cross_entropy
r""" Compute the cross entropy between the logits `pred` and a normalized distribution `soft_targets`. If `soft_targets` is a one-hot vector,
torchelie/loss/functional/__init__.py:60
↓ 3 callersFunctiondict_by_key
Recursively index a `dict` by a hierarchical key ``` >>> dict_by_key({'a': [{'b': 42}]}, 'a.0.b') 42 ``` Args: d (d
torchelie/utils.py:280
↓ 3 callersFunctionexp_t
(x: torch.Tensor, t: float)
torchelie/loss/bitempered.py:11
↓ 3 callersMethodflatten
(x)
torchelie/nn/functional/vq.py:21
↓ 3 callersFunctionfreeze
Freeze all parameters of `net`
torchelie/utils.py:28
↓ 3 callersMethodget_style_content_
(self, img: torch.Tensor, detach: bool)
torchelie/loss/neuralstyleloss.py:42
next →1–100 of 1,230, ranked by callers