MCPcopy Create free account

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

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

↓ 2 callersMethodget_losses_and_metrics
A convenience wrapper to all the loss_* functions in this class.
scenic/projects/baselines/detr/detr_base_model.py:402
↓ 2 callersFunctionget_mask
Generates random bounding box coordinates and turns them into a mask. Args: image: The image for which the bounding boxes are being generated.
scenic/projects/robust_segvit/datasets/denoise_utils.py:24
↓ 2 callersFunctionget_mask_valid_ratio
Get non-padded:padded ratio for width/height for each mask.
scenic/projects/baselines/deformable_detr/deformable_transformer.py:452
↓ 2 callersMethodget_metrics
Arrange loss dictionary into a metrics dictionary.
scenic/projects/owl_vit/matching_base_models.py:338
↓ 2 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/bert/bert_base_model.py:250
↓ 2 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/pointcloud/segmentation_model.py:216
↓ 2 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/polyvit/polyvit_base_model.py:327
↓ 2 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/boundary_attention/models/boundary_attention.py:52
↓ 2 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/ncr/base_model.py:182
↓ 2 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/vid2seq/models.py:541
↓ 2 callersFunctionget_microbatch
Fetch microbatch slice from the given batch.
scenic/train_lib/train_utils.py:1044
↓ 2 callersFunctionget_model_and_tx_and_train_state
Create model and train state.
scenic/projects/baselines/deformable_detr/trainer.py:225
↓ 2 callersMethodget_num_examples
Returns the number of examples in the TFRecordss.
scenic/projects/unloc/datasets/dataset_factory.py:797
↓ 2 callersFunctionget_number
(number)
scenic/projects/boundary_attention/loss_lib/metrics_dict.py:25
↓ 2 callersFunctionget_optim
Returns list of operation for optax optimizer.
scenic/projects/verbs_in_action/utils.py:227
↓ 2 callersMethodget_patch_consistency_loss
Calculates the loss for patch consistency.
scenic/projects/boundary_attention/loss_lib/boundary_attention_loss.py:55
↓ 2 callersMethodget_patch_supervision_loss
Calculates the loss for patch supervision.
scenic/projects/boundary_attention/loss_lib/boundary_attention_loss.py:45
↓ 2 callersMethodget_pos
Calculates the position of the rotary embedding.
scenic/projects/boundary_attention/models/model_lib/rope_embedding.py:38
↓ 2 callersFunctionget_post_exclusion_labels
Determines new labels after excluding bad classes. Excluded classes get the new label -1. Args: classes: List of tuples containing informat
scenic/projects/robust_segvit/datasets/segmentation_datasets.py:139
↓ 2 callersMethodget_rel_pos
Get relative positional embeddings. Args: q_size (int): size of query q. k_size (int): size of key k. rel_pos (Tensor): relativ
scenic/projects/baselines/centernet/modeling/vitdet.py:60
↓ 2 callersMethodget_rel_pos
Get relative positional embeddings. Args: q_size (int): size of query q. k_size (int): size of key k. rel_pos (Tensor): relativ
scenic/projects/baselines/segment_anything/modeling/image_encoder.py:174
↓ 2 callersFunctionget_resize
Resizes image to a given size. Args: resize_size: either an integer H, where H is both the new height and width of the resized image, or
scenic/dataset_lib/big_transfer/preprocessing/ops.py:162
↓ 2 callersMethodget_scale_masks
Get scale masks for patches with variable patchsizes.
scenic/projects/boundary_attention/helpers/junction_functions.py:301
↓ 2 callersMethodget_sd_coef
(self, sd_str, lyr)
scenic/projects/adversarialtraining/models/vit_advtrain.py:183
↓ 2 callersFunctionget_size_with_aspect_ratio
Output (h, w) such that smallest side in image_size resizes to size.
scenic/projects/baselines/detr/transforms.py:361
↓ 2 callersMethodget_text_tokens_and_pad_visual_features
Get inputs to the text decoder. In evaluation, we create the zero-padded text-token with the first token being BOS. In training, we handle
scenic/projects/streaming_dvc/modeling/model.py:273
↓ 2 callersFunctionget_tokenizer
Get tokenizer to decode strings for eval.
scenic/projects/vid2seq/trainer.py:927
↓ 2 callersFunctionget_tokenizer
(tokenizer_weight_path)
scenic/projects/streaming_dvc/io/ops.py:36
↓ 2 callersMethodget_train_state
Generates the initial training state.
scenic/train_lib/tests/test_classification_trainer.py:55
↓ 2 callersMethodget_train_state
Generates the initial training state.
scenic/projects/vivit/tests/test_vivit_trainer.py:54
↓ 2 callersFunctionget_vg_eval_source
Returns the visual genome train source.
scenic/projects/pixel_llm/configs/bert/pixel_llm_bert_densecap.py:82
↓ 2 callersFunctionget_vg_eval_source
Returns the visual genome train source.
scenic/projects/pixel_llm/configs/t5/pixel_llm_t5_densecap.py:82
↓ 2 callersMethodget_vqa_metrics
Returns the VQA Accuracy for the validation / test set. Args: logits: Output of model in shape [B, L, C]. batch: Batch of data that h
scenic/projects/knowledge_visual_language/models/knowledge_fid.py:625
↓ 2 callersFunctionhash_file
(path)
scenic/projects/baselines/clip/download.py:30
↓ 2 callersFunctionhn_nce_loss_with_hardnegs
Returns HN-NCE loss when considering verb hard negatives.
scenic/projects/verbs_in_action/losses.py:112
↓ 2 callersFunctionhn_nce_loss_without_hardnegs
Returns HN-NCE loss when *not* considering verb hard negatives.
scenic/projects/verbs_in_action/losses.py:95
↓ 2 callersFunctionidentity
tf.identity for nested dictionary of Tensors.
scenic/projects/baselines/centernet/transforms.py:136
↓ 2 callersFunctionimagenet_load_split
Creates a split from the ImageNet dataset using TensorFlow Datasets. For the training set, we drop the last partial batch. This is fine to do bec
scenic/dataset_lib/imagenet_dataset.py:209
↓ 2 callersFunctioninit_bert_from_train_state
Updates the train_state with data from restored_train_state.
scenic/projects/baselines/bert/model.py:185
↓ 2 callersFunctioninit_embedding
Initialize input embedding.
scenic/projects/av_mae/mbt.py:1485
↓ 2 callersFunctioninit_encoderblock
Initialize encoder_block_parameters.
scenic/projects/mbt/model_utils.py:380
↓ 2 callersMethodinit_from_train_state
Updates the train_state with data from `restored_train_state`.
scenic/projects/boundary_attention/models/boundary_attention.py:73
↓ 2 callersMethodinit_from_train_state
Updates the train_state with data from `restored_train_state`. This function is writen to be used for 'finetuning' experiments. Args: t
scenic/projects/ncr/resnet.py:148
↓ 2 callersFunctioninit_posemb
Initialize the positional embeddings.
scenic/projects/polyvit/model_utils.py:346
↓ 2 callersFunctioninit_state
Initialize the train state.
scenic/projects/vid2seq/trainer.py:447
↓ 2 callersFunctioninit_token_learner_from_train_state
Updates the train_state with data from restored_train_state. This function is writen to be used for 'fine-tuning' experiments. Here, we do some s
scenic/projects/token_learner/model.py:768
↓ 2 callersFunctioninitialise_from_separate_encoders
Initialise MBT parameters from MultiMAE with separate encoders. Args: params: PyTree of model parameters in the target model. restored_params
scenic/projects/av_mae/mbt.py:1127
↓ 2 callersFunctioninitialise_from_train_state
Updates the train_state with data from restored_train_state. This function is written to be used for 'fine-tuning' experiments. Here, we do some
scenic/projects/av_mae/mbt.py:881
↓ 2 callersFunctioninitialise_from_vit
Initialize the parameters from a ViT like model.
scenic/projects/av_mae/mbt.py:1014
↓ 2 callersFunctioninput_spec_to_jax_shape_dtype_struct
Parse an input specs into a jax.ShapeDtypeStruct.
scenic/common_lib/debug_utils.py:90
↓ 2 callersFunctioninterpolate_positional_embeddings
Interpolate positional embeddings from one size to another. Args: restored_posemb_grid: Positional embeddings from restored model. Shape is
scenic/projects/mbt/model_utils.py:35
↓ 2 callersFunctioninterpolate_positional_embeddings
Interpolate positional embeddings from one size to another. Args: restored_posemb_grid: Positional embeddings from restored model. Shape is
scenic/projects/vivit/model_utils.py:224
↓ 2 callersFunctioninterpolate_positional_embeddings
Interpolate positional embeddings from one size to another. Args: restored_posemb_grid: Positional embeddings from restored model. Shape is
scenic/projects/av_mae/mbt.py:1365
↓ 2 callersFunctionintersect_line_segments
Intersect two line segments. Given two 2D line segments, where a line segment is defined as two 2D points. Finds the point of intersection or ret
scenic/model_lib/base_models/box_utils.py:270
↓ 2 callersFunctioniou
Compute the IOU between two intervals. Args: interval_1: A tuple (start, end) containing the first interval. interval_2: A tuple (start, en
scenic/projects/vid2seq/dvc_eval.py:112
↓ 2 callersFunctionl2_normalize
Normalizes along dimension `axis` using an L2 norm. This specialized function exists for numerical stability reasons. Args: x: An input ndarr
scenic/projects/knowledge_visual_language/models/layers.py:44
↓ 2 callersFunctionl2_normalize
L2 normalize an input tensor.
scenic/projects/ncr/loss.py:81
↓ 2 callersMethodlabel_losses_and_metrics
Classification softmax cross entropy loss. Args: outputs: Model predictions. For the purpose of this loss, outputs must have key 'p
scenic/projects/layout_denoise/base_model.py:58
↓ 2 callersMethodlabels_losses_and_metrics
Classification softmax cross entropy loss and (optionally) top-1 correct. Args: outputs: Model predictions. For the purpose of this loss, o
scenic/projects/baselines/detr/detr_base_model.py:234
↓ 2 callersFunctionload_dataset
Loads a split from the COCO dataset using TensorFlow Datasets. Args: file_patterns: the data file patterns. dataset_configs: the dataset_co
scenic/projects/layout_denoise/datasets/dataset.py:166
↓ 2 callersFunctionload_encoder_params
Load encoder parameters.
scenic/projects/vid2seq/trainer.py:425
↓ 2 callersFunctionload_split_from_tfds
Loads a split from the COCO dataset using TensorFlow Datasets. Args: batch_size: int; The batch size returned by the data pipeline. train:
scenic/projects/densevoc/input_pipeline.py:92
↓ 2 callersFunctionlogit
Logit (inverse sigmoid) function (https://en.wikipedia.org/wiki/Logit).
scenic/projects/owl_vit/utils.py:121
↓ 2 callersMethodlogits_to_probs
(self, logits: jnp.ndarray, log_p: bool = False)
scenic/projects/baselines/detr/detr_base_model.py:222
↓ 2 callersFunctionloss_fn
(params)
scenic/train_lib/transfer/linear_probe_utils.py:88
↓ 2 callersFunctionloss_fn
(params)
scenic/projects/layout_denoise/trainer.py:121
↓ 2 callersFunctionloss_fn
(params_to_learn, params_to_freeze)
scenic/projects/pixel_llm/partition_utils.py:111
↓ 2 callersFunctionloss_fn
(params_to_learn, params_to_freeze)
scenic/projects/streaming_dvc/partition_utils.py:111
↓ 2 callersFunctionmake_coco_transforms
Returns a preprocessing function that operates on inputs and labels.
scenic/projects/baselines/detr/input_pipeline_detection.py:46
↓ 2 callersFunctionmake_coco_transforms
Returns a preprocessing function that operates on inputs and labels.
scenic/projects/baselines/deformable_detr/input_pipeline_detection.py:55
↓ 2 callersFunctionmake_resize_crop_transforms
Preprocessing and data-augmentation functions. Currently it only supports the default data augmentation in detectron2. Args: image_set: 't
scenic/projects/baselines/centernet/input_pipeline.py:40
↓ 2 callersFunctionmark_not_promptable
Marks a tensor of strings as not-promptable by appending a marker.
scenic/projects/owl_vit/preprocessing/label_ops.py:294
↓ 2 callersMethodmatcher
Implements a matching function. Matching function matches output detections against ground truth detections and returns indices. Args:
scenic/projects/baselines/detr/detr_base_model.py:177
↓ 2 callersMethodmaybe_project_visual_feature
Project visual features if self.project_layers_name != 'none'. Args: visual_features: (batch_size, num_tokens, dim) train: bool R
scenic/projects/streaming_dvc/modeling/model.py:192
↓ 2 callersFunctionmerge_cap_time_tokens
Merge tensors of time and text tokens into a single tensor. Args: caption_tokens: Tensor of text tokens for each event. timestamp_token: Te
scenic/projects/vid2seq/data_utils.py:79
↓ 2 callersMethodmerge_gt_anno
VG ground truth are overlaping. We need to merge them before evaluating. Original code: github.com/jcjohnson/densecap/blob/maste*/densecap/
scenic/projects/pixel_llm/evaluators.py:791
↓ 2 callersFunctionmetrics_fn
(train_state, batch, predictions, task)
scenic/projects/layout_denoise/trainer.py:181
↓ 2 callersFunctionmodelnet40_load_split
Creates a split from the ModelNet40 dataset using TensorFlow Datasets. For the training set, we drop the last partial batch. This is fine to do b
scenic/projects/pointcloud/pointcloud_dataset.py:70
↓ 2 callersFunctionnoncausal_denominator
Computes FAVOR+ normalizer in noncausal attention AV. Args: qs: query_prime tensor of the shape [B...,L,H,M], where M stands for the numb
scenic/projects/performer/performer.py:141
↓ 2 callersFunctionnoncausal_numerator
Computes not-normalized FAVOR+ noncausal attention AV. Args: qs: query_prime tensor of the shape [B...,L,H,M], where M stands for the num
scenic/projects/performer/performer.py:124
↓ 2 callersFunctionnormalize_answer
(prediction: str)
scenic/projects/knowledge_visual_language/models/metrics_vqa.py:35
↓ 2 callersFunctionnormalize_image
(image)
scenic/dataset_lib/imagenet_dataset.py:149
↓ 2 callersFunctionparse_sent
Sentence preprocessor.
scenic/projects/vid2seq/dvc_eval.py:589
↓ 2 callersMethodpaused
A context manager for temporarily pausing to await arguments. Example: with chrono.paused(wait_for=some_jax_operations): # Op
scenic/train_lib/train_utils.py:1269
↓ 2 callersFunctionpmapped_steps
Returns the pmapped train and eval steps.
scenic/projects/vid2seq/trainer.py:364
↓ 2 callersFunctionpoint_inside_shape
(point, shape)
scenic/projects/boundary_attention/kaleidoshapes/make_kaleido_image.py:521
↓ 2 callersMethodpostprocess_masks
Resize masks to input resolution.
scenic/projects/baselines/segment_anything/modeling/sam.py:197
↓ 2 callersMethodprepare_text_features
Extract text features of text token.
scenic/projects/pixel_llm/modeling/pixel_llm.py:1456
↓ 2 callersMethodpreprocess
Proprocess images. Normalize pixels for non-padded pixels.
scenic/projects/baselines/centernet/modeling/centernet.py:523
↓ 2 callersFunctionpreprocess_features
Whitens features and adds a bias term.
scenic/train_lib/transfer/fewshot_utils.py:139
↓ 2 callersFunctionpreprocess_features
Whitens features and adds a bias term.
scenic/projects/baselines/bert/train_utils.py:99
↓ 2 callersMethodpreprocess_image
Preprocesses a uint8 image to the format required by the model.
scenic/projects/owl_vit/notebooks/inference.py:68
↓ 2 callersFunctionprocess_and_fetch_to_host
Used to collect predictions and targets of the whole valid/test set. Forked from scenic/projects/baselines/detr/train_utils.py Args: pred_or
scenic/projects/streaming_dvc/evaluate.py:219
↓ 2 callersFunctionrandom_top_k
Select top k elements from the given vector x, randomly breaking ties. Args: vec: input vector. k: number of elements to select prng_ke
scenic/projects/baselines/centernet/modeling/iou_assignment.py:80
↓ 2 callersMethodreload_ground_truth
Reload GT annotations, optionally just a subset.
scenic/dataset_lib/coco_dataset/coco_eval.py:82
↓ 2 callersMethodremove_cls_token
Remove the cls token.
scenic/projects/av_mae/vivit_multimodal.py:405
↓ 2 callersFunctionremove_nonascii
(text)
scenic/projects/vid2seq/trainer.py:62
↓ 2 callersFunctionrender_image_from_shapes
Render image using dictionary of shapes and associated RGB colors. Args: shapes: list of shape dictionaries, in order of back-object to front-o
scenic/projects/boundary_attention/kaleidoshapes/make_kaleido_image.py:254
↓ 2 callersFunctionresize
Resize the image to min-side = size and adjust target boxes, area, mask. Args: features: dict; 'inputs' contains tf.Tensor image unbatched. 'la
scenic/projects/baselines/centernet/transforms.py:255
↓ 2 callersFunctionresize
Resize the image to min-side = size and adjust target boxes, area, mask. Args: features: dict; 'inputs' contains tf.Tensor image unbatched. 'la
scenic/projects/baselines/detr/transforms.py:385
← previousnext →501–600 of 4,921, ranked by callers