-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2ee29f
commit d815089
Showing
58 changed files
with
780 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,3 +43,4 @@ repos: | |
hooks: | ||
- id: ruff | ||
name: ruff | ||
args: [--config=pyproject.toml] |
Empty file.
7 changes: 7 additions & 0 deletions
7
cortex/assets/protein_seq_tokenizer_32/special_tokens_map.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"cls_token": "<cls>", | ||
"eos_token": "<eos>", | ||
"mask_token": "<mask>", | ||
"pad_token": "<pad>", | ||
"unk_token": "<unk>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"clean_up_tokenization_spaces": true, | ||
"do_lower_case": false, | ||
"model_max_length": 1024, | ||
"tokenizer_class": "PmlmTokenizer" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<cls> | ||
<pad> | ||
<eos> | ||
<unk> | ||
L | ||
A | ||
G | ||
V | ||
S | ||
E | ||
R | ||
T | ||
I | ||
D | ||
P | ||
K | ||
Q | ||
N | ||
F | ||
Y | ||
M | ||
H | ||
W | ||
C | ||
B | ||
U | ||
Z | ||
O | ||
. | ||
- | ||
<null_1> | ||
<mask> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
ALIGNMENT_GAP_TOKEN = "-" | ||
CANON_AMINO_ACIDS = [ | ||
"A", | ||
"R", | ||
"N", | ||
"D", | ||
"C", | ||
"E", | ||
"Q", | ||
"G", | ||
"H", | ||
"I", | ||
"L", | ||
"K", | ||
"M", | ||
"F", | ||
"P", | ||
"S", | ||
"T", | ||
"W", | ||
"Y", | ||
"V", | ||
] | ||
COMPLEX_SEP_TOKEN = "." | ||
NULL_TOKENS = ["<null_1>"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from ._task_data_module import TaskDataModule | ||
from ._task_data_module import TaskDataModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from ._wandb_setup import wandb_setup | ||
from ._wandb_setup import wandb_setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from ._weight_averaging import online_weight_update_ | ||
|
||
__all__ = [ | ||
"online_weight_update_", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import Iterable, Optional | ||
|
||
import torch | ||
|
||
|
||
def online_weight_update_( | ||
src_state_dict: dict[str, torch.Tensor], | ||
tgt_state_dict: dict[str, torch.Tensor], | ||
decay_rate: float, | ||
param_prefixes: Optional[Iterable[str]] = None, | ||
): | ||
if param_prefixes is None: | ||
param_keys = src_state_dict.keys() | ||
else: | ||
param_keys = [k for k in src_state_dict.keys() if any(k.startswith(prefix) for prefix in param_prefixes)] | ||
|
||
for param_key in param_keys: | ||
param_src = src_state_dict[param_key] | ||
param_tgt = tgt_state_dict[param_key] | ||
if torch.is_tensor(param_tgt) and param_tgt.dtype is not torch.bool and param_tgt.dtype is not torch.long: | ||
param_tgt.mul_(decay_rate) | ||
param_tgt.data.add_(param_src.data * (1.0 - decay_rate)) | ||
elif torch.is_tensor(param_tgt): | ||
param_tgt.copy_(param_src) | ||
else: | ||
raise RuntimeError("Parameter {} is not a tensor.".format(param_key)) | ||
|
||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
from ._conv1d_resid_block import Conv1dResidBlock | ||
|
||
__all__ = [ | ||
"Conv1dResidBlock", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
from ._abstract_branch import BranchNode, BranchNodeOutput | ||
from ._conv1d_branch import Conv1dBranch | ||
from ._conv1d_branch import Conv1dBranch, Conv1dBranchOutput | ||
|
||
__all__ = [ | ||
"BranchNode", | ||
"BranchNodeOutput", | ||
"Conv1dBranch", | ||
"Conv1dBranchOutput", | ||
] |
Oops, something went wrong.