Adding `safetensors` variant of this model

#1
by SFconvertbot - opened
Files changed (2) hide show
  1. README.md +27 -28
  2. model.safetensors +3 -0
README.md CHANGED
@@ -4,48 +4,47 @@ tags:
4
  - human_genome
5
  ---
6
 
7
- # GENA-LM
8
 
9
- GENA-LM is a transformer masked language model trained on human DNA sequence.
10
 
11
- Differences between GENA-LM and DNABERT:
12
  - BPE tokenization instead of k-mers;
13
- - input sequence size is about 3000 nucleotides (512 BPE tokens) compared to 510 nucleotides of DNABERT
14
  - pre-training on T2T vs. GRCh38.p13 human genome assembly.
15
 
16
  Source code and data: https://github.com/AIRI-Institute/GENA_LM
17
 
18
  ## Examples
 
 
 
 
 
 
 
 
 
 
19
  ### How to load the model to fine-tune it on classification task
20
  ```python
21
- from src.gena_lm.modeling_bert import BertForSequenceClassification
22
- from transformers import AutoTokenizer
23
 
24
- tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bert-base')
25
- model = BertForSequenceClassification.from_pretrained('AIRI-Institute/gena-lm-bert-base')
26
  ```
27
 
28
  ## Model description
29
- 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:
30
 
31
- - 512 Maximum sequence length
32
  - 12 Layers, 12 Attention heads
33
  - 768 Hidden size
34
- - 32k Vocabulary size
35
-
36
- 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.
37
-
38
- ## Downstream tasks
39
- 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.
40
-
41
- ### Fine-tuning GENA-LM on our data and scoring
42
- After fine-tuning gena-lm-bert-base on promoter prediction dataset, following results were achieved:
43
-
44
- | model | seq_len (bp) | F1 |
45
- |--------------------------|--------------|-------|
46
- | DeePromoter | 300 | 95.60 |
47
- | GENA-LM bert-base (ours) | 2000 | 95.72 |
48
- | BigBird | 16000 | 99.90 |
49
-
50
- We can conclude that our model achieves comparable performance to the previously published results for promoter prediction task.
51
-
 
4
  - human_genome
5
  ---
6
 
7
+ # GENA-LM (BigBird-base T2T)
8
 
9
+ GENA-LM (BigBird-base T2T) is a transformer masked language model trained on human DNA sequence. GENA-LM (BigBird-base T2T) follows BigBird architecture.
10
 
11
+ Differences between GENA-LM (BigBird-base T2T) and DNABERT:
12
  - BPE tokenization instead of k-mers;
13
+ - input sequence size is about 24000 nucleotides (4096 BPE tokens) compared to 510 nucleotides of DNABERT;
14
  - pre-training on T2T vs. GRCh38.p13 human genome assembly.
15
 
16
  Source code and data: https://github.com/AIRI-Institute/GENA_LM
17
 
18
  ## Examples
19
+
20
+ ### Load pre-trained model
21
+ ```python
22
+ from transformers import AutoTokenizer, BigBirdForMaskedLM
23
+
24
+ tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-t2t')
25
+ model = BigBirdForMaskedLM.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-t2t')
26
+ ```
27
+
28
+
29
  ### How to load the model to fine-tune it on classification task
30
  ```python
31
+ from transformers import AutoTokenizer, BigBirdForSequenceClassification
 
32
 
33
+ tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-t2t')
34
+ model = BigBirdForSequenceClassification.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-t2t')
35
  ```
36
 
37
  ## Model description
38
+ GENA-LM (BigBird-base 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-bigbird-base-t2t` is similar to the `google/bigbird-roberta-base`:
39
 
40
+ - 4096 Maximum sequence length
41
  - 12 Layers, 12 Attention heads
42
  - 768 Hidden size
43
+ - sparse config:
44
+ - block size: 64
45
+ - random blocks: 3
46
+ - global blocks: 2
47
+ - sliding window blocks: 3
48
+ - 32k Vocabulary size, tokenizer trained on DNA data.
49
+
50
+ We pre-trained `gena-lm-bigbird-base-t2t` using the latest T2T human genome assembly (https://www.ncbi.nlm.nih.gov/assembly/GCA_009914755.3/). The data was augmented by sampling SNPs human mutations. Pre-training was performed for 1,070,000 iterations with batch size 256.
 
 
 
 
 
 
 
 
 
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8aea90a27ce6c9bf7e7ee6f0da57e0f4971b22a0efa4f5bb73e2b781a99bedaf
3
+ size 456032696