MCPcopy Create free account

hub / github.com/UCSC-VLAA/OpenVision / functions

Functions716 in github.com/UCSC-VLAA/OpenVision

Functionload_obrax_ckpt
(argv)
src/convert_upload/transfer_jax2hf.py:457
Methodlock
(self, unlocked_groups=0, freeze_bn_stats=False)
src/convert_upload/open_clip/modified_resnet.py:154
Methodlock
(self, unlocked_layers: int = 0, freeze_layer_norm: bool = True)
src/convert_upload/open_clip/hf_model.py:171
Methodlock
(self, unlocked_groups=0, freeze_bn_stats=False)
src/convert_upload/open_clip/transformer.py:543
Methodlock_image_tower
(self, unlocked_groups=0, freeze_bn_stats=False)
src/convert_upload/open_clip/model.py:258
Methodlock_image_tower
(self, unlocked_groups=0, freeze_bn_stats=False)
src/convert_upload/open_clip/model.py:346
Methodlock_text_tower
(self, unlocked_layers: int = 0, freeze_layer_norm: bool = True)
src/convert_upload/open_clip/model.py:350
Methodlog_timing_avg
Use this when you time sth multiple times per step (eg in a loop).
src/helpers/utils.py:424
Functionloss_fn
(params, images, labels)
src/main_clip.py:429
Functionloss_fn
(params_, imgs, lbls)
src/main_openvision2.py:277
Functionmae_loss
(*, pred, target, mask, norm_pix_loss: bool = True)
src/losses/common.py:327
Functionmain
(argv)
src/main_clip.py:78
Functionmain
(argv)
src/main_openvision2.py:65
Functionmake
Returns gradient transform and learning rate functions.
src/optim/build_optax.py:188
Functionmake_for_inference
Makes an input pipeline for inference.
src/datasets/input_pipeline.py:141
Functionmake_mask_trees
Returns a boolean mask tree for every pattern (only first match).
src/helpers/utils.py:789
Methodmask_fn
(rng_i, x_i)
src/models/openvision2_model.py:127
Functionmatchfirst
(name, _)
src/helpers/utils.py:793
Functionmaybe_shard_and_put
(name, x)
src/datasets/input_pipeline.py:260
Functionmerge_params
Makes `loaded` pytree match `init`, warning or failing on mismatch. Args: loaded: pytree of parameters, typically loaded from a checkpoint.
src/models/common.py:543
Functionmixup
Perform mixup https://arxiv.org/abs/1710.09412. Args: rng: The random key to use.
src/transforms/mixup.py:190
Methodnum_channels
(self)
src/convert_upload/open_clip/transform.py:30
Methodnum_examples_per_process
(self, nprocess=None)
src/datasets/tfds.py:68
Functionpack_arg
Packs key-word args as a string to be parsed by `parse_arg()`.
src/configs/common.py:131
Functionpad_model_inputs
r"""Pad model input and generate corresponding input masks. `pad_model_inputs` performs the final packaging of a model's inputs commonly found in
src/transforms/bert_ops.py:191
Functionpad_shard_unpad
Wraps a function with code that pads, shards, then un-shards, un-pads. Args: wrapped: the function to be wrapped. Signature is `params, *args,
src/helpers/utils.py:55
Functionpad_shard_unpad_wrapper
(*args, min_device_batch=None, **kw)
src/helpers/utils.py:86
Functionparse
(x)
src/convert_upload/open_clip/utils.py:50
Functionparse_arg
Makes ConfigDict's get_config single-string argument more usable. Example use in the config file: import big_vision.configs.common as bvcc
src/configs/common.py:29
Methodper2x2_random_grid_indices
(mask)
src/models/vit.py:578
Methodper2x2_random_grid_mask
(mask, index)
src/models/vit.py:586
Functionpolicy_v0
Autoaugment policy that was used in AutoAugment Paper.
src/transforms/autoaugment.py:53
Functionpolicy_vtest
Autoaugment test policy for debugging.
src/transforms/autoaugment.py:88
Functionposemb_sincos_2d
Follows the MoCo v3 logic.
src/helpers/utils.py:911
Functionposterize
Equivalent of PIL Posterize.
src/transforms/autoaugment.py:233
Functionprefetch_scalar
(it, nprefetch=1, devices=None)
src/helpers/utils.py:203
Functionprepare_datasets
Returns unbatched `ds_images, ds_texts` datasets. Args: dataset: An image-text `tf.data.Dataset` that is expected to contain the followin
src/evaluators/proj/image_text/retrieval.py:75
Functionprepare_datasets
Returns unbatched `ds_images, ds_texts` datasets.
src/evaluators/proj/image_text/discriminative_classifier.py:69
Functionprofile
(name, ttl=3 * 365 * 24 * 3600, noop=False)
src/helpers/utils.py:810
Functionrag_tensor
(raw_tensor)
src/transforms/ops_general.py:219
Functionrandom_blur
Randomly blur an image. Args: image: `Tensor` representing an image of arbitrary size. height: Height of output image. width: Wi
src/transforms/simclr_aug.py:380
Functionrandom_brightness
Adjust the brightness of images by a random factor. Equivalent to `adjust_brightness()` using a `delta` randomly picked in the interval `[-max_de
src/transforms/ops_image.py:204
Functionrandom_color_jitter
(jitter_strength=0.5, impl='simclrv2')
src/transforms/ops_image.py:267
Functionrandom_color_jitter
(image, p=1.0, jitter_strength=0.5, impl='simclrv2')
src/transforms/simclr_aug.py:370
Functionrandom_crop_with_resize
Randomly crop and resize an image. Args: image: `Tensor` representing an image of arbitrary size. height: Height of output image.
src/transforms/simclr_aug.py:354
Functionrandom_mask_tokenize
( texts: Union[str, List[str]], context_length: int, sot_token_id: int, eot_to
src/convert_upload/open_clip/tokenizer.py:281
Methodrandom_masking
(self, x, mask_ratio, rng_mask=None)
src/models/text_transformer.py:709
Functionrecover_dtype
Numpy's `save` stores bfloat16 type as "void" type, so we recover it.
src/helpers/utils.py:681
Methodregister
Creates a function that registers its input.
src/helpers/registry.py:141
Functionregister_pooler
Decorator registering pooler class
src/convert_upload/open_clip/hf_model.py:39
Functionreplace_frozen
Replaces values matching frozen params in `pytree` with `replacement`.
src/optim/build_optax.py:178
Functionreplace_linear
(model, linear_replacement, include_modules=['c_fc', 'c_proj'], copy_weights=True)
src/convert_upload/open_clip/utils.py:65
Functionrotate
Rotates the image by degrees either clockwise or counterclockwise. Args: image: An image Tensor of type uint8. degrees: Float, a scalar angl
src/transforms/autoaugment.py:239
Methodrun
Computes all metrics.
src/evaluators/proj/image_text/contrastive.py:89
Methodrun
Returns metrics.
src/evaluators/proj/image_text/discriminative_classifier.py:461
Functionsaturation_foo
()
src/transforms/simclr_aug.py:153
Functionsave_checkpoint
Util for checkpointing: saves jax pytree objects to the disk. Args: checkpoint: arbitrary jax pytree to be saved. path: a path to save the
src/helpers/utils.py:693
Functionsave_checkpoint_ts
Preemption-safe saving of checkpoints using tssave.
src/helpers/utils.py:1024
Methodsave_pretrained
(self, dest)
src/convert_upload/open_clip/tokenizer.py:498
Methodsave_pretrained
(self, dest)
src/convert_upload/open_clip/tokenizer.py:575
Functionscan_ffn
(remat_ffn, carry, hidden_states)
src/models/bpt.py:27
Functionscan_kv_block
(carry, args)
src/models/bpt.py:106
Methodset_grad_checkpointing
(self, enable: bool = True)
src/convert_upload/open_clip/coca_model.py:144
Methodset_grad_checkpointing
(self, enable=True)
src/convert_upload/open_clip/modified_resnet.py:162
Methodset_grad_checkpointing
(self, enable=True)
src/convert_upload/open_clip/timm_model.py:143
Methodset_grad_checkpointing
(self, enable=True)
src/convert_upload/open_clip/hf_model.py:189
Methodset_grad_checkpointing
(self, enable=True)
src/convert_upload/open_clip/transformer.py:597
Methodset_grad_checkpointing
(self, enable=True)
src/convert_upload/open_clip/transformer.py:759
Methodset_grad_checkpointing
(self, enable=True)
src/convert_upload/open_clip/transformer.py:915
Methodset_grad_checkpointing
(self, enable=True)
src/convert_upload/open_clip/model.py:354
Methodsetup
(self)
src/models/vit.py:48
Functionsharpness
Implements Sharpness function from PIL using TF ops.
src/transforms/autoaugment.py:333
Functionshear_x
Equivalent of PIL Shearing in X dimension.
src/transforms/autoaugment.py:274
Functionshear_y
Equivalent of PIL Shearing in Y dimension.
src/transforms/autoaugment.py:285
Functionsigmoid_xent
(*, logits, labels, reduction=True)
src/losses/common.py:40
Functionsimple_mask_tokenize
( texts: Union[str, List[str]], context_length: int, sot_token_id: int, eot_to
src/convert_upload/open_clip/tokenizer.py:310
Functionskip_upper_half
(carry, args)
src/models/bpt.py:126
Functionsoftmax_xent
(*, logits, labels, mask=None, reduction=True, kl=False, axis=-1, smoothing=0.1)
src/losses/common.py:225
Functionsolarize
(image, threshold=128)
src/transforms/three_aug.py:172
Functionsolarize
(image, threshold=128)
src/transforms/autoaugment.py:187
Functionsolarize_add
(image, addition=0, threshold=128)
src/transforms/autoaugment.py:194
Methodsquare_mask
(start_height, start_width, mask_height, mask_width)
src/models/vit.py:558
Functionstart_input_pipeline
(data, config=None, mesh=None, data_sharding=None, mix_fn=None, tokenizer=None)
src/datasets/input_pipeline.py:242
Functionstart_input_pipeline_eval
(data, mesh=None, data_sharding=None, tokenizer=None, context_length=128)
src/datasets/input_pipeline.py:230
Functionstart_ragged_input_pipeline
(data, n_prefetch=1, shard=True, ragged=None)
src/datasets/input_pipeline.py:259
Functionstep_fn
Step to learning rate function.
src/optim/build_optax.py:114
Functionstrict_bool
(x)
src/configs/common.py:110
Functionsubstitute_prompt
(features)
src/evaluators/proj/image_text/discriminative_classifier.py:96
Functionsync
Syncs hosts and empties async computation queue.
src/helpers/utils.py:756
Functionsyntax_mask_tokenize
Returns the tokenized representation of given input string(s). Apply syntax masking before tokenize.
src/convert_upload/open_clip/tokenizer.py:332
Functiontemporary_ops
Registers specified pp ops for use in a `with` block. Example use: with pp_registry.remporary_ops( pow=lambda alpha: lambda d: {k: v**
src/helpers/registry.py:168
Methodtext_global_pool
(self, x, text: Optional[jnp.ndarray] = None, pool_type: str = 'argmax')
src/models/text_transformer.py:616
Functiontext_to_image_retrieval_eval
Runs the text-to-image retrieval eval from the distance matrix. Args: dist_matrix: Distance matrix between text and image embeddings (shape
src/evaluators/proj/image_text/image_text_retrieval.py:25
Functionto_grayscale
(image, keep_channels=True)
src/transforms/simclr_aug.py:48
Functiontokenize
(texts: Union[str, List[str]], context_length: int = DEFAULT_CONTEXT_LENGTH)
src/convert_upload/open_clip/tokenizer.py:277
Functiontokenizer_nltk
:param input_string: numpy.array, :return: tf.tensor string
src/transforms/bert_ops.py:395
Methodtotal_examples
Returns number of examples in the dataset, regardless of sharding.
src/datasets/core.py:44
Methodtotal_examples
(self)
src/datasets/tfds.py:64
Functiontrace_model
(model, batch_size=256, device=torch.device('cpu'))
src/convert_upload/open_clip/model.py:509
Functiontraining
Reads the data from a single dataset, or mixes it from multiple. The data is read either from one or mixed from multiple datasets, depending on t
src/datasets/input_pipeline.py:67
← previousnext →601–700 of 716, ranked by callers