MCPcopy Create free account

hub / github.com/AI4HealthUOL/ecg-fm-benchmarking / functions

Functions823 in github.com/AI4HealthUOL/ecg-fm-benchmarking

↓ 21 callersFunction_string_to_class
Convert a fully qualified class name string to its corresponding class. Args: target: A string representing a class name. Can be eith
code/clinical_ts/template_modules.py:13
↓ 17 callersFunctionload_dataset
(target_root,df_filename="df_memmap.pkl")
code/clinical_ts/data/time_series_dataset_utils.py:104
↓ 17 callersFunctionmultihot_encode
(x, num_classes)
code/main_lite_base.py:31
↓ 14 callersFunction_xresnet1d
(expansion, layers, **kwargs)
code/clinical_ts/models/xresnet1d.py:180
↓ 13 callersFunctionsave_dataset
(df,lbl_itos=None,mean=None,std=None,target_root=".",df_filename="df.pkl",protocol=4)
code/clinical_ts/data/time_series_dataset_utils.py:88
↓ 12 callersFunctiondataset_add_length_col
add a length column to the dataset df
code/clinical_ts/data/time_series_dataset_utils.py:132
↓ 12 callersFunctiondataset_add_mean_col
adds a column with mean
code/clinical_ts/data/time_series_dataset_utils.py:140
↓ 12 callersFunctiondataset_add_std_col
adds a column with mean
code/clinical_ts/data/time_series_dataset_utils.py:148
↓ 12 callersFunctiondataset_get_stats
creates (weighted) means and stds from mean, std and length cols of the df
code/clinical_ts/data/time_series_dataset_utils.py:156
↓ 12 callersMethodget_id_mapping
(self)
code/clinical_ts/data/time_series_dataset.py:399
↓ 12 callersFunctionresample_data
(sigbufs, channel_labels, fs, target_fs, channels=12, channel_stoi=None)
code/clinical_ts/utils/ecg_utils.py:57
↓ 12 callersFunctionstratify
Stratifying procedure. Modified from https://vict0rs.ch/2018/05/24/sample-multilabel-dataset/ (based on Sechidis 2011) data is a list of lists: a
code/clinical_ts/utils/stratify.py:158
↓ 11 callersFunction_conj
(x)
code/clinical_ts/ts/s4_modules/s42.py:69
↓ 11 callersFunction_conj
(x)
code/clinical_ts/models/s42.py:68
↓ 9 callersMethodget_output_shape
(self)
code/clinical_ts/template_modules.py:329
↓ 9 callersFunctionmulticlass_roc_curve
Compute ROC curve and ROC area for each class "0"..."n_classes - 1" (or classnames passed via classes), "micro", "macro" returns fpr,tpr,roc (dict
code/clinical_ts/utils/eval_utils_cafa.py:24
↓ 8 callersMethod__init__
S4 analogue of the pretraining head used in modified CPC https://arxiv.org/abs/2002.02848 (in addition to layer norm) can also be used as global predi
code/clinical_ts/ts/head.py:254
↓ 8 callersFunctionmap_and_filter_labels
(df,min_cnt,lbl_cols)
code/clinical_ts/utils/ecg_utils.py:128
↓ 8 callersMethodtrain_dataloader
(self)
code/main_lite.py:251
↓ 7 callersMethod__init__
input shape: bs, seq, feat output shape: bs,seq,nc for multi_prediction else bs,nc for global_pool
code/clinical_ts/template_modules.py:320
↓ 7 callersMethod__init__
(self, num_classes, num_output_tokens, config_path=None, eval_mode="finetuning_linear", lr=1e-3, discriminativ
code/clinical_ts/models/fm_ecg.py:763
↓ 7 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
code/clinical_ts/models/ecg_foundation_models/ecg_jepa/ecg_jepa.py:110
↓ 7 callersFunctionempirical_bootstrap
performs empirical bootstrap https://ocw.mit.edu/courses/mathematics/18-05-introduction-to-probability-and-statistics-spring-2014/readings/MI
code/clinical_ts/utils/bootstrap_utils.py:12
↓ 7 callersMethodload_state_dict
S4-compatible load_state_dict with Lightning signature compatibility
code/clinical_ts/template_model.py:705
↓ 7 callersMethodregister
Utility method: register a tensor as a buffer or trainable parameter
code/clinical_ts/ts/s4_modules/s42.py:936
↓ 7 callersMethodregister
Utility method: register a tensor as a buffer or trainable parameter
code/clinical_ts/models/s42.py:935
↓ 6 callersFunctionstratified_subset
split off a stratified subset of fraction ratio from an original dataset df, stratifies according to a specified label column and age and sex
code/clinical_ts/utils/stratify.py:101
↓ 5 callersMethod__init__
(self, seq_len: int, patch_size: int, num_leads: int,
code/clinical_ts/models/ecg_foundation_models/st_mem/encoder/vit.py:152
↓ 5 callersMethod__init__
(self, num_leads: int, seq_len: int, patch_size: int,
code/clinical_ts/models/ecg_foundation_models/merl/vit1d.py:146
↓ 5 callersMethod__init__
(self, hparams_loss)
code/clinical_ts/loss/supervised.py:201
↓ 5 callersMethodaggregate_predictions
aggregates potentially multiple predictions per sample (can also pass targs for convenience) idmap: idmap as returned by TimeSeriesCr
code/clinical_ts/data/time_series_dataset.py:411
↓ 5 callersFunctioncauchy_mult
Wrap the cuda method to deal with shapes
code/extensions/cauchy/cauchy.py:46
↓ 5 callersFunctionflatten
(l)
code/clinical_ts/utils/mimic_ecg_preprocessing.py:33
↓ 5 callersMethodmodify_dataset_config
possibility modify dataset config parameters passed to dataset constructor in derived classes
code/clinical_ts/template_model.py:400
↓ 5 callersFunctiontrunc_normal_
(tensor, mean=0., std=1., a=-2., b=2.)
code/clinical_ts/models/ecg_foundation_models/ecg_jepa/ecg_jepa.py:95
↓ 4 callersMethod__init__
(self, full:bool=False)
code/clinical_ts/ts/basic_conv1d_modules/basic_conv1d.py:14
↓ 4 callersMethod__init__
(self, hparams_metric, lbl_itos, key_prefix="", key_postfix="0", test=True)
code/clinical_ts/metric/base.py:135
↓ 4 callersMethod__init__
(self, n_dims, length=14, heads=4)
code/clinical_ts/models/xresnet1d.py:56
↓ 4 callersMethod__init__
(self, full:bool=False)
code/clinical_ts/models/basic_conv1d.py:14
↓ 4 callersMethod__init__
(self, expansion, ni, nf, stride=1, kernel_size=3, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=
code/clinical_ts/models/ecg_foundation_models/ecgfm_ked.py:143
↓ 4 callersMethod__init__
(self, in_channels, base_filters, ratio, filter_list, m_blocks_list, kernel_size, stride, groups_width, n_clas
code/clinical_ts/models/ecg_foundation_models/ecg_founder.py:305
↓ 4 callersMethod_make_layer
(self, block, out_channels, num_blocks, stride)
code/clinical_ts/models/ecg_foundation_models/merl/resnet1d.py:78
↓ 4 callersFunctionconv
convolution with padding
code/clinical_ts/models/inception1d.py:12
↓ 4 callersMethodforward
(self, **kwargs)
code/clinical_ts/template_model.py:165
↓ 4 callersFunctionget_constant_schedule
Create a schedule with a constant learning rate, using the learning rate set in optimizer. Args: optimizer (:class:`~torch.optim.Opt
code/clinical_ts/utils/schedulers.py:11
↓ 4 callersFunctionget_constant_schedule_with_warmup
Create a schedule with a constant learning rate preceded by a warmup period during which the learning rate increases linearly between 0 and t
code/clinical_ts/utils/schedulers.py:28
↓ 4 callersFunctionget_cosine_schedule_with_warmup
Create a schedule with a learning rate that decreases following the values of the cosine function between the initial lr set in the optimizer
code/clinical_ts/utils/schedulers.py:84
↓ 4 callersFunctionget_cosine_with_hard_restarts_schedule_with_warmup
Create a schedule with a learning rate that decreases following the values of the cosine function between the initial lr set in the optimizer
code/clinical_ts/utils/schedulers.py:119
↓ 4 callersMethodget_fold_ids
(self, fold_ids, all_ids, stage="train_supervised")
code/clinical_ts/template_model.py:413
↓ 4 callersFunctionget_invsqrt_decay_schedule_with_warmup
Create a schedule with a learning rate that decreases as a with an inverse sqrt law, after a warmup period during which it increases linearl
code/clinical_ts/utils/schedulers.py:203
↓ 4 callersFunctionget_linear_schedule_with_warmup
Create a schedule with a learning rate that decreases linearly from the initial lr set in the optimizer to 0, after a warmup period during wh
code/clinical_ts/utils/schedulers.py:54
↓ 4 callersFunctionget_polynomial_decay_schedule_with_warmup
Create a schedule with a learning rate that decreases as a polynomial decay from the initial lr set in the optimizer to end lr defined by `lr
code/clinical_ts/utils/schedulers.py:155
↓ 4 callersFunctionmultihot_encode
(x, num_classes)
code/clinical_ts/utils/mimic_ecg_preprocessing.py:5
↓ 4 callersMethodremove
Remove the hook from the model.
code/clinical_ts/utils/callbacks.py:25
↓ 4 callersMethodrestrict_leads
(self, vec, type='vector')
code/clinical_ts/models/ecg_foundation_models/ecg_jepa/ecg_jepa.py:369
↓ 4 callersMethodtrain_dataloader
(self)
code/main_lite_base.py:353
↓ 4 callersMethodtrain_dataloader
(self)
code/clinical_ts/template_model.py:606
↓ 3 callersFunctionActivation
(activation=None, dim=-1)
code/clinical_ts/ts/s4_modules/s42.py:106
↓ 3 callersFunctionActivation
(activation=None, dim=-1)
code/clinical_ts/models/s42.py:105
↓ 3 callersMethod__init__
(self,num_steps=1200000,lrstart=3e-4,lrend=1.25e-6)
code/clinical_ts/utils/callbacks.py:137
↓ 3 callersMethod__init__
d_state: the dimension of the state, also denoted by N l_max: the maximum sequence length, also denoted by L if this is not
code/clinical_ts/ts/s4_modules/s42.py:1025
↓ 3 callersMethod__init__
d_state: the dimension of the state, also denoted by N l_max: the maximum sequence length, also denoted by L if this is not
code/clinical_ts/models/s42.py:1024
↓ 3 callersMethod__init__
(self, ni, nf)
code/clinical_ts/models/inception1d.py:37
↓ 3 callersFunction_conv1d
(in_planes,out_planes,kernel_size=3, stride=1, dilation=1, act="relu", bn=True, drop_p=0, layer_norm=False)
code/clinical_ts/ts/basic_conv1d_modules/basic_conv1d.py:50
↓ 3 callersMethod_cross_attention_mask
(self)
code/clinical_ts/models/ecg_foundation_models/ecg_jepa/ecg_jepa.py:304
↓ 3 callersMethod_omega
Calculate (and cache) FFT nodes and their "unprocessed" them with the bilinear transform This should be called everytime the internal length
code/clinical_ts/ts/s4_modules/s42.py:517
↓ 3 callersMethod_omega
Calculate (and cache) FFT nodes and their "unprocessed" them with the bilinear transform This should be called everytime the internal length
code/clinical_ts/models/s42.py:516
↓ 3 callersMethod_step
(self,data_batch, batch_idx, train, test=False, dataloader_idx=0)
code/main_lite_base.py:359
↓ 3 callersMethod_step
(self,data_batch, batch_idx, train, test=False, dataloader_idx=0)
code/main_lite.py:260
↓ 3 callersMethod_step
(self,data_batch, batch_idx, train, test=False, dataloader_idx=0, freeze_bn=False)
code/clinical_ts/template_model.py:171
↓ 3 callersMethod_step_state_linear
Version of the step function that has time O(N) instead of O(N^2) per step, which takes advantage of the DPLR form and bilinear discretizatio
code/clinical_ts/ts/s4_modules/s42.py:777
↓ 3 callersMethod_step_state_linear
Version of the step function that has time O(N) instead of O(N^2) per step, which takes advantage of the DPLR form and bilinear discretizatio
code/clinical_ts/models/s42.py:776
↓ 3 callersFunctioncos_anneal
ramp from (e0, t0) -> (e1, t1) through a cosine schedule based on e in [e0, e1]
code/clinical_ts/utils/misc_utils.py:62
↓ 3 callersFunctioncreate_default_config
()
code/clinical_ts/config.py:40
↓ 3 callersFunctioncreate_head1d
Model head that takes `nf` features, runs through `lin_ftrs`, and about `nc` classes; added bn and act here
code/clinical_ts/models/basic_conv1d.py:126
↓ 3 callersMethodforward_encoding
(self, series)
code/clinical_ts/models/ecg_foundation_models/merl/vit1d.py:189
↓ 3 callersMethodget_modules
returns submodules assigned to encoder, predictor and head for discriminative learning rates
code/clinical_ts/template_modules.py:589
↓ 3 callersMethodget_output_shape
(self)
code/clinical_ts/ts/head.py:280
↓ 3 callersMethodload_weights_from_checkpoint
Function that loads the weights from a given checkpoint file. based on https://github.com/PyTorchLightning/pytorch-lightning/issues/525
code/clinical_ts/template_model.py:662
↓ 3 callersMethodpreprocess_dataset
override preprocessing in derived classes if desired
code/clinical_ts/template_model.py:404
↓ 3 callersFunctionregression_metrics
metrics: list of metrics to compute ["mae", "r2"]. If None, computes all. target_names: list of names for each regression target
code/clinical_ts/utils/eval_utils_regression.py:6
↓ 2 callersMethod__init__
(self,num_steps=1200000,lrstart=3e-4,lrend=1.25e-6)
code/clinical_ts/utils/misc_utils.py:99
↓ 2 callersMethod__init__
input shape: bs, seq, feat output shape: bs,seq,nc for multi_prediction else bs,nc for global_pool
code/clinical_ts/utils/heads.py:13
↓ 2 callersMethod__init__
(self, block, num_blocks, num_classes=10)
code/clinical_ts/models/ecg_foundation_models/merl/resnet1d.py:64
↓ 2 callersFunction_conv1d
(in_planes,out_planes,kernel_size=3, stride=1, dilation=1, act="relu", bn=True, drop_p=0, layer_norm=False)
code/clinical_ts/models/basic_conv1d.py:50
↓ 2 callersMethod_export_predictions
(self, preds, targs, dataloader_idx, epoch, agg, version)
code/main_lite_base.py:252
↓ 2 callersMethod_getitem
(self, idx,start_idx_rel)
code/clinical_ts/data/time_series_dataset.py:288
↓ 2 callersFunction_resolve_conj
(x)
code/clinical_ts/ts/s4_modules/s42.py:73
↓ 2 callersFunction_resolve_conj
(x)
code/clinical_ts/models/s42.py:72
↓ 2 callersMethod_setup_C
Construct C~ from C double_length: current C is for length L, convert it to length 2L
code/clinical_ts/ts/s4_modules/s42.py:496
↓ 2 callersMethod_setup_C
Construct C~ from C double_length: current C is for length L, convert it to length 2L
code/clinical_ts/models/s42.py:495
↓ 2 callersMethod_setup_state
Construct dA and dB for discretized state equation
code/clinical_ts/ts/s4_modules/s42.py:820
↓ 2 callersMethod_setup_state
Construct dA and dB for discretized state equation
code/clinical_ts/models/s42.py:819
↓ 2 callersFunction_string_to_class
Convert string target to class object.
code/clinical_ts/utils/basic_io.py:45
↓ 2 callersMethod_w
(self)
code/clinical_ts/ts/s4_modules/s42.py:615
↓ 2 callersMethod_w
(self)
code/clinical_ts/models/s42.py:614
↓ 2 callersMethodattrib
(self,relevant,irrelevant)
code/clinical_ts/models/ecg_foundation_models/ecgfm_ked.py:65
↓ 2 callersFunctionauc_prrc_uninterpolated
uninterpolated auc as used by sklearn https://github.com/scikit-learn/scikit-learn/blob/1495f6924/sklearn/metrics/ranking.py see also the discussion a
code/clinical_ts/utils/eval_utils_cafa.py:17
↓ 2 callersFunctionbn_drop_lin
Sequence of batchnorm (if `bn`), dropout (with `p`) and linear (`n_in`,`n_out`) layers followed by `actn`. permute for input of the form B,S
code/clinical_ts/ts/basic_conv1d_modules/basic_conv1d.py:21
↓ 2 callersFunctionbn_drop_lin
Sequence of batchnorm (if `bn`), dropout (with `p`) and linear (`n_in`,`n_out`) layers followed by `actn`. permute for input of the form B,S
code/clinical_ts/models/basic_conv1d.py:21
next →1–100 of 823, ranked by callers