MCPcopy Create free account

hub / github.com/athms/learning-from-brains / functions

Functions222 in github.com/athms/learning-from-brains

↓ 14 callersFunctionrun_train_process
( config, use_deepspeed=DEEPSPEED_MODE )
tests/__init__.py:137
↓ 9 callersMethod_pad_seq_right_to_n
( seq: np.ndarray, n: int, pad_value: float = 0 )
src/batcher/base.py:158
↓ 7 callersMethodget_subject_deriv_files
( self, subject, filters, )
src/preprocessor.py:201
↓ 7 callersFunctionrun_tests
()
tests/__init__.py:161
↓ 5 callersMethod_pad_tensor_left_by_n
( tensor, n, pad_value )
src/embedder/base.py:128
↓ 5 callersMethoddataset
Create Pytorch dataset that can be used for training. Args: ----- tarfiles: list List of paths to data fi
src/batcher/bert.py:292
↓ 5 callersFunctionget_all_architectures_with_all_train_styles
()
tests/__init__.py:79
↓ 5 callersMethodget_subject_source_files
( self, subject, filters )
src/preprocessor.py:212
↓ 4 callersMethod_init_embeds
(self)
src/embedder/csm.py:36
↓ 4 callersMethod_move_batch_to_device
( self, batch )
src/trainer/base.py:71
↓ 4 callersMethod_pad_seqs_right_to_n
( self, seqs, n: int=None )
src/batcher/bert.py:230
↓ 4 callersMethodfrom_pretrained
Load pretrained model from pretrained_path. Needs to point to pytorch_model.bin file.
src/model.py:49
↓ 4 callersMethodmake_key
(self, bold_path)
src/preprocessor.py:369
↓ 4 callersMethodpreprocess_bold
( self, bold_path: str=None, t_r: float=None)
src/preprocessor.py:477
↓ 3 callersMethod_combine_seqs_as_is_next
( sample_a: Dict[str,np.ndarray], sample_b: Dict[str,np.ndarray], key: str )
src/batcher/bert.py:155
↓ 3 callersMethod_combine_seqs_as_not_next
( sample_a: Dict[str, np.ndarray], sample_b: Dict[str, np.ndarray], key: str )
src/batcher/bert.py:181
↓ 3 callersMethod_order_seqs_by_is_next
( seqs_next: np.ndarray, seqs_not_next: np.ndarray, is_next: np.ndarray, batch
src/batcher/bert.py:207
↓ 3 callersMethodadd_cls_embed
( self, batch: Dict[str, torch.tensor] )
src/embedder/csm.py:143
↓ 3 callersMethodadd_pooler_layer
(self)
src/decoder/gpt.py:66
↓ 3 callersMethoddecode
( self, outputs: torch.tensor, attention_mask: torch.tensor, )
src/decoder/gpt.py:104
↓ 3 callersMethodforward
Forward pass of model. Args ---- batch: Dict[str, torch.tensor] Input batch (as generated by src
src/model.py:157
↓ 3 callersFunctionget_architectures_with_pretrain_styles
()
tests/__init__.py:41
↓ 3 callersMethodget_bold_tr
(bold_path)
src/preprocessor.py:465
↓ 3 callersFunctionmake_batcher
Make a batcher object. The batcher is used to generate batches of input data for training and evaluation. Args: -----
src/batcher/make.py:6
↓ 3 callersMethodmask_inputs
( self, batch: Dict[str, torch.tensor], )
src/embedder/csm.py:62
↓ 3 callersMethodmasking_loss
( self, masked_inputs, outputs, modelling_mask )
src/embedder/csm.py:214
↓ 3 callersMethodprep_batch
Prepare input batch for forward pass. Calls src.embedder.prep_batch. Args ---- batch: Dict[str, torch.tensor]
src/model.py:143
↓ 3 callersMethodwrite_bold_to_tar
( bold=None, path=None, key=None, sink=None, sample_dict=None,
src/preprocessor.py:386
↓ 2 callersMethod__init__
( self, num_hidden_layers: int = 4, embed_dim: int = 768, dropout: float = 0.2
src/decoder/autoencoder.py:10
↓ 2 callersMethod_get_subject_files
( self, subject, filters, basedir )
src/preprocessor.py:223
↓ 2 callersMethod_identify_bold_markers
( filepath: str=None )
src/preprocessor.py:69
↓ 2 callersMethod_make_bold_filters
( self, filepath: str )
src/preprocessor.py:78
↓ 2 callersMethod_make_dataloader
( self, files, repeat: bool = True, n_shuffle_shards: int = 1000, n_sh
src/batcher/bert.py:264
↓ 2 callersFunction_pad_seq_right_to_n
( seq: np.ndarray, n: int, pad_value: float = 0. )
src/batcher/base.py:10
↓ 2 callersMethod_sample_seq_on_and_len
( self, bold_len: int )
src/batcher/base.py:169
↓ 2 callersMethodadd_decoding_head
( self, num_decoding_classes: int )
src/decoder/linear_baseline.py:42
↓ 2 callersFunctionam_first_deepspeed_child
()
tests/__init__.py:102
↓ 2 callersFunctionclear_matplotlib_fig_cache
()
src/tools/brainmap.py:15
↓ 2 callersFunctionevs_for_task
( task: str )
scripts/dataprep/downstream/hcp_to_bids.py:329
↓ 2 callersFunctionfig_downstream_performance
Script's main function; creates Figure 5 of the manuscript.
scripts/analyses/fig5_downstream_performance.py:20
↓ 2 callersMethodforward_step
( self, inputs: torch.tensor = None, hidden: torch.tensor = None, cell_state:
src/decoder/autoencoder.py:167
↓ 2 callersFunctionget_BERT_with_pretrain_styles
()
tests/__init__.py:22
↓ 2 callersFunctionget_GPT_with_pretrain_styles
()
tests/__init__.py:16
↓ 2 callersFunctionget_NetBERT_with_pretrain_styles
()
tests/__init__.py:29
↓ 2 callersFunctionget_args
Get command line arguments
scripts/train.py:464
↓ 2 callersFunctionget_autoencoder_with_pretrain_styles
()
tests/__init__.py:35
↓ 2 callersFunctionget_config
Make config from command line arguments (as created by get_args()). Performs additional formating of args required for calling train().
scripts/train.py:394
↓ 2 callersMethodget_subjects
( self, derivatives: str=None )
src/preprocessor.py:52
↓ 2 callersMethodmake_bold_dummy
( self, bold_shape: Tuple[int, int], t_r: float, # in seconds f_s: Tuple[float
src/batcher/base.py:207
↓ 2 callersFunctionmake_model
Make model from model_config (as generated by get_config()).
scripts/train.py:314
↓ 2 callersMethodreconstruction_loss
( self, input, target, **kwargs )
src/embedder/base.py:212
↓ 2 callersFunctionsfig_downstream_learning_curves
( config: Dict=None, datasets: Tuple[str, ...]=('HCP', 'ds002105'), base_figname: str='sfig_downst
scripts/analyses/sfig4_5_downstream_learning_curves.py:23
↓ 2 callersFunctiontrain
Model training according to config. -> see get_args() below for all command line arguments.
scripts/train.py:61
↓ 1 callersMethod__init__
(self, in_dim: int = 1024, embed_dim: int = 768, num_hidden_layers: int = 1, d
src/embedder/base.py:83
↓ 1 callersMethod__init__
( self, **kwargs )
src/decoder/bert.py:10
↓ 1 callersMethod__init__
( self, num_hidden_layers: int = 6, num_attention_heads: int = 12, embed_dim:
src/decoder/gpt.py:10
↓ 1 callersMethod__init__
( self, dataloader_a, dataloader_b, length, seq_max, sample_ke
src/batcher/bert.py:11
↓ 1 callersMethod_check_derivatives_path
identify derivatives directory
src/preprocessor.py:118
↓ 1 callersMethod_clear_masker_cache
(self)
src/preprocessor.py:328
↓ 1 callersMethod_collect_preproc_bold_files
(self)
src/preprocessor.py:157
↓ 1 callersMethod_collect_source_bold_files
(self)
src/preprocessor.py:170
↓ 1 callersMethod_combine_to_sample
( self, sample_a: Dict[str, np.ndarray], sample_b: Dict[str, np.ndarray] )
src/batcher/bert.py:45
↓ 1 callersMethod_get_filepaths
( self, path, filters )
src/preprocessor.py:247
↓ 1 callersMethod_identify_func_subdirs
( dir: str=None )
src/preprocessor.py:96
↓ 1 callersMethod_make_dataloader
( self, files, repeat: bool = True, n_shuffle_shards: int = 1000, n_sh
src/batcher/base.py:86
↓ 1 callersMethod_root_loss
( self, inputs, outputs, attention_mask, **kwargs )
src/embedder/base.py:251
↓ 1 callersMethod_root_loss
( self, inputs, outputs, attention_mask, **kwargs )
src/embedder/dummy.py:87
↓ 1 callersMethod_round_to_precision
( x: torch.tensor, precision: float, )
src/embedder/base.py:151
↓ 1 callersFunction_save_colorbar_to_workdir
( workdir, axsize=(7,5), cmap='inferno', vmax=None, vmin=None, dpi=300, )
src/tools/brainmap.py:149
↓ 1 callersFunction_save_surfaces_to_workdir
( img, workdir, mask_img=None, axsize=(7,5), dpi=300, cmap='inferno', vmax=None,
src/tools/brainmap.py:23
↓ 1 callersMethod_stack_inputs
( self, tensor )
src/embedder/base.py:47
↓ 1 callersMethod_unstack_inputs
( self, tensor, b )
src/embedder/base.py:57
↓ 1 callersMethodadd_decoding_head
( self, num_decoding_classes: int )
src/decoder/autoencoder.py:304
↓ 1 callersMethodadd_decoding_head
( self, num_decoding_classes: int )
src/decoder/gpt.py:80
↓ 1 callersMethodadd_sep_embeds
add sep token embed at the end of each of two sequences contained in inputs
src/embedder/bert.py:47
↓ 1 callersMethodadd_sep_embeds
add sep token embed at the end of each of two sequences contained in inputs
src/embedder/netbert.py:47
↓ 1 callersMethodcompute_loss
( self, model, batch, return_outputs=False, **kwargs )
src/trainer/base.py:40
↓ 1 callersMethodconvert_t_rs_to_position_ids
( self, t_rs: torch.tensor )
src/embedder/base.py:157
↓ 1 callersMethodcount_preproc_bold
(self)
src/preprocessor.py:181
↓ 1 callersFunctiondataprep
Script's main function; additional preprocessing of fmriprep derivatives with Preprocessor from src/
scripts/dataprep/upstream/dataprep.py:13
↓ 1 callersMethoddecode
( self, outputs: torch.tensor )
src/decoder/bert.py:47
↓ 1 callersMethoddecode
( self, pooler_outputs: torch.tensor = None, **kwargs )
src/decoder/autoencoder.py:323
↓ 1 callersMethoddecoding_loss
( self, decoding_logits, labels, **kwargs )
src/embedder/base.py:198
↓ 1 callersMethoddecoding_loss
( self, decoding_logits, labels, **kwargs )
src/embedder/dummy.py:34
↓ 1 callersFunctionderiv_bold_iterator
iterate BOLD derivatives that are to be preprocessed.
scripts/dataprep/upstream/dataprep.py:64
↓ 1 callersFunctiondownstream_chance_accuracies
Script's main function; computes downstream chance decoding accuracy for HCP and MDTB downstream datasets.
scripts/analyses/downstream_chance_accuracies.py:16
↓ 1 callersMethodembed_inputs
( self, inputs: torch.tensor )
src/embedder/base.py:174
↓ 1 callersMethodembed_t_rs
( self, t_rs: torch.tensor )
src/embedder/base.py:180
↓ 1 callersFunctioneval_error_brain_maps
Script's main function; computes brain map for reconstruction error of given upstream model in upstream validation data
scripts/analyses/sfig2_eval_error_brain_maps.py:24
↓ 1 callersFunctionfig_hyperopt
Script's main function; creates Figure 3 of the manuscript.
scripts/analyses/fig3_hyperopt.py:20
↓ 1 callersFunctionfig_upstream_data_overview
Script's main function; creates Figure 2 of the manuscript.
scripts/analyses/fig2_upstream_data_overview.py:19
↓ 1 callersFunctionfig_upstream_performance
Script's main function; creates Figure 4 of the manuscript.
scripts/analyses/fig4_upstream_performance.py:19
↓ 1 callersFunctionget_all_architectures_with_decoding
()
tests/__init__.py:85
↓ 1 callersFunctionget_architectures_with_all_train_styles
()
tests/__init__.py:50
↓ 1 callersFunctionget_argparse
()
scripts/analyses/sfig4_5_downstream_learning_curves.py:200
↓ 1 callersFunctionget_args
()
scripts/analyses/fig5_downstream_performance.py:124
↓ 1 callersFunctionget_args
()
scripts/analyses/sfig3_upstream_performance_pretrained_lms.py:107
↓ 1 callersFunctionget_args
()
scripts/analyses/downstream_chance_accuracies.py:69
↓ 1 callersFunctionget_args
()
scripts/analyses/fig4_upstream_performance.py:108
↓ 1 callersFunctionget_args
()
scripts/analyses/sfig1_training_curve_largest_sequence_BERT.py:72
next →1–100 of 222, ranked by callers