MCPcopy Index your code

hub / github.com/facebookresearch/emg2qwerty / functions

Functions177 in github.com/facebookresearch/emg2qwerty

↓ 21 callersFunctioncharset
Lazily load and return a global instance of ``CharacterSet``.
emg2qwerty/charset.py:24
↓ 7 callersMethodchild
(self, value: Any)
emg2qwerty/decoder.py:190
↓ 7 callersMethodfrom_labels
Create a new instance of ``LabelData`` from integer labels and optionally together with its corresponding timestamps. Args:
emg2qwerty/data.py:377
↓ 7 callersMethodhash
`hashlib._Hash` object of the sequence of decoded labels in the path leading to this beam state for efficiently keying into a dict. I
emg2qwerty/decoder.py:341
↓ 7 callersMethodstr_to_labels
Convert a string to the corresponding sequence of labels after cleaning up and stardardizing. Also see ``str_to_keys()``.
emg2qwerty/charset.py:196
↓ 6 callersFunctionlogsumexp
Stable log-sum-exp to sum probabilities in log-space. Ref for example http://gregorygundersen.com/blog/2020/02/09/log-sum-exp/. We could use
emg2qwerty/decoder.py:24
↓ 5 callersMethod__init__
(self, channels: int, width: int, kernel_width: int)
emg2qwerty/modules.py:186
↓ 5 callersMethod_normalize_str
Return a normalized string by substituting unsupported characters with supported ones while leaving unicode characters corresponding t
emg2qwerty/charset.py:267
↓ 5 callersMethodinit
Initialize a new BeamState with empty sequence (CTC blank label), probability of 1 for ending in blank and 0 for non-blank. The label
emg2qwerty/decoder.py:261
↓ 5 callersMethodkey_to_label
Fetch the categorical label corresponding to the given key.
emg2qwerty/charset.py:160
↓ 5 callersMethodkeys_to_str
Convert a sequence of keys to its corresponding textual representation after standardizing.
emg2qwerty/charset.py:190
↓ 4 callersMethodclean_str
Return a normalized AND filtered canonical string corresponding to the ``unicode_str`` such that the characters of the returned string
emg2qwerty/charset.py:231
↓ 4 callersMethodnext_state
Returns the next BeamState by extending `prev_state` with `label` and applying LM as appropriate. If `label` is None, we treat that a
emg2qwerty/decoder.py:552
↓ 4 callersMethodstr_to_keys
r"""Convert a string to the corresponding sequence of supported keys after cleaning up and standardizing. Supports conversion from bo
emg2qwerty/charset.py:176
↓ 3 callersFunction_build_transform
(configs: Sequence[DictConfig])
emg2qwerty/train.py:53
↓ 3 callersMethod_epoch_end
(self, phase: str)
emg2qwerty/lightning.py:243
↓ 3 callersFunction_full_session_paths
(dataset: ListConfig)
emg2qwerty/train.py:45
↓ 3 callersMethod_step
( self, phase: str, batch: dict[str, torch.Tensor], *args, **kwargs )
emg2qwerty/lightning.py:200
↓ 3 callersMethoddecode_batch
Offline decoding API that operates over a batch of emission logits. This simply loops over each batch element and calls `decode` in sequence.
emg2qwerty/decoder.py:69
↓ 3 callersMethodis_delete_label
(self, label: int)
emg2qwerty/decoder.py:452
↓ 3 callersMethodlabel_to_key
Fetch the key corresponding to the given categorical label.
emg2qwerty/charset.py:164
↓ 3 callersMethodreset
Reset decoder state.
emg2qwerty/decoder.py:44
↓ 3 callersMethodupdate
(self, prediction: LabelData, target: LabelData)
emg2qwerty/metrics.py:39
↓ 2 callersFunction_decode
(paths: list[str], beam_size: int)
emg2qwerty/tests/decoder_test.py:280
↓ 2 callersFunction_get_final_beam_state
(path: str)
emg2qwerty/tests/decoder_test.py:219
↓ 2 callersMethod_normalize_keys
Normalize the given sequence of keys in any representation. NOTE: This doesn NOT filter out out-of-vocabulary keys, directly call `cl
emg2qwerty/charset.py:246
↓ 2 callersMethodclean_keys
Normalize and filter the given sequence of keys in any representation. Every single key returned is guaranteed to be a member of ``all
emg2qwerty/charset.py:223
↓ 2 callersMethoddecode
Online decoding API that updates decoder state and returns the decoded sequence thus far. Args: emissions (`np.ndarray`):
emg2qwerty/decoder.py:49
↓ 2 callersFunctiondump_split
( user: str, train: pd.DataFrame, val: pd.DataFrame, test: pd.DataFrame )
scripts/generate_splits.py:122
↓ 2 callersFunctionfilter_users
Return a `pd.Series` consisting of users who have at least `min_sessions` sessions.
scripts/generate_splits.py:38
↓ 2 callersMethodfrom_str
Create a new instance of ``LabelData`` from a raw string, after normalizing and cleaning up as per ``CharacterSet``. Args:
emg2qwerty/data.py:356
↓ 2 callersFunctiongenerate_split
Split `df` into train, val and test partitions satisfying the provided per-user constraints.
scripts/generate_splits.py:93
↓ 2 callersMethodground_truth
( self, start_t: float = -np.inf, end_t: float = np.inf )
emg2qwerty/data.py:122
↓ 2 callersMethodkey_to_unicode
Fetch the unicode value corresponding to the given key.
emg2qwerty/charset.py:152
↓ 2 callersMethodlabels_to_str
Convert a sequence of labels to its corresponding textual representation.
emg2qwerty/charset.py:202
↓ 2 callersMethodlm_score
Helper to safely compute the weighted LM score to be added. Handles deletion scenario by undoing the LM score corresponding to the pr
emg2qwerty/decoder.py:643
↓ 2 callersFunctionstratified_sample
Sample `n` rows per user from `df`.
scripts/generate_splits.py:83
↓ 2 callersMethodunicode_to_char
Convert a unicode value to its corresponding textual representation after standardizing.
emg2qwerty/charset.py:213
↓ 2 callersMethodvalues
Sequence of values on the path from root to this node.
emg2qwerty/decoder.py:194
↓ 1 callersMethod__init__
( self, in_features: int, mlp_features: Sequence[int], block_channels: Sequenc
emg2qwerty/lightning.py:144
↓ 1 callersFunction_format_split
(split: dict[str, pd.DataFrame])
scripts/generate_splits.py:128
↓ 1 callersMethodapply_lm
Takes in KenLM state and a token label, and returns a tuple of the next KenLM state on applying the token as well as the LM score. Fo
emg2qwerty/decoder.py:607
↓ 1 callersMethodcompute
(self)
emg2qwerty/metrics.py:51
↓ 1 callersFunctionconvert_to_bids
Convert the HDF5 emg2qwerty session file located at `session_path` to BIDS format and output to `bids_root` directory.
scripts/convert_to_bids.py:81
↓ 1 callersMethoddecode
( self, emissions: np.ndarray, timestamps: np.ndarray, finish: bool = False,
emg2qwerty/decoder.py:116
↓ 1 callersMethodfinish
To be called at the end of the sequence to finish any pending LM states by adding end-of-word </s> tokens.
emg2qwerty/decoder.py:523
↓ 1 callersMethodforward
(self, inputs: torch.Tensor)
emg2qwerty/lightning.py:197
↓ 1 callersMethodfrom_key
Create a new instance of ``LabelData`` from a single keystroke, after normalizing and cleaning up as per ``CharacterSet``. Args:
emg2qwerty/data.py:246
↓ 1 callersMethodfrom_keystrokes
Create a new instance of ``LabelData`` from a sequence of keystrokes between the provided start and end timestamps, after normalizing
emg2qwerty/data.py:213
↓ 1 callersMethodfrom_prompt
Create a new instance of ``LabelData`` from a single prompt, after normalizing and cleaning up as per ``CharacterSet``. The returned o
emg2qwerty/data.py:321
↓ 1 callersMethodfrom_prompts
Create a new instance of ``LabelData`` from a sequence of prompts between the provided start and end timestamps, after normalizing and
emg2qwerty/data.py:280
↓ 1 callersFunctionget_mne_raw
Read data in HDF5 and get an MNE Raw object with keystrokes and prompts saved as mne.Annotations.
scripts/convert_to_bids.py:27
↓ 1 callersMethodkey_to_char
Convert a single key to its corresponding textual representation after standardizing.
emg2qwerty/charset.py:208
↓ 1 callersFunctionmain
()
scripts/experimental_results.py:90
↓ 1 callersFunctionmain
( dataset_root: str, n_test_users: int, min_train_sessions_per_user: int, n_val_sessions_per_u
scripts/generate_splits.py:192
↓ 1 callersFunctionmain
(dataset_root: str)
scripts/print_dataset_stats.py:53
↓ 1 callersFunctionmain
(dataset_root: str, bids_root: str)
scripts/convert_to_bids.py:119
↓ 1 callersFunctionmain
()
scripts/lm/preprocess_char_lm.py:42
↓ 1 callersFunctionmain
(config: DictConfig)
emg2qwerty/train.py:27
↓ 1 callersFunctionprint_dataset_stats
(metadata_df: pd.DataFrame)
scripts/print_dataset_stats.py:18
↓ 1 callersFunctionprocess_line
(line: str)
scripts/lm/preprocess_char_lm.py:36
↓ 1 callersFunctionprocess_word
(word: str)
scripts/lm/preprocess_char_lm.py:30
↓ 1 callersMethodreset
(self)
emg2qwerty/decoder.py:111
↓ 1 callersMethodreset
(self)
emg2qwerty/decoder.py:448
↓ 1 callersFunctionsample_test_users
Sample `n` users for personalization by giving precedence to those with the most number of sessions.
scripts/generate_splits.py:56
↓ 1 callersFunctionword_in_vocabulary
(word: str)
scripts/lm/preprocess_char_lm.py:26
Method__add__
(self, other: LabelData)
emg2qwerty/data.py:411
Method__call__
(self, data: np.ndarray)
emg2qwerty/transforms.py:39
Method__call__
(self, data: Any)
emg2qwerty/transforms.py:55
Method__call__
(self, tensor: torch.Tensor)
emg2qwerty/transforms.py:75
Method__call__
(self, data: Any)
emg2qwerty/transforms.py:92
Method__call__
(self, tensor: torch.Tensor)
emg2qwerty/transforms.py:118
Method__call__
(self, tensor: torch.Tensor)
emg2qwerty/transforms.py:142
Method__call__
(self, tensor: torch.Tensor)
emg2qwerty/transforms.py:185
Method__call__
(self, specgram: torch.Tensor)
emg2qwerty/transforms.py:230
Method__contains__
(self, item: KeyChar | int)
emg2qwerty/charset.py:120
Method__enter__
(self)
emg2qwerty/data.py:95
Method__eq__
(self, other: object)
emg2qwerty/data.py:406
Method__exit__
(self, exc_type, exc_value, traceback)
emg2qwerty/data.py:98
Method__getitem__
(self, key: slice | str)
emg2qwerty/data.py:104
Method__getitem__
(self, idx: int)
emg2qwerty/data.py:479
Method__init__
( self, window_length: int, padding: tuple[int, int], batch_size: int,
emg2qwerty/lightning.py:33
Method__init__
(self, **kwargs: dict[str, Any])
emg2qwerty/metrics.py:31
Method__init__
(self, channels: int)
emg2qwerty/modules.py:29
Method__init__
( self, in_features: int, mlp_features: Sequence[int], pooling: str = "mean",
emg2qwerty/modules.py:66
Method__init__
( self, in_features: int, mlp_features: Sequence[int], pooling: str = "mean",
emg2qwerty/modules.py:136
Method__init__
(self, num_features: int)
emg2qwerty/modules.py:226
Method__init__
( self, num_features: int, block_channels: Sequence[int] = (24, 24, 24, 24), k
emg2qwerty/modules.py:257
Method__len__
(self)
emg2qwerty/charset.py:117
Method__len__
(self)
emg2qwerty/data.py:101
Method__len__
(self)
emg2qwerty/data.py:403
Method__len__
(self)
emg2qwerty/data.py:476
Method__post_init__
(self)
emg2qwerty/decoder.py:108
Method__post_init__
(self, _hash: hashlib._Hash | None)
emg2qwerty/decoder.py:251
Method__post_init__
(self)
emg2qwerty/decoder.py:421
Method__post_init__
(self)
emg2qwerty/transforms.py:139
Method__post_init__
(self)
emg2qwerty/transforms.py:174
Method__post_init__
(self)
emg2qwerty/transforms.py:222
Method__post_init__
(self)
emg2qwerty/charset.py:114
Method__post_init__
(self)
emg2qwerty/data.py:73
next →1–100 of 177, ranked by callers