SYMBOL INDEX (535 symbols across 63 files) FILE: scripts/evobio10m/check_taxa.py function check_kingdom (line 34) | def check_kingdom(df): function check_hierarchy (line 50) | def check_hierarchy(df): function check_sci_name (line 97) | def check_sci_name(df): function check_id (line 119) | def check_id(df): function check_common (line 134) | def check_common(df): function main (line 157) | def main(): FILE: scripts/evobio10m/check_wds.py function log_and_continue (line 7) | def log_and_continue(err): function eprint (line 15) | def eprint(*args, **kwargs): FILE: scripts/evobio10m/get_data_stats.py function get_taxa_info (line 44) | def get_taxa_info(df, stats_path): function main (line 75) | def main(src_csv, dest_dir): FILE: scripts/evobio10m/make_catalog.py function init_parser (line 38) | def init_parser(): function log_and_continue (line 55) | def log_and_continue(err): function human (line 66) | def human(num): function write_rows (line 80) | def write_rows(split_dir, writer): FILE: scripts/evobio10m/make_catalog_reproduce.py function init_parser (line 38) | def init_parser(): function log_and_continue (line 55) | def log_and_continue(err): function human (line 66) | def human(num): function write_rows (line 80) | def write_rows(split_dir, writer, split): FILE: scripts/evobio10m/make_license_files.py function init_parser (line 19) | def init_parser(): function manifest_filepath (line 27) | def manifest_filepath(i): function get_tol10m_ids (line 31) | def get_tol10m_ids(eol_content_ids, eol_page_ids): function batched (line 44) | def batched(iterable, n): function write_from_manifest (line 53) | def write_from_manifest(reader, writer): FILE: scripts/evobio10m/make_mapping.py function get_global_id (line 22) | def get_global_id(): function get_logger (line 26) | def get_logger(): function read_eol_from_tar (line 35) | def read_eol_from_tar(imgset_path): function read_bioscan_from_part (line 72) | def read_bioscan_from_part(part): function read_inat21_from_clsdir (line 102) | def read_inat21_from_clsdir(clsdir): function worker (line 132) | def worker(queue): FILE: scripts/evobio10m/make_metadata.py class ClassIndex (line 19) | class ClassIndex: method __init__ (line 24) | def __init__(self): method get (line 27) | def get(self, taxon, *, raise_if_missing=False): function dump_json (line 44) | def dump_json(obj, path): function make_bioscan_lookup (line 50) | def make_bioscan_lookup(): function make_inat21_lookup (line 64) | def make_inat21_lookup(): function make_eol_lookup (line 77) | def make_eol_lookup(): function make_predicted_catalog_csv (line 97) | def make_predicted_catalog_csv(outfile): FILE: scripts/evobio10m/make_splits.py function make_split (line 18) | def make_split(table_name): FILE: scripts/evobio10m/make_wds.py function load_img (line 33) | def load_img(file): function load_blacklists (line 40) | def load_blacklists(): function copy_eol_from_tar (line 61) | def copy_eol_from_tar(sink, imgset_path): function copy_inat21_from_clsdir (line 121) | def copy_inat21_from_clsdir(sink, clsdir): function copy_bioscan_from_part (line 166) | def copy_bioscan_from_part(sink, part): function check_status (line 207) | def check_status(): function make_txt (line 252) | def make_txt(taxon, common): function worker (line 285) | def worker(input): FILE: scripts/evobio10m/make_wds_reproduce.py function load_img (line 33) | def load_img(file): function load_blacklists (line 40) | def load_blacklists(): function copy_eol_from_tar (line 61) | def copy_eol_from_tar(sink, imgset_path): function copy_inat21_from_clsdir (line 129) | def copy_inat21_from_clsdir(sink, clsdir): function copy_bioscan_from_part (line 176) | def copy_bioscan_from_part(sink, part): function check_status (line 219) | def check_status(): function make_txt (line 264) | def make_txt(taxon, common): function worker (line 300) | def worker(input): FILE: scripts/evobio10m/taxa_viz.py function get_colors (line 13) | def get_colors(df, top_level): function make_tree (line 40) | def make_tree(df, color_map, top_level, path_idx): function get_tree (line 67) | def get_tree(df, top_level): function save_trees (line 101) | def save_trees(df, viz_path): function main (line 131) | def main(src_csv, dest_dir): FILE: scripts/get_media_manifest.py function stream_download_file (line 40) | def stream_download_file(file_path): function extract_numeric_part (line 57) | def extract_numeric_part(file_name): function generate_output_filename (line 64) | def generate_output_filename(output_dir): function extract_and_combine_csv (line 74) | def extract_and_combine_csv(tgz_file_path, output_file_path): function create_json_log (line 94) | def create_json_log(log_filename, download_start_time, tgz_md5, csv_md5,... function main (line 107) | def main(output_dir): FILE: scripts/get_missing_page_ids.py function get_scientific_name_from_eol (line 43) | def get_scientific_name_from_eol(page_id, *, max_retries=1): function clean_html (line 90) | def clean_html(string): FILE: scripts/global_names_resolver.py function resolve_names (line 38) | def resolve_names(names): function main (line 78) | def main(input_file_path, output_file_path, batch_size=300): FILE: scripts/inat21_to_wds.py function parse (line 31) | def parse(raw): function make_descriptions (line 36) | def make_descriptions(classname): FILE: scripts/inat_common_names.py function row_dict_to_taxon (line 16) | def row_dict_to_taxon(row): function load_dataset_classes (line 30) | def load_dataset_classes(): function main (line 40) | def main(): FILE: setup.py function _read_reqs (line 13) | def _read_reqs(relpath): FILE: src/evaluation/create_final_figure.py function create_final_image (line 16) | def create_final_image( function _get_args (line 137) | def _get_args(): FILE: src/evaluation/create_zoom_figure.py function _get_arrow_end (line 17) | def _get_arrow_end(img_ax, arrow_end_code): function _load_img (line 37) | def _load_img(path): function _get_rep_imgs (line 46) | def _get_rep_imgs(point, tsne_feautres, img_paths, num_imgs=4): function create_zoom_figure (line 55) | def create_zoom_figure( function _get_zoom_fig_seeds (line 204) | def _get_zoom_fig_seeds(exp_type, lvl): function get_args (line 287) | def get_args(): function _get_lvl_cls (line 299) | def _get_lvl_cls(path, lvl, is_img_path=False): function _calc_acc (line 309) | def _calc_acc(pred_list_path, lvl, lvl_cls): FILE: src/evaluation/data.py function make_splits (line 11) | def make_splits(directory) -> dict[str, list[str]]: class PretrainingData (line 49) | class PretrainingData(datasets.ImageFolder): method find_classes (line 50) | def find_classes(self, directory: str) -> tuple[list[str], dict[str, i... class UnseenData (line 61) | class UnseenData(datasets.ImageFolder): method find_classes (line 62) | def find_classes(self, directory: str) -> tuple[list[str], dict[str, i... class SeenData (line 73) | class SeenData(datasets.ImageFolder): method find_classes (line 74) | def find_classes(self, directory: str) -> tuple[list[str], dict[str, i... function img_loader (line 84) | def img_loader(filepath): class DatasetFromFile (line 90) | class DatasetFromFile(Dataset): method __init__ (line 91) | def __init__(self, filepath, label_filepath=None, transform=None, clas... method __len__ (line 113) | def __len__(self): method __getitem__ (line 116) | def __getitem__(self, idx): FILE: src/evaluation/extract_features.py class ImageFolderWithPaths (line 24) | class ImageFolderWithPaths(ImageFolder): method __getitem__ (line 25) | def __getitem__(self, index): function extract_image_features (line 31) | def extract_image_features(model, dloader, device, class_embeddings=None): function _load_model (line 54) | def _load_model(args): FILE: src/evaluation/few_shot.py function save_pickle (line 39) | def save_pickle(base_path, data): function load_pickle (line 49) | def load_pickle(file): function get_dataloader (line 54) | def get_dataloader(dataset, batch_size, num_workers): function accuracy (line 62) | def accuracy(output, target, topk=(1,)): function run (line 72) | def run(model, dataloader, args): function few_shot_eval (line 97) | def few_shot_eval(model, data, args): function split (line 113) | def split(select, kshot, nfold, i2c, filepath=None): function CL2N (line 144) | def CL2N(x_flatten, x_mean): function get_acc (line 149) | def get_acc(flatten_train, label, test, target, n_class, kshot, nfold): FILE: src/evaluation/hierarchy_tree_image.py function get_colors (line 39) | def get_colors(): function mahalanobis (line 46) | def mahalanobis(x): function create_hierarchical_tree_vis (line 57) | def create_hierarchical_tree_vis( function _get_hierarchy_lbl_map (line 252) | def _get_hierarchy_lbl_map(root): function _get_args (line 259) | def _get_args(): FILE: src/evaluation/params.py class ParseKwargs (line 5) | class ParseKwargs(argparse.Action): method __call__ (line 6) | def __call__(self, parser, namespace, values, option_string=None): function parse_args (line 18) | def parse_args(args): FILE: src/evaluation/utils.py function save_json (line 8) | def save_json(path, obj): function load_json (line 13) | def load_json(filepath): function random_seed (line 21) | def random_seed(seed=42, rank=0): function init_device (line 31) | def init_device(args): FILE: src/evaluation/zero_shot_iid.py function get_dataloader (line 36) | def get_dataloader(dataset, batch_size, num_workers): function zero_shot_classifier (line 45) | def zero_shot_classifier(model, classnames, templates, args): function accuracy (line 60) | def accuracy(output, target, topk=(1,)): function run (line 69) | def run(model, classifier, dataloader, args): function zero_shot_eval (line 101) | def zero_shot_eval(model, data, args): FILE: src/imageomics/eol.py class ImageFilename (line 13) | class ImageFilename: method from_filename (line 24) | def from_filename(cls, filename): class EolNameLookup (line 31) | class EolNameLookup: method __init__ (line 32) | def __init__(self): method guess_value (line 82) | def guess_value(self, name, genus_lookup): method add_low_quality_names (line 90) | def add_low_quality_names(self, page_ids_with_imgs): method taxon (line 128) | def taxon(self, page_id): FILE: src/imageomics/eol_reproduce.py class ImageFilename (line 13) | class ImageFilename: method from_filename (line 23) | def from_filename(cls, filename): FILE: src/imageomics/evobio10m.py function get_outdir (line 5) | def get_outdir(tag): function get_db (line 40) | def get_db(path): function load_splits (line 54) | def load_splits(db_path): class DatasetId (line 72) | class DatasetId: method __post_init__ (line 81) | def __post_init__(self): method to_tuple (line 98) | def to_tuple(self): FILE: src/imageomics/evobio10m_reproduce.py function get_outdir (line 7) | def get_outdir(tag): function get_db (line 44) | def get_db(path): function load_splits (line 58) | def load_splits(db_path): class DatasetId (line 76) | class DatasetId: method __post_init__ (line 85) | def __post_init__(self): method to_tuple (line 102) | def to_tuple(self): FILE: src/imageomics/helpers.py function csvreader (line 13) | def csvreader(filepath, **kwargs): function executerobustly (line 19) | def executerobustly(db, stmt, values, *, max_attempts=-1): FILE: src/imageomics/naming.py function clean_rank (line 17) | def clean_rank(value): class Taxon (line 29) | class Taxon: method __post_init__ (line 38) | def __post_init__(self): method empty (line 81) | def empty(self): method filled (line 93) | def filled(self): method taxonomic (line 105) | def taxonomic(self): method scientific (line 122) | def scientific(self): method tagged (line 134) | def tagged(self): method to_tuple (line 149) | def to_tuple(self): method to_dict (line 160) | def to_dict(self): method better (line 171) | def better(self, other): class NameLookup (line 196) | class NameLookup: method taxon (line 201) | def taxon(self, key: object): # Taxon | None method keys (line 205) | def keys(self): # list[object] class BioscanNameLookup (line 209) | class BioscanNameLookup(NameLookup): method __init__ (line 210) | def __init__(self): method taxon (line 228) | def taxon(self, key): method keys (line 231) | def keys(self): class iNat21NameLookup (line 235) | class iNat21NameLookup(NameLookup): method __init__ (line 236) | def __init__(self, inat21_root="/fs/ess/PAS2136/foundation_model/inat2... method taxon (line 245) | def taxon(self, key): method keys (line 248) | def keys(self): # list[int] class CommonNameLookup (line 252) | class CommonNameLookup(dict): method __init__ (line 253) | def __init__( class NameUpgrader (line 337) | class NameUpgrader: method __init__ (line 359) | def __init__(self): method _add_taxon (line 429) | def _add_taxon(self, taxon, handle_existing="raise"): method fill (line 484) | def fill(self, ranks, name): method upgrade (line 513) | def upgrade(self, taxon): function find_initial_name (line 530) | def find_initial_name(taxon: Taxon, failed=None) -> tuple[str, str]: function strip_html (line 560) | def strip_html(string): function clean_name (line 572) | def clean_name(name): function load_name_lookup (line 597) | def load_name_lookup(path, keytype=str): function get_common (line 608) | def get_common(taxon, common): FILE: src/imageomics/naming_eval.py function load_json (line 14) | def load_json(filepath): function dataset_class_to_taxon (line 18) | def dataset_class_to_taxon(cls): class Taxon (line 28) | class Taxon: method to_tuple (line 44) | def to_tuple(self): method to_dict (line 55) | def to_dict(self): method scientific_name (line 67) | def scientific_name(self): method taxonomic_name (line 78) | def taxonomic_name(self): method get_common_name (line 114) | def get_common_name(self): method sci_common_name (line 118) | def sci_common_name(self): method taxon_common_name (line 125) | def taxon_common_name(self): function to_classes (line 131) | def to_classes(data,text_type): FILE: src/imageomics/naming_reproduce.py function clean_rank (line 11) | def clean_rank(value): class Taxon (line 23) | class Taxon: method __post_init__ (line 32) | def __post_init__(self): method empty (line 75) | def empty(self): method filled (line 87) | def filled(self): method taxonomic (line 99) | def taxonomic(self): method scientific (line 116) | def scientific(self): method tagged (line 128) | def tagged(self): method to_tuple (line 143) | def to_tuple(self): method to_dict (line 154) | def to_dict(self): method better (line 165) | def better(self, other): class NameLookup (line 190) | class NameLookup: method taxon (line 195) | def taxon(self, key: object): # Taxon | None method keys (line 199) | def keys(self): # list[object] function find_initial_name (line 203) | def find_initial_name(taxon: Taxon, failed=None) -> tuple[str, str]: function strip_html (line 232) | def strip_html(string): function clean_name (line 243) | def clean_name(name): function load_name_lookup (line 267) | def load_name_lookup(path, keytype=str): function get_common (line 277) | def get_common(taxon, common): FILE: src/imageomics/test_naming.py function test_strip_html (line 4) | def test_strip_html(): function test_strip_html_recursive (line 10) | def test_strip_html_recursive(): function test_clean_name_good_names (line 16) | def test_clean_name_good_names(): function test_clean_name_parens (line 22) | def test_clean_name_parens(): function test_clean_name_comma_in_parens (line 28) | def test_clean_name_comma_in_parens(): function test_clean_name_extra_after_parens (line 34) | def test_clean_name_extra_after_parens(): function test_clean_name_subspecies (line 40) | def test_clean_name_subspecies(): function test_clean_name_subspecies2 (line 46) | def test_clean_name_subspecies2(): function test_clean_name_name_year (line 52) | def test_clean_name_name_year(): function test_clean_name_name_comma_year (line 58) | def test_clean_name_name_comma_year(): function test_clean_name_variant (line 64) | def test_clean_name_variant(): function test_clean_name_three_names (line 70) | def test_clean_name_three_names(): function test_clean_name_ampersand (line 76) | def test_clean_name_ampersand(): function test_clean_name_linebreak (line 82) | def test_clean_name_linebreak(): function test_clean_name_initials (line 88) | def test_clean_name_initials(): function test_find_initial_name (line 94) | def test_find_initial_name(): function test_find_initial_name_no_genus (line 100) | def test_find_initial_name_no_genus(): function test_find_initial_name_no_genus2 (line 106) | def test_find_initial_name_no_genus2(): function test_find_intial_name_two_holes (line 112) | def test_find_intial_name_two_holes(): function test_find_intial_name_failed_order (line 118) | def test_find_intial_name_failed_order(): function test_find_intial_name_failed_family (line 124) | def test_find_intial_name_failed_family(): function test_find_intial_name_failed_scientific (line 130) | def test_find_intial_name_failed_scientific(): function test_taxon_fills_genus_from_species_with_initials (line 136) | def test_taxon_fills_genus_from_species_with_initials(): function test_taxon_fills_genus_from_species_with_two_initials (line 142) | def test_taxon_fills_genus_from_species_with_two_initials(): function test_taxon_fills_genus_from_species_with_biologist_name (line 148) | def test_taxon_fills_genus_from_species_with_biologist_name(): function test_taxon_removes_duplicate_species (line 154) | def test_taxon_removes_duplicate_species(): function test_taxon_removes_duplicate_species2 (line 160) | def test_taxon_removes_duplicate_species2(): FILE: src/imageomics/test_wds.py function test_choose_next_shard_no_missing (line 7) | def test_choose_next_shard_no_missing(): function test_choose_next_shard_one_missing (line 22) | def test_choose_next_shard_one_missing(): function test_choose_next_shard_two_missing (line 43) | def test_choose_next_shard_two_missing(): function test_choose_next_shard_two_missing_non_sequential (line 58) | def test_choose_next_shard_two_missing_non_sequential(): FILE: src/imageomics/wds.py class ShardWriter (line 9) | class ShardWriter: method __init__ (line 12) | def __init__( method choose_next_shard (line 49) | def choose_next_shard(self, existing): method next_stream (line 70) | def next_stream(self): method write (line 95) | def write(self, obj): method finish (line 111) | def finish(self): method close (line 119) | def close(self): method __enter__ (line 127) | def __enter__(self): method __exit__ (line 131) | def __exit__(self, *args, **kw): FILE: src/open_clip/coca_model.py class MultimodalCfg (line 45) | class MultimodalCfg(CLIPTextCfg): function _build_text_decoder_tower (line 53) | def _build_text_decoder_tower( class CoCa (line 79) | class CoCa(nn.Module): method __init__ (line 80) | def __init__( method set_grad_checkpointing (line 126) | def set_grad_checkpointing(self, enable=True): method _encode_image (line 131) | def _encode_image(self, images, normalize=True): method _encode_text (line 136) | def _encode_text(self, text, normalize=True, embed_cls=True): method encode_image (line 142) | def encode_image(self, images, normalize=True): method encode_text (line 146) | def encode_text(self, text, normalize=True, embed_cls=True): method forward (line 150) | def forward(self, image, text, embed_cls=True, image_latent=None, imag... method generate (line 167) | def generate( method _generate_beamsearch (line 290) | def _generate_beamsearch( function prepare_inputs_for_generation (line 439) | def prepare_inputs_for_generation(input_ids, image_inputs, past=None, **... FILE: src/open_clip/factory.py function _natural_key (line 28) | def _natural_key(string_): function _rescan_model_configs (line 32) | def _rescan_model_configs(): function list_models (line 56) | def list_models(): function add_model_config (line 61) | def add_model_config(path): function get_model_config (line 69) | def get_model_config(model_name): function get_tokenizer (line 76) | def get_tokenizer(model_name): function load_state_dict (line 86) | def load_state_dict(checkpoint_path: str, map_location='cpu'): function load_checkpoint (line 97) | def load_checkpoint(model, checkpoint_path, strict=True): function create_model (line 107) | def create_model( function create_loss (line 243) | def create_loss(args): function create_model_and_transforms (line 274) | def create_model_and_transforms( function create_model_from_pretrained (line 327) | def create_model_from_pretrained( FILE: src/open_clip/hf_model.py class BaseModelOutput (line 21) | class BaseModelOutput: class PretrainedConfig (line 25) | class PretrainedConfig: function _camel2snake (line 32) | def _camel2snake(s): function register_pooler (line 40) | def register_pooler(cls): class MeanPooler (line 47) | class MeanPooler(nn.Module): method forward (line 50) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class MaxPooler (line 56) | class MaxPooler(nn.Module): method forward (line 59) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class ClsPooler (line 65) | class ClsPooler(nn.Module): method __init__ (line 68) | def __init__(self, use_pooler_output=True): method forward (line 73) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class HFTextEncoder (line 83) | class HFTextEncoder(nn.Module): method __init__ (line 87) | def __init__( method forward (line 137) | def forward(self, x: TensorType): method lock (line 154) | def lock(self, unlocked_layers: int = 0, freeze_layer_norm: bool = True): method set_grad_checkpointing (line 172) | def set_grad_checkpointing(self, enable=True): method init_parameters (line 175) | def init_parameters(self): FILE: src/open_clip/loss.py function gather_features (line 19) | def gather_features( class ClipLoss (line 66) | class ClipLoss(nn.Module): method __init__ (line 68) | def __init__( method get_ground_truth (line 89) | def get_ground_truth(self, device, num_logits) -> torch.Tensor: method get_logits (line 102) | def get_logits(self, image_features, text_features, logit_scale): method forward (line 120) | def forward(self, image_features, text_features, logit_scale, output_d... class CoCaLoss (line 134) | class CoCaLoss(ClipLoss): method __init__ (line 135) | def __init__( method forward (line 160) | def forward(self, image_features, text_features, logits, labels, logit... class DistillClipLoss (line 176) | class DistillClipLoss(ClipLoss): method dist_loss (line 178) | def dist_loss(self, teacher_logits, student_logits): method forward (line 181) | def forward( FILE: src/open_clip/model.py class CLIPVisionCfg (line 24) | class CLIPVisionCfg: class CLIPTextCfg (line 49) | class CLIPTextCfg: function get_cast_dtype (line 66) | def get_cast_dtype(precision: str): function _build_vision_tower (line 75) | def _build_vision_tower( function _build_text_tower (line 137) | def _build_text_tower( class CLIP (line 176) | class CLIP(nn.Module): method __init__ (line 179) | def __init__( method lock_image_tower (line 203) | def lock_image_tower(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 208) | def set_grad_checkpointing(self, enable=True): method encode_image (line 212) | def encode_image(self, image, normalize: bool = False): method encode_text (line 216) | def encode_text(self, text, normalize: bool = False): method forward (line 230) | def forward(self, image, text): class CustomTextCLIP (line 242) | class CustomTextCLIP(nn.Module): method __init__ (line 245) | def __init__( method lock_image_tower (line 260) | def lock_image_tower(self, unlocked_groups=0, freeze_bn_stats=False): method lock_text_tower (line 264) | def lock_text_tower(self, unlocked_layers: int = 0, freeze_layer_norm:... method set_grad_checkpointing (line 268) | def set_grad_checkpointing(self, enable=True): method encode_image (line 272) | def encode_image(self, image, normalize: bool = False): method encode_text (line 276) | def encode_text(self, text, normalize: bool = False): method forward (line 280) | def forward(self, image, text): function convert_weights_to_lp (line 292) | def convert_weights_to_lp(model: nn.Module, dtype=torch.float16): function convert_to_custom_text_state_dict (line 320) | def convert_to_custom_text_state_dict(state_dict: dict): function build_model_from_openai_state_dict (line 338) | def build_model_from_openai_state_dict( function trace_model (line 398) | def trace_model(model, batch_size=256, device=torch.device('cpu')): function resize_pos_embed (line 414) | def resize_pos_embed(state_dict, model, interpolation: str = 'bicubic', ... FILE: src/open_clip/modified_resnet.py class Bottleneck (line 10) | class Bottleneck(nn.Module): method __init__ (line 13) | def __init__(self, inplanes, planes, stride=1): method forward (line 42) | def forward(self, x: torch.Tensor): class AttentionPool2d (line 58) | class AttentionPool2d(nn.Module): method __init__ (line 59) | def __init__(self, spacial_dim: int, embed_dim: int, num_heads: int, o... method forward (line 68) | def forward(self, x): class ModifiedResNet (line 95) | class ModifiedResNet(nn.Module): method __init__ (line 103) | def __init__(self, layers, output_dim, heads, image_size=224, width=64): method _make_layer (line 132) | def _make_layer(self, planes, blocks, stride=1): method init_parameters (line 141) | def init_parameters(self): method lock (line 154) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 162) | def set_grad_checkpointing(self, enable=True): method stem (line 166) | def stem(self, x): method forward (line 173) | def forward(self, x): FILE: src/open_clip/openai.py function list_openai_models (line 18) | def list_openai_models() -> List[str]: function load_openai_model (line 23) | def load_openai_model( FILE: src/open_clip/pretrained.py function _pcfg (line 21) | def _pcfg(url='', hf_hub='', mean=None, std=None): function _clean_tag (line 235) | def _clean_tag(tag: str): function list_pretrained (line 240) | def list_pretrained(as_str: bool = False): function list_pretrained_models_by_tag (line 247) | def list_pretrained_models_by_tag(tag: str): function list_pretrained_tags_by_model (line 257) | def list_pretrained_tags_by_model(model: str): function is_pretrained_cfg (line 265) | def is_pretrained_cfg(model: str, tag: str): function get_pretrained_cfg (line 271) | def get_pretrained_cfg(model: str, tag: str): function get_pretrained_url (line 278) | def get_pretrained_url(model: str, tag: str): function download_pretrained_from_url (line 283) | def download_pretrained_from_url( function has_hf_hub (line 329) | def has_hf_hub(necessary=False): function download_pretrained_from_hf (line 337) | def download_pretrained_from_hf( function download_pretrained (line 348) | def download_pretrained( FILE: src/open_clip/push_to_hf_hub.py function save_config_for_hf (line 27) | def save_config_for_hf( function save_for_hf (line 45) | def save_for_hf( function push_to_hf_hub (line 65) | def push_to_hf_hub( function push_pretrained_to_hf_hub (line 124) | def push_pretrained_to_hf_hub( function generate_readme (line 163) | def generate_readme(model_card: dict, model_name: str): FILE: src/open_clip/timm_model.py class TimmModel (line 28) | class TimmModel(nn.Module): method __init__ (line 33) | def __init__( method lock (line 85) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 118) | def set_grad_checkpointing(self, enable=True): method forward (line 124) | def forward(self, x): FILE: src/open_clip/tokenizer.py function default_bpe (line 21) | def default_bpe(): function bytes_to_unicode (line 26) | def bytes_to_unicode(): function get_pairs (line 48) | def get_pairs(word): function basic_clean (line 60) | def basic_clean(text): function whitespace_clean (line 66) | def whitespace_clean(text): class SimpleTokenizer (line 72) | class SimpleTokenizer(object): method __init__ (line 73) | def __init__(self, bpe_path: str = default_bpe(), special_tokens=None): method bpe (line 98) | def bpe(self, token): method encode (line 139) | def encode(self, text): method decode (line 147) | def decode(self, tokens): function decode (line 155) | def decode(output_ids: torch.Tensor): function tokenize (line 159) | def tokenize(texts: Union[str, List[str]], context_length: int = 77) -> ... class HFTokenizer (line 194) | class HFTokenizer: method __init__ (line 197) | def __init__(self, tokenizer_name: str): method save_pretrained (line 201) | def save_pretrained(self, dest): method __call__ (line 204) | def __call__(self, texts: Union[str, List[str]], context_length: int =... FILE: src/open_clip/transform.py class AugmentationCfg (line 16) | class AugmentationCfg: class ResizeMaxSize (line 26) | class ResizeMaxSize(nn.Module): method __init__ (line 28) | def __init__(self, max_size, interpolation=InterpolationMode.BICUBIC, ... method forward (line 37) | def forward(self, img): function _convert_to_rgb (line 52) | def _convert_to_rgb(image): function image_transform (line 56) | def image_transform( FILE: src/open_clip/transformer.py class LayerNormFp32 (line 13) | class LayerNormFp32(nn.LayerNorm): method forward (line 16) | def forward(self, x: torch.Tensor): class LayerNorm (line 22) | class LayerNorm(nn.LayerNorm): method forward (line 25) | def forward(self, x: torch.Tensor): class QuickGELU (line 31) | class QuickGELU(nn.Module): method forward (line 33) | def forward(self, x: torch.Tensor): class LayerScale (line 37) | class LayerScale(nn.Module): method __init__ (line 38) | def __init__(self, dim, init_values=1e-5, inplace=False): method forward (line 43) | def forward(self, x): class PatchDropout (line 47) | class PatchDropout(nn.Module): method __init__ (line 52) | def __init__(self, prob, exclude_first_token=True): method forward (line 58) | def forward(self, x): class Attention (line 87) | class Attention(nn.Module): method __init__ (line 88) | def __init__( method forward (line 127) | def forward(self, x, attn_mask: Optional[torch.Tensor] = None): class AttentionalPooler (line 163) | class AttentionalPooler(nn.Module): method __init__ (line 164) | def __init__( method forward (line 178) | def forward(self, x: torch.Tensor): method _repeat (line 185) | def _repeat(self, query, N: int): class ResidualAttentionBlock (line 189) | class ResidualAttentionBlock(nn.Module): method __init__ (line 190) | def __init__( method attention (line 217) | def attention( method forward (line 232) | def forward( class CustomResidualAttentionBlock (line 247) | class CustomResidualAttentionBlock(nn.Module): method __init__ (line 248) | def __init__( method forward (line 282) | def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] =... class Transformer (line 288) | class Transformer(nn.Module): method __init__ (line 289) | def __init__( method get_cast_dtype (line 310) | def get_cast_dtype(self) -> torch.dtype: method forward (line 313) | def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] =... class VisionTransformer (line 323) | class VisionTransformer(nn.Module): method __init__ (line 326) | def __init__( method lock (line 395) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method init_parameters (line 428) | def init_parameters(self): method set_grad_checkpointing (line 449) | def set_grad_checkpointing(self, enable=True): method _global_pool (line 452) | def _global_pool(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.T... method forward (line 458) | def forward(self, x: torch.Tensor): class TextTransformer (line 504) | class TextTransformer(nn.Module): method __init__ (line 507) | def __init__( method init_parameters (line 555) | def init_parameters(self): method set_grad_checkpointing (line 574) | def set_grad_checkpointing(self, enable=True): method build_attention_mask (line 577) | def build_attention_mask(self): method build_cls_mask (line 585) | def build_cls_mask(self, text, cast_dtype: torch.dtype): method _repeat (line 594) | def _repeat(self, t, N: int): method forward (line 597) | def forward(self, text): class MultimodalTransformer (line 632) | class MultimodalTransformer(Transformer): method __init__ (line 633) | def __init__( method init_parameters (line 674) | def init_parameters(self): method build_attention_mask (line 692) | def build_attention_mask(self): method forward (line 700) | def forward(self, image_embs, text_embs): method set_grad_checkpointing (line 723) | def set_grad_checkpointing(self, enable=True): FILE: src/open_clip/utils.py function freeze_batch_norm_2d (line 8) | def freeze_batch_norm_2d(module, module_match={}, name=''): function _ntuple (line 48) | def _ntuple(n): FILE: src/training/data.py class CsvDataset (line 30) | class CsvDataset(Dataset): method __init__ (line 31) | def __init__(self, input_filename, transforms, img_key, caption_key, s... method __len__ (line 42) | def __len__(self): method __getitem__ (line 45) | def __getitem__(self, idx): class SharedEpoch (line 51) | class SharedEpoch: method __init__ (line 52) | def __init__(self, epoch: int = 0): method set_value (line 55) | def set_value(self, epoch): method get_value (line 58) | def get_value(self): class DataInfo (line 63) | class DataInfo: method set_epoch (line 68) | def set_epoch(self, epoch): function expand_urls (line 75) | def expand_urls(urls, weights=None): function get_dataset_size (line 96) | def get_dataset_size(shards): function get_imagenet (line 122) | def get_imagenet(args, preprocess_fns, split): function count_samples (line 168) | def count_samples(dataloader): function filter_no_caption_or_no_image (line 178) | def filter_no_caption_or_no_image(sample): function log_and_continue (line 184) | def log_and_continue(exn): function group_by_keys_nothrow (line 190) | def group_by_keys_nothrow(data, keys=base_plus_ext, lcase=True, suffixes... function tarfile_to_samples_nothrow (line 218) | def tarfile_to_samples_nothrow(src, handler=log_and_continue): function pytorch_worker_seed (line 226) | def pytorch_worker_seed(increment=0): class detshuffle2 (line 246) | class detshuffle2(wds.PipelineStage): method __init__ (line 247) | def __init__( method run (line 259) | def run(self, src): class ResampledShards2 (line 278) | class ResampledShards2(IterableDataset): method __init__ (line 281) | def __init__( method __iter__ (line 307) | def __iter__(self): function get_wds_dataset (line 331) | def get_wds_dataset(args, preprocess_img, is_train, epoch=0, floor=False... function get_csv_dataset (line 453) | def get_csv_dataset(args, preprocess_fn, is_train, epoch=0, tokenizer=No... class SyntheticDataset (line 483) | class SyntheticDataset(Dataset): method __init__ (line 485) | def __init__(self, transform=None, image_size=(224, 224), caption="Dum... method __len__ (line 494) | def __len__(self): method __getitem__ (line 497) | def __getitem__(self, idx): function get_synthetic_dataset (line 503) | def get_synthetic_dataset(args, preprocess_fn, is_train, epoch=0, tokeni... function get_dataset_fn (line 526) | def get_dataset_fn(data_path, dataset_type): function get_data (line 546) | def get_data(args, preprocess_fns, epoch=0, tokenizer=None): FILE: src/training/distributed.py function is_global_master (line 12) | def is_global_master(args): function is_local_master (line 16) | def is_local_master(args): function is_master (line 20) | def is_master(args, local=False): function is_using_horovod (line 24) | def is_using_horovod(): function is_using_distributed (line 35) | def is_using_distributed(): function world_info_from_env (line 43) | def world_info_from_env(): function init_distributed_device (line 63) | def init_distributed_device(args): function broadcast_object (line 117) | def broadcast_object(args, obj, src=0): function all_gather_object (line 130) | def all_gather_object(args, obj, dst=0): FILE: src/training/file_utils.py function remote_sync_s3 (line 10) | def remote_sync_s3(local_dir, remote_dir): function remote_sync_fsspec (line 20) | def remote_sync_fsspec(local_dir, remote_dir): function remote_sync (line 44) | def remote_sync(local_dir, remote_dir, protocol): function keep_running_remote_sync (line 54) | def keep_running_remote_sync(sync_every, local_dir, remote_dir, protocol): function start_sync_process (line 59) | def start_sync_process(sync_every, local_dir, remote_dir, protocol): function pt_save (line 64) | def pt_save(pt_obj, file_path): function pt_load (line 69) | def pt_load(file_path, map_location=None): function check_exists (line 77) | def check_exists(file_path): FILE: src/training/logger.py function setup_logging (line 4) | def setup_logging(log_file, level, include_host=False): FILE: src/training/main.py function random_seed (line 43) | def random_seed(seed=42, rank=0): function natural_key (line 53) | def natural_key(string_): function get_latest_checkpoint (line 58) | def get_latest_checkpoint(path: str, remote : bool): function main (line 74) | def main(args): function copy_codebase (line 457) | def copy_codebase(args): FILE: src/training/params.py function get_default_params (line 5) | def get_default_params(model_name): class ParseKwargs (line 14) | class ParseKwargs(argparse.Action): method __call__ (line 15) | def __call__(self, parser, namespace, values, option_string=None): function parse_args (line 26) | def parse_args(args): FILE: src/training/precision.py function get_autocast (line 5) | def get_autocast(precision): FILE: src/training/profile.py function profile_fvcore (line 18) | def profile_fvcore( function profile_fvcore_text (line 39) | def profile_fvcore_text( function profile_fvcore_image (line 58) | def profile_fvcore_image( function count_params (line 77) | def count_params(model): function profile_model (line 81) | def profile_model(model_name): function main (line 136) | def main(): FILE: src/training/scheduler.py function assign_learning_rate (line 4) | def assign_learning_rate(optimizer, new_lr): function _warmup_lr (line 9) | def _warmup_lr(base_lr, warmup_length, step): function const_lr (line 13) | def const_lr(optimizer, base_lr, warmup_length, steps): function const_lr_cooldown (line 24) | def const_lr_cooldown(optimizer, base_lr, warmup_length, steps, cooldown... function cosine_lr (line 43) | def cosine_lr(optimizer, base_lr, warmup_length, steps): FILE: src/training/train.py class AverageMeter (line 24) | class AverageMeter(object): method __init__ (line 27) | def __init__(self): method reset (line 30) | def reset(self): method update (line 36) | def update(self, val, n=1): function postprocess_clip_output (line 42) | def postprocess_clip_output(model_out): function unwrap_model (line 49) | def unwrap_model(model): function backward (line 56) | def backward(total_loss, scaler): function train_one_epoch (line 63) | def train_one_epoch(model, data, loss, epoch, optimizer, scaler, schedul... function evaluate (line 243) | def evaluate(model, data, epoch, args, tb_writer=None): function get_clip_metrics (line 338) | def get_clip_metrics(image_features, text_features, logit_scale, device): function maybe_compute_generative_loss (line 359) | def maybe_compute_generative_loss(model_out): FILE: src/training/zero_shot.py function zero_shot_classifier (line 12) | def zero_shot_classifier(model, classnames, templates, args): function accuracy (line 30) | def accuracy(output, target, topk=(1,)): function run (line 36) | def run(model, classifier, dataloader, args): function inat21_class_preprocess (line 67) | def inat21_class_preprocess(cls): function zero_shot_eval (line 72) | def zero_shot_eval(model, data, epoch, args):