yurakuratov commited on
Commit
5a56361
1 Parent(s): 5bbf213

update readme

Browse files
Files changed (1) hide show
  1. README.md +36 -22
README.md CHANGED
@@ -4,51 +4,65 @@ tags:
4
  - human_genome
5
  ---
6
 
7
- # WARNING
8
- This readme should be changed according to current model. Num steps: 2100000
9
 
10
- # GENA-LM
11
 
12
- GENA-LM is a transformer masked language model trained on human DNA sequence.
13
 
14
- Differences between GENA-LM and DNABERT:
15
  - BPE tokenization instead of k-mers;
16
- - input sequence size is about 3000 nucleotides (512 BPE tokens) compared to 510 nucleotides of DNABERT
17
  - pre-training on T2T vs. GRCh38.p13 human genome assembly.
18
 
19
  Source code and data: https://github.com/AIRI-Institute/GENA_LM
20
 
 
 
21
  ## Examples
 
 
 
 
 
 
 
 
 
22
  ### How to load the model to fine-tune it on classification task
23
  ```python
24
  from src.gena_lm.modeling_bert import BertForSequenceClassification
25
  from transformers import AutoTokenizer
26
 
27
- tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bert-base')
28
- model = BertForSequenceClassification.from_pretrained('AIRI-Institute/gena-lm-bert-base')
29
  ```
30
 
31
  ## Model description
32
- GENA-LM model is trained in a masked language model (MLM) fashion, following the methods proposed in the BigBird paper by masking 85% of tokens. Model config for `gena-lm-bert-base` is similar to the bert-base:
33
 
34
  - 512 Maximum sequence length
35
  - 12 Layers, 12 Attention heads
36
  - 768 Hidden size
37
  - 32k Vocabulary size
38
 
39
- We pre-trained `gena-lm-bert-base` using the latest T2T human genome assembly (https://www.ncbi.nlm.nih.gov/assembly/GCA_009914755.3/). Pre-training was performed for 500,000 iterations with the same parameters as in BigBird, except sequence length was equal to 512 tokens and we used pre-layer normalization in Transformer.
40
-
41
- ## Downstream tasks
42
- Currently, gena-lm-bert-base model has been finetuned and tested on promoter prediction task. Its' performance is comparable to previous SOTA results. We plan to fine-tune and make available models for other downstream tasks in the near future.
43
-
44
- ### Fine-tuning GENA-LM on our data and scoring
45
- After fine-tuning gena-lm-bert-base on promoter prediction dataset, following results were achieved:
46
 
47
- | model | seq_len (bp) | F1 |
48
- |--------------------------|--------------|-------|
49
- | DeePromoter | 300 | 95.60 |
50
- | GENA-LM bert-base (ours) | 2000 | 95.72 |
51
- | BigBird | 16000 | 99.90 |
52
 
53
- We can conclude that our model achieves comparable performance to the previously published results for promoter prediction task.
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  - human_genome
5
  ---
6
 
7
+ # GENA-LM (gena-lm-bert-base-lastln-t2t)
 
8
 
9
+ GENA-LM is a Family of Open-Source Foundational Models for Long DNA Sequences.
10
 
11
+ GENA-LM models are transformer masked language models trained on human DNA sequence.
12
 
13
+ Differences between GENA-LM (`gena-lm-bert-base-lastln-t2t`) and DNABERT:
14
  - BPE tokenization instead of k-mers;
15
+ - input sequence size is about 4500 nucleotides (512 BPE tokens) compared to 512 nucleotides of DNABERT
16
  - pre-training on T2T vs. GRCh38.p13 human genome assembly.
17
 
18
  Source code and data: https://github.com/AIRI-Institute/GENA_LM
19
 
20
+ Paper: https://www.biorxiv.org/content/10.1101/2023.06.12.544594v1
21
+
22
  ## Examples
23
+
24
+ ### Load pre-trained model
25
+ ```python
26
+ from transformers import AutoTokenizer, AutoModel
27
+
28
+ tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bert-base-lastln-t2t')
29
+ model = AutoModel.from_pretrained('AIRI-Institute/gena-lm-bert-base-lastln-t2t')
30
+ ```
31
+
32
  ### How to load the model to fine-tune it on classification task
33
  ```python
34
  from src.gena_lm.modeling_bert import BertForSequenceClassification
35
  from transformers import AutoTokenizer
36
 
37
+ tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bert-base-lastln-t2t')
38
+ model = BertForSequenceClassification.from_pretrained('AIRI-Institute/gena-lm-bert-base-lastln-t2t')
39
  ```
40
 
41
  ## Model description
42
+ GENA-LM (`gena-lm-bert-base-lastln-t2t`) model is trained in a masked language model (MLM) fashion, following the methods proposed in the BigBird paper by masking 15% of tokens. Model config for `gena-lm-bert-base-lastln-t2t` is similar to the bert-base:
43
 
44
  - 512 Maximum sequence length
45
  - 12 Layers, 12 Attention heads
46
  - 768 Hidden size
47
  - 32k Vocabulary size
48
 
49
+ We pre-trained `gena-lm-bert-base-lastln-t2t` using the latest T2T human genome assembly (https://www.ncbi.nlm.nih.gov/assembly/GCA_009914755.3/). The data was augmented by sampling mutations from 1000-genome SNPs (gnomAD dataset). Pre-training was performed for 2,100,000 iterations with batch size 256 and sequence length was equal to 512 tokens. We modified Transformer with [Pre-Layer normalization](https://arxiv.org/abs/2002.04745).
 
 
 
 
 
 
50
 
51
+ ## Evaluation
52
+ For evaluation results, see our paper: https://www.biorxiv.org/content/10.1101/2023.06.12.544594v1
 
 
 
53
 
 
54
 
55
+ ## Citation
56
+ ```bibtex
57
+ @article{GENA_LM,
58
+ author = {Veniamin Fishman and Yuri Kuratov and Maxim Petrov and Aleksei Shmelev and Denis Shepelin and Nikolay Chekanov and Olga Kardymon and Mikhail Burtsev},
59
+ title = {GENA-LM: A Family of Open-Source Foundational Models for Long DNA Sequences},
60
+ elocation-id = {2023.06.12.544594},
61
+ year = {2023},
62
+ doi = {10.1101/2023.06.12.544594},
63
+ publisher = {Cold Spring Harbor Laboratory},
64
+ URL = {https://www.biorxiv.org/content/early/2023/06/13/2023.06.12.544594},
65
+ eprint = {https://www.biorxiv.org/content/early/2023/06/13/2023.06.12.544594.full.pdf},
66
+ journal = {bioRxiv}
67
+ }
68
+ ```