yurakuratov commited on
Commit
afa2769
1 Parent(s): ea52cf2

update readme

Browse files
Files changed (1) hide show
  1. README.md +40 -27
README.md CHANGED
@@ -4,52 +4,65 @@ tags:
4
  - human_genome
5
  ---
6
 
7
- # WARNING
8
 
9
- This readme should be changed according to current model. Num steps: 1925000
10
 
11
- # GENA-LM
12
 
13
- GENA-LM is a transformer masked language model trained on human DNA sequence.
14
-
15
- Differences between GENA-LM and DNABERT:
16
  - BPE tokenization instead of k-mers;
17
- - input sequence size is about 3000 nucleotides (512 BPE tokens) compared to 510 nucleotides of DNABERT
18
- - pre-training on T2T vs. GRCh38.p13 human genome assembly.
19
 
20
  Source code and data: https://github.com/AIRI-Institute/GENA_LM
21
 
 
 
22
  ## Examples
 
 
 
 
 
 
 
 
 
23
  ### How to load the model to fine-tune it on classification task
24
  ```python
25
  from src.gena_lm.modeling_bert import BertForSequenceClassification
26
  from transformers import AutoTokenizer
27
 
28
- tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bert-base')
29
- model = BertForSequenceClassification.from_pretrained('AIRI-Institute/gena-lm-bert-base')
30
  ```
31
 
32
  ## Model description
33
- 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:
34
 
35
  - 512 Maximum sequence length
36
  - 12 Layers, 12 Attention heads
37
  - 768 Hidden size
38
  - 32k Vocabulary size
39
 
40
- 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.
41
-
42
- ## Downstream tasks
43
- 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.
44
-
45
- ### Fine-tuning GENA-LM on our data and scoring
46
- After fine-tuning gena-lm-bert-base on promoter prediction dataset, following results were achieved:
47
-
48
- | model | seq_len (bp) | F1 |
49
- |--------------------------|--------------|-------|
50
- | DeePromoter | 300 | 95.60 |
51
- | GENA-LM bert-base (ours) | 2000 | 95.72 |
52
- | BigBird | 16000 | 99.90 |
53
-
54
- We can conclude that our model achieves comparable performance to the previously published results for promoter prediction task.
55
-
 
 
 
 
 
4
  - human_genome
5
  ---
6
 
7
+ # GENA-LM (gena-lm-bert-base-t2t-multi)
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-t2t-multi`) 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 + Multispecies 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-t2t-multi')
29
+ model = AutoModel.from_pretrained('AIRI-Institute/gena-lm-bert-base-t2t-multi')
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-t2t-multi')
38
+ model = BertForSequenceClassification.from_pretrained('AIRI-Institute/gena-lm-bert-base-t2t-multi')
39
  ```
40
 
41
  ## Model description
42
+ GENA-LM (`gena-lm-bert-base-t2t-multi`) 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-t2t-multi` 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-t2t-multi` 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). We also add multispecies genomes from ENSEMBL release 108. The list of used species is [here](https://github.com/AIRI-Institute/GENA_LM/blob/main/manuscript_data/Suplementary_Table_1.csv). Pre-training was performed for 1,925,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), but without the final layer LayerNorm.
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
+ ```