luxai commited on
Commit
4d3760b
1 Parent(s): 296c003

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +67 -66
README.md CHANGED
@@ -1,66 +1,67 @@
1
- ---
2
- license: cc-by-nc-sa-4.0
3
- tags:
4
- - Helical
5
- - RNA
6
- - Biology
7
- - Transformers
8
- - Genomics
9
- - Mamba2
10
- - Sequence
11
- library_name: transformers
12
- ---
13
- # Mamba2-mRNA
14
- Mamba2-mRNA is a state-space model built on the Mamba2 architecture, trained at single-nucleotide resolution. This innovative model offers several advantages, including faster processing speeds compared to traditional transformer models, efficient handling of long sequences, and reduced memory requirements. Its state-space approach enables better modeling of biological sequences by capturing both local and long-range dependencies in mRNA data. The single-nucleotide resolution allows for precise prediction and analysis of genetic elements.
15
-
16
- # Helical<a name="helical"></a>
17
-
18
- #### Install the package
19
-
20
- Run the following to install the [Helical](https://github.com/helicalAI/helical) package via pip:
21
- ```console
22
- pip install --upgrade helical
23
- ```
24
-
25
- #### Generate Embeddings
26
- ```python
27
- from helical import Mamba2mRNA, Mamba2mRNAConfig
28
- import torch
29
-
30
- device = "cuda" if torch.cuda.is_available() else "cpu"
31
-
32
- input_sequences = ["ACU"*20, "AUG"*20, "AUG"*20, "ACU"*20, "AUU"*20]
33
-
34
- mamba2_mrna_config = Mamba2mRNAConfig(batch_size=5, device=device)
35
- mamba2_mrna = Mamba2mRNA(configurer=mamba2_mrna_config)
36
-
37
- # prepare data for input to the model
38
- processed_input_data = mamba2_mrna.process_data(input_sequences)
39
-
40
- # generate the embeddings for the input data
41
- embeddings = mamba2_mrna.get_embeddings(processed_input_data)
42
- ```
43
-
44
- #### Fine-Tuning
45
- Classification fine-tuning example:
46
- ```python
47
- from helical import Mamba2mRNAFineTuningModel, Mamba2mRNAConfig
48
- import torch
49
-
50
- device = "cuda" if torch.cuda.is_available() else "cpu"
51
-
52
- input_sequences = ["ACU"*20, "AUG"*20, "AUG"*20, "ACU"*20, "AUU"*20]
53
- labels = [0, 2, 2, 0, 1]
54
-
55
- mamba2_mrna_config = Mamba2mRNAConfig(batch_size=5, device=device, max_length=100)
56
- mamba2_mrna_fine_tune = Mamba2mRNAFineTuningModel(mamba2_mrna_config=mamba2_mrna_config, fine_tuning_head="classification", output_size=3)
57
-
58
- # prepare data for input to the model
59
- train_dataset = mamba2_mrna_fine_tune.process_data(input_sequences)
60
-
61
- # fine-tune the model with the relevant training labels
62
- mamba2_mrna_fine_tune.train(train_dataset=train_dataset, train_labels=labels)
63
-
64
- # get outputs from the fine-tuned model on a processed dataset
65
- outputs = mamba2_mrna_fine_tune.get_outputs(train_dataset)
66
- ```
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ tags:
4
+ - Helical
5
+ - rna
6
+ - mrna
7
+ - biology
8
+ - transformers
9
+ - mamba2
10
+ - sequence
11
+ - genomics
12
+ library_name: transformers
13
+ ---
14
+ # Mamba2-mRNA
15
+ Mamba2-mRNA is a state-space model built on the Mamba2 architecture, trained at single-nucleotide resolution. This innovative model offers several advantages, including faster processing speeds compared to traditional transformer models, efficient handling of long sequences, and reduced memory requirements. Its state-space approach enables better modeling of biological sequences by capturing both local and long-range dependencies in mRNA data. The single-nucleotide resolution allows for precise prediction and analysis of genetic elements.
16
+
17
+ # Helical<a name="helical"></a>
18
+
19
+ #### Install the package
20
+
21
+ Run the following to install the [Helical](https://github.com/helicalAI/helical) package via pip:
22
+ ```console
23
+ pip install --upgrade helical
24
+ ```
25
+
26
+ #### Generate Embeddings
27
+ ```python
28
+ from helical import Mamba2mRNA, Mamba2mRNAConfig
29
+ import torch
30
+
31
+ device = "cuda" if torch.cuda.is_available() else "cpu"
32
+
33
+ input_sequences = ["ACU"*20, "AUG"*20, "AUG"*20, "ACU"*20, "AUU"*20]
34
+
35
+ mamba2_mrna_config = Mamba2mRNAConfig(batch_size=5, device=device)
36
+ mamba2_mrna = Mamba2mRNA(configurer=mamba2_mrna_config)
37
+
38
+ # prepare data for input to the model
39
+ processed_input_data = mamba2_mrna.process_data(input_sequences)
40
+
41
+ # generate the embeddings for the input data
42
+ embeddings = mamba2_mrna.get_embeddings(processed_input_data)
43
+ ```
44
+
45
+ #### Fine-Tuning
46
+ Classification fine-tuning example:
47
+ ```python
48
+ from helical import Mamba2mRNAFineTuningModel, Mamba2mRNAConfig
49
+ import torch
50
+
51
+ device = "cuda" if torch.cuda.is_available() else "cpu"
52
+
53
+ input_sequences = ["ACU"*20, "AUG"*20, "AUG"*20, "ACU"*20, "AUU"*20]
54
+ labels = [0, 2, 2, 0, 1]
55
+
56
+ mamba2_mrna_config = Mamba2mRNAConfig(batch_size=5, device=device, max_length=100)
57
+ mamba2_mrna_fine_tune = Mamba2mRNAFineTuningModel(mamba2_mrna_config=mamba2_mrna_config, fine_tuning_head="classification", output_size=3)
58
+
59
+ # prepare data for input to the model
60
+ train_dataset = mamba2_mrna_fine_tune.process_data(input_sequences)
61
+
62
+ # fine-tune the model with the relevant training labels
63
+ mamba2_mrna_fine_tune.train(train_dataset=train_dataset, train_labels=labels)
64
+
65
+ # get outputs from the fine-tuned model on a processed dataset
66
+ outputs = mamba2_mrna_fine_tune.get_outputs(train_dataset)
67
+ ```