Update README.md
Browse files
README.md
CHANGED
|
@@ -3,7 +3,7 @@ tags:
|
|
| 3 |
- self-supervised-learning
|
| 4 |
- neuroimaging
|
| 5 |
- fMRI
|
| 6 |
-
library_name:
|
| 7 |
inference: false
|
| 8 |
snippets:
|
| 9 |
- torch: |
|
|
@@ -11,9 +11,6 @@ snippets:
|
|
| 11 |
import torch
|
| 12 |
|
| 13 |
model = AutoModel.from_pretrained("SaeedLab/NeuroCLR", trust_remote_code=True)
|
| 14 |
-
# Input shape: [batch, 1, 128]
|
| 15 |
-
x = torch.randn(1, 1, 128)
|
| 16 |
-
output = model(x)
|
| 17 |
---
|
| 18 |
|
| 19 |
# NeuroCLR
|
|
@@ -75,10 +72,7 @@ This model is intended for:
|
|
| 75 |
|
| 76 |
---
|
| 77 |
|
| 78 |
-
##
|
| 79 |
-
|
| 80 |
-
### Load the Pretraining Model (SSL Encoder)
|
| 81 |
-
|
| 82 |
```python
|
| 83 |
import torch
|
| 84 |
from transformers import AutoModel
|
|
@@ -99,6 +93,7 @@ print(outputs["h"].shape) # [4, 128]
|
|
| 99 |
print(outputs["z"].shape)
|
| 100 |
```
|
| 101 |
|
|
|
|
| 102 |
### Load the Downstream Classification Model
|
| 103 |
```py
|
| 104 |
import torch
|
|
|
|
| 3 |
- self-supervised-learning
|
| 4 |
- neuroimaging
|
| 5 |
- fMRI
|
| 6 |
+
library_name: transformers
|
| 7 |
inference: false
|
| 8 |
snippets:
|
| 9 |
- torch: |
|
|
|
|
| 11 |
import torch
|
| 12 |
|
| 13 |
model = AutoModel.from_pretrained("SaeedLab/NeuroCLR", trust_remote_code=True)
|
|
|
|
|
|
|
|
|
|
| 14 |
---
|
| 15 |
|
| 16 |
# NeuroCLR
|
|
|
|
| 72 |
|
| 73 |
---
|
| 74 |
|
| 75 |
+
## Usage (PyTorch)
|
|
|
|
|
|
|
|
|
|
| 76 |
```python
|
| 77 |
import torch
|
| 78 |
from transformers import AutoModel
|
|
|
|
| 93 |
print(outputs["z"].shape)
|
| 94 |
```
|
| 95 |
|
| 96 |
+
|
| 97 |
### Load the Downstream Classification Model
|
| 98 |
```py
|
| 99 |
import torch
|