Update README.md
Browse files
README.md
CHANGED
|
@@ -46,22 +46,28 @@ The main highlight of this model is the integration of a rare **bilinear layer (
|
|
| 46 |
You can download the architecture file and the model weights directly from this repository:
|
| 47 |
|
| 48 |
```python
|
| 49 |
-
|
| 50 |
-
from huggingface_hub import hf_hub_download
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
hf_hub_download(repo_id=REPO_ID, filename="model_weights_hybrid.pth", local_dir=".")
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
-
# 3. Inference
|
| 65 |
test_input = t.tensor([[-6.0, 70.0, 4.0, -196.0]], dtype=t.float32)
|
| 66 |
with t.no_grad():
|
| 67 |
prediction = model(test_input)
|
|
|
|
| 46 |
You can download the architecture file and the model weights directly from this repository:
|
| 47 |
|
| 48 |
```python
|
| 49 |
+
class WebAISC(nn.Module):
|
|
|
|
| 50 |
|
| 51 |
+
def __init__(self):
|
| 52 |
+
super().__init__()
|
| 53 |
+
self.bilinear = nn.Bilinear(in1_features=2, in2_features=2, out_features=250)
|
|
|
|
| 54 |
|
| 55 |
+
self.x2 = nn.Linear(250, 100)
|
| 56 |
+
self.x3 = nn.Linear(100, 250)
|
| 57 |
+
self.x4 = nn.Linear(250, 1)
|
| 58 |
+
self.selu = nn.SELU()
|
| 59 |
|
| 60 |
+
def forward(self, x):
|
| 61 |
+
a = x[:, 0:2]
|
| 62 |
+
b = x[:, 2:4]
|
| 63 |
+
|
| 64 |
+
x = self.selu(self.bilinear(a, b))
|
| 65 |
+
|
| 66 |
+
x = self.selu(self.x2(x))
|
| 67 |
+
x = self.selu(self.x3(x))
|
| 68 |
+
x = self.x4(x)
|
| 69 |
+
return x
|
| 70 |
|
|
|
|
| 71 |
test_input = t.tensor([[-6.0, 70.0, 4.0, -196.0]], dtype=t.float32)
|
| 72 |
with t.no_grad():
|
| 73 |
prediction = model(test_input)
|