Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/COLA-Laboratory/OmniGenBench
/ functions
Functions
955 in github.com/COLA-Laboratory/OmniGenBench
⨍
Functions
955
◇
Types & classes
187
↓ 328 callers
Method
get
Get the value of a key from the parameter dict. If the key is found, increment its call frequency. :param key: The key to look for in
omnigenbench/auto/config/auto_config.py:88
↓ 319 callers
Function
fprint
r""" Enhanced print function with automatic flushing. It provides a print-like interface with automatic flushing to ensure output is displayed
omnigenbench/src/misc/utils.py:370
↓ 156 callers
Method
pop
Pop a value from the parameter dict. :param args: Arguments to pop from the parameter dict. :return: The value popped from th
omnigenbench/auto/config/auto_config.py:108
↓ 101 callers
Method
items
Get a list of all key-value pairs in the parameter dict. :return: A list of all key-value pairs in the parameter dict.
omnigenbench/auto/config/auto_config.py:130
↓ 79 callers
Method
load
Load a complete model from a saved directory. This method performs a comprehensive load operation that restores: - Model met
omnigenbench/src/abc/abstract_model.py:1270
↓ 57 callers
Method
from_pretrained
Loads a pre-trained model and tokenizer. :param config_or_model: The name or path of the pre-trained model. :param tokenizer
omnigenbench/src/abc/abstract_model.py:1554
↓ 48 callers
Method
update
Update the parameter dict with the given arguments and keyword arguments, and check if the updated configuration is valid. :param arg
omnigenbench/auto/config/auto_config.py:99
↓ 47 callers
Method
to
Move model to specified device and/or change dtype.
omnigenbench/src/model/embedding/model.py:800
↓ 33 callers
Method
to
Move model to specified device/dtype and keep device tracking in sync.
omnigenbench/src/abc/abstract_model.py:1517
↓ 32 callers
Method
_forward_from_raw_input
Tokenizes raw input and performs a forward pass in no_grad mode. This method supports two preprocessing strategies: 1. If da
omnigenbench/src/abc/abstract_model.py:1344
↓ 31 callers
Method
keys
Get a list of all keys in the parameter dict. :return: A list of all keys in the parameter dict.
omnigenbench/auto/config/auto_config.py:116
↓ 30 callers
Method
save
Save the complete model, tokenizer, and metadata to a directory. This method performs a comprehensive save operation that includes:
omnigenbench/src/abc/abstract_model.py:911
↓ 30 callers
Method
values
Get a list of all values in the parameter dict. :return: A list of all values in the parameter dict.
omnigenbench/auto/config/auto_config.py:123
↓ 28 callers
Method
inference
This method takes raw sequences or tokenized inputs and returns processed predictions that are ready for human consumption. It
omnigenbench/src/abc/abstract_model.py:581
↓ 27 callers
Method
eval
Set model to evaluation mode.
omnigenbench/src/utility/model_hub/model_hub.py:180
↓ 25 callers
Method
__init__
Build the CNN backbone. Parameters ---------- cfg : BaselineConfig Configuration with embedding and convolution h
omnigenbench/src/model/baselines.py:1492
↓ 22 callers
Method
model
Load model for batch testing
tests/test_autoinfer_cli.py:355
↓ 21 callers
Method
design
Design RNA sequences for a target structure using evolutionary algorithms. Args: structure (str): Target secondary struc
omnigenbench/src/model/rna_design/model.py:393
↓ 20 callers
Method
encode
Encode a single sequence into pooled embeddings. Args: sequence (str): Input DNA or RNA sequence for encoding. max_le
omnigenbench/src/abc/embedding_mixin.py:250
↓ 14 callers
Method
load
Load a model with the following priority: 1) If the identifier is on Hugging Face, download it first. 2) Prefer instantiating
omnigenbench/src/utility/model_hub/model_hub.py:683
↓ 13 callers
Method
from_pretrained
( cls, save_directory: str, tokenizer=None, map_location=None, **kwargs )
omnigenbench/src/model/baselines.py:219
↓ 11 callers
Method
extract_attention_scores
Extract attention scores from a single genomic sequence. This method extracts attention weights from transformer layers, providing insights
omnigenbench/src/abc/embedding_mixin.py:379
↓ 11 callers
Method
fold
Predicts RNA secondary structure for given sequences. This method predicts RNA secondary structures using ViennaRNA. It supports
omnigenbench/src/misc/utils.py:127
↓ 11 callers
Method
run
Placeholder for running functionality related to the benchmark hub.
omnigenbench/auto/bench_hub/bench_hub.py:21
↓ 10 callers
Method
batch_encode
Batch encode sequences into aggregated (pooled) embeddings. Args: sequences (List[str]): Input DNA or RNA sequences for encoding.
omnigenbench/src/abc/embedding_mixin.py:36
↓ 10 callers
Method
unwrap_model
Unwrap the model from any distributed training wrappers. Args: model (Optional[torch.nn.Module]): Model to unwrap (defau
omnigenbench/src/trainer/trainer.py:339
↓ 9 callers
Method
last_hidden_state_forward
Performs a forward pass to get the last hidden state from the base model. It also handles compatibility with different model architec
omnigenbench/src/abc/abstract_model.py:400
↓ 9 callers
Method
train
Train the model using HuggingFace Trainer. Args: path_to_save (Optional[str]): Path to save the trained model
omnigenbench/src/trainer/hf_trainer.py:181
↓ 8 callers
Method
_concatenate_outputs
Concatenate list of outputs. Args: outputs (List[np.ndarray]): List of output arrays Returns: np.nd
omnigenbench/src/trainer/base_trainer.py:786
↓ 8 callers
Method
device
Return the actual device of model parameters, not cached value.
omnigenbench/src/abc/abstract_model.py:1509
↓ 8 callers
Function
env_meta_info
Collects metadata about the current environment and library versions. This function gathers information about the current Python environment
omnigenbench/src/misc/utils.py:255
↓ 8 callers
Function
load_module_from_path
This function dynamically loads a Python module from a file path, useful for loading configuration files or custom modules. Args:
omnigenbench/src/misc/utils.py:441
↓ 7 callers
Function
download_benchmark
Downloads a benchmark dataset from HuggingFace Hub or OmniGenome repository. **Unified Download Strategy**: This function now uses the same
omnigenbench/src/utility/hub_utils.py:422
↓ 7 callers
Method
evaluate
Evaluate the model on the validation dataset. Returns: Dict[str, Any]: Dictionary containing evaluation metrics
omnigenbench/src/trainer/hf_trainer.py:227
↓ 7 callers
Method
predict
This method takes raw sequences or tokenized inputs and returns the raw model outputs (logits, hidden states, etc.) without p
omnigenbench/src/abc/abstract_model.py:542
↓ 7 callers
Method
predict
Generate predictions using the trained model. Args: data_loader (DataLoader): DataLoader for prediction data Re
omnigenbench/src/trainer/base_trainer.py:697
↓ 6 callers
Method
__init__
Initialize the token regression model. Args: config_or_model: Model configuration or pre-trained model token
omnigenbench/src/model/regression/model.py:37
↓ 6 callers
Function
create_autobench_parser
Create the autobench subcommand parser.
omnigenbench/cli/ogb_cli.py:167
↓ 6 callers
Function
download_from_hf_hub
Download model or dataset from HuggingFace Hub using official API (no git-lfs required). This function uses HuggingFace's `snapshot_download
omnigenbench/src/utility/model_hub/hf_download.py:39
↓ 6 callers
Method
from_hub
Load AutoConfig from a HuggingFace Hub dataset or local directory. This method automatically downloads the dataset if needed and loa
omnigenbench/auto/config/auto_config.py:220
↓ 6 callers
Method
save_pretrained
(self, save_directory: str, overwrite: bool = True)
omnigenbench/src/model/baselines.py:198
↓ 6 callers
Method
train
Train the model using distributed training. This method performs the complete training loop with validation, early stopping,
omnigenbench/src/trainer/accelerate_trainer.py:216
↓ 5 callers
Method
__init__
Initializes the token classification model. Args: config_or_model: Model configuration, pre-trained model path, or model
omnigenbench/src/model/classification/model.py:73
↓ 5 callers
Method
flatten
Flattens the ground truth and prediction arrays. It handles various input formats and converts them to 1D numpy arrays. Args
omnigenbench/src/abc/abstract_metric.py:159
↓ 5 callers
Method
loss_function
Calculates the loss. This method should be implemented by concrete model classes to define how the loss is calculated for their speci
omnigenbench/src/abc/abstract_model.py:498
↓ 5 callers
Function
seed_everything
Sets random seeds for reproducibility across all random number generators. This function sets seeds for Python's random module, NumPy, PyTorch (C
omnigenbench/src/misc/utils.py:26
↓ 4 callers
Method
__init__
Initialize the dataset for token regression. Args: dataset_name_or_path: Path to the data file or a list of paths.
omnigenbench/src/dataset/omni_dataset.py:249
↓ 4 callers
Method
__init__
Initializes the SQUIDExplainer. Args: model: The pre-trained model to be explained. gpmap (str, optional): The type o
omnigenbench/src/explainability/shared_methods/squid_explainer.py:53
↓ 4 callers
Method
_augment_batch
Augment a batch of masked sequences using a single forward pass. Args: seq_list (List[str]): List of masked sequences
omnigenbench/src/model/augmentation/model.py:128
↓ 4 callers
Method
compute_similarity
Compute cosine similarity between two embeddings. Args: embedding1 (torch.Tensor): The first embedding embed
omnigenbench/src/abc/embedding_mixin.py:356
↓ 4 callers
Function
create_autoinfer_parser
Create the autoinfer subcommand parser.
omnigenbench/cli/ogb_cli.py:31
↓ 4 callers
Function
create_autotrain_parser
Create the autotrain subcommand parser.
omnigenbench/cli/ogb_cli.py:90
↓ 4 callers
Function
find_invalid_positions
(struct: str)
examples/rna_secondary_structure_prediction/Secondary_Structure_Prediction.py:43
↓ 4 callers
Method
inference
This method provides the complete inference pipeline including preprocessing, model forward pass, and postprocessing. It's the
omnigenbench/src/utility/pipeline_hub/pipeline.py:313
↓ 4 callers
Method
inference
Performs token-level inference with human-readable output. This method provides processed, human-readable token-level predictions.
omnigenbench/src/model/classification/model.py:180
↓ 4 callers
Method
prepare_input
Prepares a single data instance for the model. Must be implemented by subclasses. Args: instance (dict): A single data i
omnigenbench/src/abc/abstract_dataset.py:1225
↓ 4 callers
Method
run
Runs the benchmarking process. This method iterates through the tasks in the benchmark, loads the corresponding configurations, initi
omnigenbench/auto/auto_bench/auto_bench.py:230
↓ 4 callers
Method
save_pretrained
Saves the base tokenizer to a directory. Args: save_directory (str): The directory to save the tokenizer to. Ex
omnigenbench/src/abc/abstract_tokenizer.py:214
↓ 4 callers
Function
verify_download_integrity
Verify that a downloaded repository has all required files. Args: local_path (str): Path to downloaded repository required_f
omnigenbench/src/utility/model_hub/hf_download.py:239
↓ 3 callers
Method
__init__
Initialize BPP processor.
examples/translation_efficiency_prediction/te_bpp_model.py:312
↓ 3 callers
Function
_build_label_maps
Build default label mappings when not provided. Returns ------- tuple(dict, dict) ``(label2id, id2label)`` consistent pair.
omnigenbench/src/model/baselines.py:2390
↓ 3 callers
Method
_is_metric_better
Check if the current metrics are better than the best metrics so far. Args: metrics (Dict[str, Any]): Current metric val
omnigenbench/src/trainer/base_trainer.py:453
↓ 3 callers
Method
_is_metric_better
Check if the current metrics are better than the best metrics so far. This method is overridden to ensure only the main process perf
omnigenbench/src/trainer/accelerate_trainer.py:506
↓ 3 callers
Method
_predict_batch
Generate predictions for a batch. Args: batch: Input batch Returns: Dict[str, torch.Tensor]: Dictio
omnigenbench/src/trainer/base_trainer.py:750
↓ 3 callers
Method
_prepare_batch
Prepare a batch for model input by moving to device. Args: batch: Input batch Returns: Batch moved
omnigenbench/src/trainer/trainer.py:100
↓ 3 callers
Method
_random_bp_span
Sample a bp span around the provided bp_span, bounded to <=400.
omnigenbench/src/model/rna_design/model.py:87
↓ 3 callers
Method
batch_extract_attention_scores
Extract attention scores from multiple genomic sequences in batches. Args: sequences (List[str]): List of input DNA or RNA sequen
omnigenbench/src/abc/embedding_mixin.py:467
↓ 3 callers
Function
config_check
Performs a basic check on the configuration arguments. Args: args: A dictionary of configuration arguments. :raises RuntimeError
omnigenbench/auto/auto_bench/config_check.py:13
↓ 3 callers
Function
conv1x1
1x1 convolution. Args: in_planes (int): Number of input channels out_planes (int): Number of output channels stride
omnigenbench/src/model/regression/resnet.py:49
↓ 3 callers
Method
decode
Converts a list of token IDs back into a sequence. Must be implemented by subclasses. Args: sequence (list): A list of t
omnigenbench/src/abc/abstract_tokenizer.py:309
↓ 3 callers
Method
device
Get the device where the model is located.
omnigenbench/src/model/embedding/model.py:796
↓ 3 callers
Function
download_dataset
Downloads a dataset from HuggingFace Hub or OmniGenBench repository. **Unified Download Strategy**: This function uses the same robust downl
omnigenbench/src/utility/hub_utils.py:615
↓ 3 callers
Method
evaluate
Evaluate the model on the validation dataset. This method runs the model in evaluation mode and computes metrics on the vali
omnigenbench/src/trainer/accelerate_trainer.py:328
↓ 3 callers
Function
generate_svg_datauri
生成 SVG 并返回 Base64 URI
examples/rna_secondary_structure_prediction/Secondary_Structure_Prediction.py:56
↓ 3 callers
Method
predict
Generate predictions for token-level regression. Args: sequence_or_inputs: Input sequences or pre-processed inputs
omnigenbench/src/model/regression/model.py:77
↓ 3 callers
Method
predict
Performs token-level prediction on raw inputs. This method takes raw sequences or tokenized inputs and returns token-level p
omnigenbench/src/model/classification/model.py:133
↓ 3 callers
Function
random_bp_span
(bp_span)
examples/rna_sequence_design/easy_rna_design_emoo.py:50
↓ 3 callers
Function
ss_validity_loss
(rna_strct: str)
examples/rna_secondary_structure_prediction/Secondary_Structure_Prediction.py:27
↓ 3 callers
Method
test
Test the model on the test dataset. Returns: Dict[str, Any]: Dictionary containing test metrics
omnigenbench/src/trainer/base_trainer.py:658
↓ 3 callers
Method
test
Test the model on the test dataset. This method runs the model in evaluation mode and computes metrics on the test dataset.
omnigenbench/src/trainer/accelerate_trainer.py:419
↓ 3 callers
Method
to
Moves all tensor values in the dictionary to the specified device. Args: device (str or torch.device): The target device
omnigenbench/src/abc/abstract_dataset.py:67
↓ 3 callers
Method
to
Move model to device/dtype.
omnigenbench/src/utility/model_hub/model_hub.py:175
↓ 3 callers
Method
to
Move the pipeline to a specific device. Args: device (str): Target device ('cpu', 'cuda', 'cuda:0', etc.). Retu
omnigenbench/src/utility/pipeline_hub/pipeline.py:158
↓ 3 callers
Function
train_command
Entry point for the OmniGenome auto-train command-line interface. :param args: A list of command-line arguments. If None, `sys.argv` is used
omnigenbench/auto/auto_train/auto_train_cli.py:30
↓ 3 callers
Function
unzip_checkpoint
This function extracts a zipped checkpoint file to a directory, making it ready for use by the model loading functions. Args: ch
omnigenbench/src/utility/hub_utils.py:24
↓ 2 callers
Method
__dict_aggregate
Recursively aggregate a dictionary of prediction results. This method recursively processes nested dictionaries and applies
omnigenbench/src/utility/ensemble.py:152
↓ 2 callers
Method
__ensemble
Aggregate prediction results by calling the appropriate aggregation method. This method determines the type of result and calls the
omnigenbench/src/utility/ensemble.py:132
↓ 2 callers
Method
__getattribute__
Get the value of an argument and increment its call count. :param arg_name: The name of the argument. :return: The value of
omnigenbench/auto/config/auto_config.py:43
↓ 2 callers
Method
__init__
Initialize the ResNet architecture. Args: channels (int): Number of input channels block: Type of ResNet blo
omnigenbench/src/model/regression/resnet.py:303
↓ 2 callers
Method
__list_aggregate
Aggregate a list of prediction results. This method handles different types of list elements and applies appropriate aggrega
omnigenbench/src/utility/ensemble.py:175
↓ 2 callers
Method
_download_dataset_from_hub
Downloads and extracts datasets from OmniGenBench Hub powered by HuggingFace. .. deprecated:: 0.3.23 Use ``omnigenbench.
omnigenbench/src/abc/abstract_dataset.py:1241
↓ 2 callers
Method
_fold_single_sequence
Predict structure for a single sequence (worker function for multiprocessing). Args: sequence (str): RNA sequence to fol
omnigenbench/src/misc/utils.py:111
↓ 2 callers
Method
_import_custom_model
(model_dir, custom_file, model_cls_name)
omnigenbench/src/utility/model_hub/model_hub.py:568
↓ 2 callers
Method
_instantiate_omni_model
Instantiate an Omni model directly from its class.
omnigenbench/src/utility/model_hub/model_hub.py:640
↓ 2 callers
Method
_mlm_mutate
Mutate population using MLM prompts and per-position masking.
omnigenbench/src/model/rna_design/model.py:190
↓ 2 callers
Method
_mlm_predict
Tokenize batch of prompts and get argmax token ids. Returns shape [B, len(structure)]
omnigenbench/src/model/rna_design/model.py:356
↓ 2 callers
Method
_mut_predictor
Predict the output of the model for the mutated parts. Args: sequence: the sequence to explain, string mutat
omnigenbench/src/explainability/shared_methods/squid_explainer.py:293
↓ 2 callers
Method
_nll
Negative log‑likelihood / loss function depending on regression type and noise model.
omnigenbench/src/explainability/shared_methods/squid_explainer.py:792
↓ 2 callers
Method
_one_hot_encode
One-hot encode the sequence. Args: sequence: the sequence to encode, string Returns: one_hot: the o
omnigenbench/src/explainability/shared_methods/squid_explainer.py:328
↓ 2 callers
Method
_postprocess_sequence
Post-process sequence based on output format (RNA uses U, DNA uses T). Args: sequence (str): DNA sequence with T bases
omnigenbench/src/model/rna_design/model.py:134
next →
1–100 of 955, ranked by callers