Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/facebookresearch/emg2qwerty
/ functions
Functions
177 in github.com/facebookresearch/emg2qwerty
⨍
Functions
177
◇
Types & classes
26
↳
Endpoints
7
↓ 21 callers
Function
charset
Lazily load and return a global instance of ``CharacterSet``.
emg2qwerty/charset.py:24
↓ 7 callers
Method
child
(self, value: Any)
emg2qwerty/decoder.py:190
↓ 7 callers
Method
from_labels
Create a new instance of ``LabelData`` from integer labels and optionally together with its corresponding timestamps. Args:
emg2qwerty/data.py:377
↓ 7 callers
Method
hash
`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 callers
Method
str_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 callers
Function
logsumexp
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 callers
Method
__init__
(self, channels: int, width: int, kernel_width: int)
emg2qwerty/modules.py:186
↓ 5 callers
Method
_normalize_str
Return a normalized string by substituting unsupported characters with supported ones while leaving unicode characters corresponding t
emg2qwerty/charset.py:267
↓ 5 callers
Method
init
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 callers
Method
key_to_label
Fetch the categorical label corresponding to the given key.
emg2qwerty/charset.py:160
↓ 5 callers
Method
keys_to_str
Convert a sequence of keys to its corresponding textual representation after standardizing.
emg2qwerty/charset.py:190
↓ 4 callers
Method
clean_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 callers
Method
next_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 callers
Method
str_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 callers
Function
_build_transform
(configs: Sequence[DictConfig])
emg2qwerty/train.py:53
↓ 3 callers
Method
_epoch_end
(self, phase: str)
emg2qwerty/lightning.py:243
↓ 3 callers
Function
_full_session_paths
(dataset: ListConfig)
emg2qwerty/train.py:45
↓ 3 callers
Method
_step
( self, phase: str, batch: dict[str, torch.Tensor], *args, **kwargs )
emg2qwerty/lightning.py:200
↓ 3 callers
Method
decode_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 callers
Method
is_delete_label
(self, label: int)
emg2qwerty/decoder.py:452
↓ 3 callers
Method
label_to_key
Fetch the key corresponding to the given categorical label.
emg2qwerty/charset.py:164
↓ 3 callers
Method
reset
Reset decoder state.
emg2qwerty/decoder.py:44
↓ 3 callers
Method
update
(self, prediction: LabelData, target: LabelData)
emg2qwerty/metrics.py:39
↓ 2 callers
Function
_decode
(paths: list[str], beam_size: int)
emg2qwerty/tests/decoder_test.py:280
↓ 2 callers
Function
_get_final_beam_state
(path: str)
emg2qwerty/tests/decoder_test.py:219
↓ 2 callers
Method
_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 callers
Method
clean_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 callers
Method
decode
Online decoding API that updates decoder state and returns the decoded sequence thus far. Args: emissions (`np.ndarray`):
emg2qwerty/decoder.py:49
↓ 2 callers
Function
dump_split
( user: str, train: pd.DataFrame, val: pd.DataFrame, test: pd.DataFrame )
scripts/generate_splits.py:122
↓ 2 callers
Function
filter_users
Return a `pd.Series` consisting of users who have at least `min_sessions` sessions.
scripts/generate_splits.py:38
↓ 2 callers
Method
from_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 callers
Function
generate_split
Split `df` into train, val and test partitions satisfying the provided per-user constraints.
scripts/generate_splits.py:93
↓ 2 callers
Method
ground_truth
( self, start_t: float = -np.inf, end_t: float = np.inf )
emg2qwerty/data.py:122
↓ 2 callers
Method
key_to_unicode
Fetch the unicode value corresponding to the given key.
emg2qwerty/charset.py:152
↓ 2 callers
Method
labels_to_str
Convert a sequence of labels to its corresponding textual representation.
emg2qwerty/charset.py:202
↓ 2 callers
Method
lm_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 callers
Function
stratified_sample
Sample `n` rows per user from `df`.
scripts/generate_splits.py:83
↓ 2 callers
Method
unicode_to_char
Convert a unicode value to its corresponding textual representation after standardizing.
emg2qwerty/charset.py:213
↓ 2 callers
Method
values
Sequence of values on the path from root to this node.
emg2qwerty/decoder.py:194
↓ 1 callers
Method
__init__
( self, in_features: int, mlp_features: Sequence[int], block_channels: Sequenc
emg2qwerty/lightning.py:144
↓ 1 callers
Function
_format_split
(split: dict[str, pd.DataFrame])
scripts/generate_splits.py:128
↓ 1 callers
Method
apply_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 callers
Method
compute
(self)
emg2qwerty/metrics.py:51
↓ 1 callers
Function
convert_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 callers
Method
decode
( self, emissions: np.ndarray, timestamps: np.ndarray, finish: bool = False,
emg2qwerty/decoder.py:116
↓ 1 callers
Method
finish
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 callers
Method
forward
(self, inputs: torch.Tensor)
emg2qwerty/lightning.py:197
↓ 1 callers
Method
from_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 callers
Method
from_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 callers
Method
from_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 callers
Method
from_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 callers
Function
get_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 callers
Method
key_to_char
Convert a single key to its corresponding textual representation after standardizing.
emg2qwerty/charset.py:208
↓ 1 callers
Function
main
()
scripts/experimental_results.py:90
↓ 1 callers
Function
main
( dataset_root: str, n_test_users: int, min_train_sessions_per_user: int, n_val_sessions_per_u
scripts/generate_splits.py:192
↓ 1 callers
Function
main
(dataset_root: str)
scripts/print_dataset_stats.py:53
↓ 1 callers
Function
main
(dataset_root: str, bids_root: str)
scripts/convert_to_bids.py:119
↓ 1 callers
Function
main
()
scripts/lm/preprocess_char_lm.py:42
↓ 1 callers
Function
main
(config: DictConfig)
emg2qwerty/train.py:27
↓ 1 callers
Function
print_dataset_stats
(metadata_df: pd.DataFrame)
scripts/print_dataset_stats.py:18
↓ 1 callers
Function
process_line
(line: str)
scripts/lm/preprocess_char_lm.py:36
↓ 1 callers
Function
process_word
(word: str)
scripts/lm/preprocess_char_lm.py:30
↓ 1 callers
Method
reset
(self)
emg2qwerty/decoder.py:111
↓ 1 callers
Method
reset
(self)
emg2qwerty/decoder.py:448
↓ 1 callers
Function
sample_test_users
Sample `n` users for personalization by giving precedence to those with the most number of sessions.
scripts/generate_splits.py:56
↓ 1 callers
Function
word_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