MCPcopy Create free account

hub / github.com/google-research/scenic / functions

Functions4,921 in github.com/google-research/scenic

↓ 2,017 callersMethodget
Return the value for key if it exists otherwise the default.
scenic/projects/loca/utils.py:55
↓ 285 callersMethodget
Return the value for key if it exists otherwise the default.
scenic/projects/verbs_in_action/utils.py:219
↓ 208 callersMethodapply
(self, image: tf.Tensor)
scenic/projects/owl_vit/preprocessing/image_ops.py:419
↓ 196 callersMethodget
Return the value for key if it exists otherwise the default.
scenic/projects/pixel_llm/partition_utils.py:69
↓ 187 callersMethodupdate
Update with the given per-step metrics.
scenic/projects/vid2seq/trainer.py:595
↓ 174 callersMethodget
Return the value for key if it exists otherwise the default.
scenic/projects/streaming_dvc/partition_utils.py:69
↓ 116 callersMethodpause
(self, wait_for=())
scenic/train_lib/train_utils.py:1244
↓ 115 callersMethodresume
(self)
scenic/train_lib/train_utils.py:1249
↓ 96 callersMethodget
Return the value for key if it exists otherwise the default.
scenic/train_lib/train_utils.py:78
↓ 91 callersMethodparam
(self, name: str, *args, **kwargs)
scenic/projects/loca/vit.py:245
↓ 75 callersFunctionmetrics_fn
(train_state, batch, predictions)
scenic/projects/owl_vit/trainer.py:163
↓ 68 callersMethodget
Get a dataset from the registry by its name. Args: name: Dataset name. Returns: Dataset builder function that accepts dataset-sp
scenic/dataset_lib/datasets.py:91
↓ 67 callersMethodrun
(self)
setup.py:58
↓ 60 callersMethodsave
(self)
scenic/train_lib/train_utils.py:1254
↓ 50 callersMethodparam
(self, name: str, *args, **kwargs)
scenic/projects/baselines/bit_resnet.py:46
↓ 47 callersMethodload
Loads backbone parameters for this model from a checkpoint.
scenic/projects/owl_vit/layers.py:590
↓ 46 callersMethodget_num_examples
Returns the number of examples in the TFRecord files.
scenic/projects/av_mae/datasets/audiovisual_tfrecord_dataset.py:360
↓ 41 callersMethodtick
A chronometer tick.
scenic/train_lib/train_utils.py:1157
↓ 38 callersMethodadd
Add a dataset to the registry, i.e. register a dataset. Args: name: Dataset name (must be unique). builder_fn: Function to be called
scenic/dataset_lib/datasets.py:75
↓ 35 callersMethodlog
(self, inputs)
scenic/projects/baselines/detr/train_utils.py:358
↓ 34 callersFunctionlr_fn
Step to learning rate function.
scenic/train_lib/lr_schedules.py:203
↓ 33 callersMethodinform
Provide some extra info that's only known later in the program.
scenic/train_lib/train_utils.py:1139
↓ 31 callersMethodload
(self, ckpt={})
scenic/train_lib/train_utils.py:1262
↓ 29 callersMethodwrite
Write to the given writer and training step. After writing, the state gets reset. Args: writer: The summary will be written with this
scenic/projects/vid2seq/trainer.py:600
↓ 28 callersFunctionclip_grads
Clip gradients stored as a pytree of arrays to maximum norm `max_norm`.
scenic/projects/baselines/detr/train_utils.py:383
↓ 28 callersFunctionloss_fn
(params)
scenic/projects/owl_vit/trainer.py:95
↓ 22 callersMethodstring_tensor_to_indices
(self, string_tensor: Union[tf.Tensor, Sequence[str]],
scenic/projects/t5/tokenizer.py:68
↓ 19 callersMethodinitialize
(self)
scenic/projects/t5/tokenizer.py:60
↓ 19 callersFunctiontask
Vision task with val and test splits.
scenic/projects/baselines/plainvit/configs/vtab_plainvit_config.py:167
↓ 18 callersFunctiondense
(inputs, output_dim, dtype, kernel_init=None)
scenic/projects/layout_denoise/layers/common.py:33
↓ 15 callersMethodupdate
Update with the given per-step metrics.
scenic/projects/avatar/generation_trainer.py:580
↓ 14 callersFunctionapply_weights
Applies given weights of the inputs in the minibatch to outputs. Note that weights can be per example (i.e. of shape `[batch,]`) or per pixel/tok
scenic/model_lib/base_models/model_utils.py:51
↓ 13 callersMethodget_metrics_fn
(self, split: Optional[str] = None)
scenic/projects/loca/vit.py:328
↓ 13 callersMethodtokenize
(self, text: str, max_token_len: int = 16)
scenic/projects/owl_vit/models.py:109
↓ 12 callersFunctiontf_float
(t)
scenic/projects/baselines/centernet/transforms.py:128
↓ 12 callersFunctionunpatch_to_images
(tensor: jnp.ndarray)
scenic/projects/av_mae/train_utils.py:114
↓ 12 callersMethodupdate
Update with the given per-step metrics.
scenic/projects/knowledge_visual_language/trainer_utils.py:194
↓ 11 callersMethoddecode
( self, encoded: jnp.ndarray, encoder_input_tokens: jnp.ndarray, # Only needed for masks.
scenic/projects/t5/layers.py:90
↓ 11 callersFunctionmetrics_fn
(train_state, batch, predictions)
scenic/projects/baselines/detr/trainer.py:161
↓ 11 callersMethodupdate
Update per-frame localization predictions. Args: predictions: dict of image_id ('{video_id}_{frame_id}') to dict {'boxes': [[l, t,
scenic/projects/densevoc/vidstg_evaluator.py:263
↓ 10 callersMethodevaluate
Evaluate on given predictions.
scenic/projects/densevoc/vidstg_evaluator.py:98
↓ 10 callersFunctionfix1
(hyper, key, val)
scenic/projects/baselines/plainvit/configs/vtab_plainvit_config.py:163
↓ 10 callersMethodget_metrics_fn
Returns a callable metric function for the model. Args: split: The split for which we calculate the metrics. It should be one of th
scenic/projects/av_mae/mbt.py:728
↓ 10 callersFunctiontf_float
(t)
scenic/projects/baselines/detr/transforms.py:23
↓ 10 callersFunctiontf_float
(t)
scenic/projects/densevoc/transforms.py:26
↓ 10 callersFunctiontf_float
(t)
scenic/projects/densevoc/input_utils.py:467
↓ 9 callersFunction_int64_feature
(value)
scenic/projects/pixel_llm/tools/build_mdetr_ref_tfrecord.py:81
↓ 9 callersMethodfold
Fold patches of an image using function fn. Args: unfolded: Array of shape [N, C, R, R, H', W'] containing all unfolded patches.
scenic/projects/boundary_attention/helpers/junction_functions.py:103
↓ 9 callersMethodindices_to_string
(self, idx: int)
scenic/projects/gerald/input_pipeline.py:520
↓ 9 callersMethodpreprocess
Proprocess images. Normalize pixels for non-padded pixels.
scenic/projects/gerald/models/ger_model.py:273
↓ 8 callersMethodcompute_score
Compute METEOR scores.
scenic/projects/streaming_dvc/cococap_eval.py:32
↓ 8 callersMethodencode
(self, encoder_input_tokens: jnp.ndarray, encoder_segment_ids: Optional[jnp.ndarray]
scenic/projects/t5/layers.py:82
↓ 8 callersFunctionfake_decoded_features
Create a fake features dictionary. Args: n: int; number of boxes/objects. h: int; height of fake image. w: int; width of fake image.
scenic/projects/baselines/detr/tests/test_transforms.py:49
↓ 8 callersFunctionget_coco_ref_eval_source
Returns the RefCOCO/RefCOCOg/RefCOCO+/ eval source.
scenic/projects/pixel_llm/configs/bert/pixel_llm_bert_refseg.py:128
↓ 8 callersFunctionget_coco_ref_eval_source
Returns the RefCOCO/RefCOCOg/RefCOCO+/ eval source.
scenic/projects/pixel_llm/configs/t5/pixel_llm_t5_refseg.py:128
↓ 8 callersMethodget_metrics_fn
Returns a callable metric function for the model. Args: split: The split for which we calculate the metrics. It should be one of th
scenic/projects/mbt/model.py:717
↓ 8 callersMethodget_metrics_fn
Returns a callable metric function for the model. Args: split: The split for which we calculate the metrics. It should be one of th
scenic/projects/avatar/models.py:647
↓ 8 callersFunctioninit_posemb
Initialize the positional embeddings.
scenic/projects/mbt/model_utils.py:228
↓ 8 callersFunctionreplace_dict
Replaces values in model dictionary with restored ones from checkpoint.
scenic/projects/knowledge_visual_language/trainer_utils.py:229
↓ 8 callersMethodsubmit
(self, fn: Callable[..., Any], *args, **kwargs)
scenic/common_lib/debug_utils.py:280
↓ 7 callersFunction_canonicalize_string_tf
Brings text labels into a standard form.
scenic/projects/owl_vit/preprocessing/label_ops.py:312
↓ 7 callersFunction_int64_feature
(value)
scenic/projects/baselines/centernet/tools/build_coco_tfrecord.py:69
↓ 7 callersFunction_int64_feature
(value)
scenic/projects/pixel_llm/tools/build_uninext_ref_tfrecord.py:94
↓ 7 callersMethoddecode
Applies Transformer decoder-branch on encoded-input and target.
scenic/projects/pixel_llm/modeling/t5_text_head.py:672
↓ 7 callersMethodencode
Applies Transformer encoder-branch on the inputs.
scenic/projects/pixel_llm/modeling/t5_text_head.py:646
↓ 7 callersMethodget_metrics_fn
Returns a callable metric function for the model. Args: split: The split for which we calculate the metrics. It should be one of th
scenic/projects/token_learner/model.py:751
↓ 7 callersFunctionpad_to
(image, size)
scenic/projects/densevoc/input_utils.py:515
↓ 7 callersFunctionzero_pad
(array, batch_pad=batch_pad)
scenic/projects/verbs_in_action/tfrecord_dataset.py:55
↓ 6 callersMethod_assert_features_equal
Assert whether two feature dicts are equal.
scenic/projects/baselines/detr/tests/test_transforms.py:100
↓ 6 callersFunctionadd_loss_mask
(data, losses)
scenic/projects/densevoc/input_utils.py:651
↓ 6 callersFunctionapply_spatial_mask
Construct and apply spatial mask to the inputs. Args: inputs: Input tensor with dimensions [batch, spatial_dim, dim] to which the mask sh
scenic/model_lib/layers/masked_layers.py:489
↓ 6 callersMethodassertDictEqualRecursive
(self, actual, expected)
scenic/projects/mtv/model_utils_test.py:201
↓ 6 callersFunctionbert_truncated_normal_initializer
TruncatedNormal(0.02) initializer.
scenic/projects/baselines/bert/layers.py:29
↓ 6 callersMethodclear_annotations
Clears the annotations collected in this object. It is important to call this method either at the end or at the beginning of a new evaluatio
scenic/dataset_lib/coco_dataset/coco_eval.py:210
↓ 6 callersFunctionget_hw
Return the height, width of image as float32 tf.Tensors.
scenic/projects/baselines/detr/transforms.py:31
↓ 6 callersMethodget_metrics_fn
Returns a callable metric function for the model. Args: split: The split for which we calculate the metrics. It should be one of th
scenic/projects/baselines/plainvit/plainvit.py:310
↓ 6 callersFunctionglobal_l2_norm
(x: jnp.ndarray)
scenic/projects/pixel_llm/partition_utils.py:152
↓ 6 callersFunctionimage_to_uint8
Converts a float image to uint8. Also un-whitens the image, if needed.
scenic/projects/boundary_attention/helpers/viz_utils.py:147
↓ 6 callersFunctioninit_embedding
Initialize input embedding.
scenic/projects/mbt/model_utils.py:312
↓ 6 callersMethodlog_fewshot_summary
Call `writer` with a descriptive string and the results.
scenic/train_lib/transfer/fewshot_utils.py:331
↓ 6 callersMethodreset_access_record
Resets the record of config field accesses.
scenic/common_lib/debug_utils.py:239
↓ 6 callersMethodrun_all
Compute summary over all `datasets` that comes from config.
scenic/train_lib/transfer/fewshot_utils.py:310
↓ 6 callersFunctionscale_channel
Scale the 2D image using the autocontrast rule.
scenic/dataset_lib/big_transfer/preprocessing/autoaugment.py:302
↓ 6 callersFunctionto_cpu
Transfers array (replicated on multiple hosts) to a single host. Args: array: Replicated array of shape [num_hosts, num_devices, local_ba
scenic/projects/loca/utils.py:127
↓ 6 callersMethodunfold
Extract patches from an image. Args: im: Array of shape [N, C, H, W] to be unfolded into patches patchsize: Size of extracted patches
scenic/projects/boundary_attention/helpers/junction_functions.py:59
↓ 6 callersFunctionuniform_initializer
(minval, maxval, dtype=jnp.float32)
scenic/projects/baselines/deformable_detr/deformable_transformer.py:46
↓ 5 callersFunction_bytes_feature
(value)
scenic/projects/pixel_llm/tools/build_ln_tfrecord.py:189
↓ 5 callersFunction_merge_instances
Combine a batch of padded instance labels into a single-example label.
scenic/projects/owl_vit/preprocessing/mosaic.py:160
↓ 5 callersMethodaccumulate
(self)
scenic/projects/densevoc/vidstg_evaluator.py:260
↓ 5 callersFunctionapply_process_fn_with_populated_seed
Maps `ds` using the preprocess_fn and a deterministic RNG per example. Args: ds: Dataset containing Python dictionary with the features. The 'r
scenic/projects/pixel_llm/io/flexio.py:80
↓ 5 callersFunctiondataset_builder
Returns generators for pretraining dataset or OVEN sets. Args: batch_size: int; Determines the train batch size. eval_batch_size: int; Dete
scenic/projects/gerald/input_pipeline.py:254
↓ 5 callersMethoddecode
Forward decoder. Args: text_tokens: (batch_size, max_caption_length) encoded: (batch_size, num_tot_tokens, dim) encoder_mask: (
scenic/projects/streaming_dvc/modeling/vid2seq_model.py:274
↓ 5 callersFunctiondet
(a, b)
scenic/projects/boundary_attention/kaleidoshapes/make_kaleido_image.py:665
↓ 5 callersMethoddot_product_attention
Computes dot-product attention given query, key, and value. This is the core function for applying fast approximate dot-product attention. It
scenic/projects/fast_vit/model_utils.py:1088
↓ 5 callersMethodembed_image
Embeds image and returns image embeddings and boxes. Args: image: Single uint8 Numpy image of any size. Will be converted to float
scenic/projects/owl_vit/notebooks/inference.py:87
↓ 5 callersFunctiongather_beams
Gathers the beam slices indexed by beam_indices into new beam array. Args: nested: pytree of arrays or scalars (the latter ignored). beam_i
scenic/projects/avatar/decode.py:80
↓ 5 callersMethodget_2d_array
(self)
scenic/projects/performer/performer.py:60
↓ 5 callersFunctionget_aug_param
(aug_ratio, h, w, size)
scenic/projects/densevoc/input_utils.py:475
↓ 5 callersMethodget_dists_and_patches
Compute distance functions and piecewise-constant patches. Args: params: Array of shape [N, 5, H', W'] holding N field of junctions
scenic/projects/boundary_attention/field_of_junctions_jax/field_of_junctions.py:429
↓ 5 callersMethodget_label_map
Test get_label_map.
scenic/dataset_lib/coco_dataset/tests/test_coco_utils.py:31
next →1–100 of 4,921, ranked by callers